Go to the documentation of this file.
33 #include <boost/format.hpp>
39 #include "tce_config.h"
57 " -fno-working-directory "
58 "-fno-enforce-eh-specs "
60 "-fno-rtti -DNDEBUG ";
83 std::string USER_THREAD_COUNT =
85 if (USER_THREAD_COUNT !=
"") {
91 std::string USER_COMPILER =
93 if (USER_COMPILER !=
"") {
126 const string& dirName,
128 bool verbose)
const {
131 "make -sC " + dirName +
" CC=\"" +
compiler_ +
"\" opt_flags=\"" +
137 <<
"Compiling the simulation engine with command "
141 time_t startTime = std::time(NULL);
142 int retval = system(command.c_str());
143 time_t endTime = std::time(NULL);
145 time_t elapsed = endTime - startTime;
149 <<
"Compiling the simulation engine with opt. switches '"
151 <<
"' took " << elapsed / 60 <<
"m " << (elapsed % 60) <<
"s "
169 const std::string& path,
171 const string& outputExtension,
172 bool verbose)
const {
182 for (vector<string>::const_iterator it = includePaths.begin();
183 it != includePaths.end(); ++it) {
184 includes +=
"-I" + *it +
" ";
194 + path +
" -o " + directory +
DS + fileNameBody + outputExtension;
196 return system(command.c_str());
211 const std::string& path,
213 bool verbose)
const {
int compileDirectory(const std::string &dirName, const std::string &flags="", bool verbose=false) const
static const char * COMPILED_SIM_SO_FLAGS
flags used when compiling .so files
static const char * COMPILED_SIM_CPP_FLAGS
cpp flags used for compiled simulation
static std::ostream & logStream()
virtual ~CompiledSimCompiler()
static std::string fileOfPath(const std::string pathName)
static std::string toString(const T &source)
int threadCount_
Number of threads to use while compiling through a Makefile.
std::string compiler_
The compiler to use.
static std::vector< std::string > includeDirPaths()
static std::string directoryOfPath(const std::string fileName)
static const std::string DIRECTORY_SEPARATOR
int compileFile(const std::string &path, const std::string &flags="", const std::string &outputExtension=".o", bool verbose=false) const
int compileToSO(const std::string &path, const std::string &flags="", bool verbose=false) const
std::string globalCompileFlags_
Global compile flags (from env variable)
static int toInt(const T &source)
static std::string environmentVariable(const std::string &variable)
static std::string fileNameBody(const std::string &fileName)