Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CompilerStrategy.h File Reference

Declares compilation strategies and utilities for executing shell commands. More...

#include <string>
#include <fstream>
#include <sys/stat.h>
#include <iostream>
#include <cstdio>
#include <memory>
#include <array>
#include <stdexcept>
#include "Include.h"
Include dependency graph for CompilerStrategy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CompilerStrategy
 Abstract base class for compilation and run strategies. More...
 

Functions

bool executeCommand (const std::string &command)
 Executes a shell command and captures its output.
 

Detailed Description

Declares compilation strategies and utilities for executing shell commands.

This header defines:

  • CompilerStrategy: an abstract base class for different compilation backends (e.g. g++, make-based).
  • executeCommand(): a small helper to run shell commands and capture errors.

These are mainly used in the MARTY interface layer to build and run generated C++ code for Wilson coefficients and matching routines.

Definition in file CompilerStrategy.h.

Function Documentation

◆ executeCommand()

bool executeCommand ( const std::string &  command)

Executes a shell command and captures its output.

The command string is executed via popen(), with stderr redirected to stdout (using 2>&1). The complete output is read and, on failure, printed to std::cerr.

Parameters
commandShell command to execute.
Returns
true if the command exited with status 0.
Exceptions
std::runtime_errorif the command cannot be started or exits with a non-zero status. This intentionally stops the MARTY pipeline at the first failing command instead of cascading into missing-file errors.

Definition at line 6 of file CompilerStrategy.cpp.