Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
GppCompilerStrategy Class Reference

Compilation strategy using the g++ compiler. More...

#include <GppCompilerStrategy.h>

Inheritance diagram for GppCompilerStrategy:
Collaboration diagram for GppCompilerStrategy:

Public Member Functions

 GppCompilerStrategy (std::string model, std::string wilson)
 Constructs a GppCompilerStrategy for a given (model, wilson) pair.
 
void compile_run (const std::string &sourceFile, const std::string &outputBinary) override
 Compiles if necessary and then runs the resulting binary.
 
void compile (const std::string &sourceFile, const std::string &outputBinary) override
 Compiles the given source file using g++ and links against MARTY.
 
- Public Member Functions inherited from CompilerStrategy
 CompilerStrategy (std::string model, std::string wilson)
 Constructs a CompilerStrategy with a given model and Wilson label.
 
virtual ~CompilerStrategy ()=default
 Virtual destructor.
 
virtual bool check_if_compile (const std::string &outputBinary)
 Checks whether a compiled binary already exists and is non-empty.
 

Additional Inherited Members

- Protected Attributes inherited from CompilerStrategy
std::string model
 Model name.
 
std::string wilson
 Wilson basis / label name.
 

Detailed Description

Compilation strategy using the g++ compiler.

GppCompilerStrategy:

  • checks whether a binary already exists (via check_if_compile()),
  • if needed, compiles the provided source file into an executable,
  • finally runs the executable from the output directory managed by FileNameManager.

Definition at line 32 of file GppCompilerStrategy.h.

Constructor & Destructor Documentation

◆ GppCompilerStrategy()

GppCompilerStrategy::GppCompilerStrategy ( std::string  model,
std::string  wilson 
)
inline

Constructs a GppCompilerStrategy for a given (model, wilson) pair.

Parameters
modelModel name (used only as metadata; compilation flags are global).
wilsonWilson basis / label (used to locate output directories).

Definition at line 41 of file GppCompilerStrategy.h.

Member Function Documentation

◆ compile()

void GppCompilerStrategy::compile ( const std::string &  sourceFile,
const std::string &  outputBinary 
)
overridevirtual

Compiles the given source file using g++ and links against MARTY.

The command line typically includes:

  • -L<MARTY_INSTALL>/lib
  • -Wl,-rpath,<MARTY_INSTALL>/lib
  • -lmarty
  • the absolute libgfortran.so path discovered from g++/gfortran
Parameters
sourceFilePath to the generated C++ source.
outputBinaryPath/name of the executable to produce.

Implements CompilerStrategy.

Definition at line 84 of file GppCompilerStrategy.cpp.

◆ compile_run()

void GppCompilerStrategy::compile_run ( const std::string &  sourceFile,
const std::string &  outputBinary 
)
overridevirtual

Compiles if necessary and then runs the resulting binary.

If check_if_compile() returns false, compile() is called first. The binary is then executed from the directory returned by FileNameManager::getOutputDir().

Parameters
sourceFilePath to the generated C++ source file.
outputBinaryName/path of the executable to create and run.

Implements CompilerStrategy.

Definition at line 75 of file GppCompilerStrategy.cpp.


The documentation for this class was generated from the following files: