OpenASIP  2.0
CompiledSimCompiler.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file CompiledSimCompiler.hh
26  *
27  * Declaration of CompiledSimCompiler class.
28  *
29  * @author Viljami Korhonen 2007 (viljami.korhonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef COMPILED_SIM_COMPILER_HH
34 #define COMPILED_SIM_COMPILER_HH
35 
36 #include <string>
37 
38 /**
39  * A class for compiling the dynamic libraries used by the compiled simulator
40  */
42 public:
44  virtual ~CompiledSimCompiler();
45 
46  int compileDirectory(
47  const std::string& dirName,
48  const std::string& flags = "",
49  bool verbose = false) const;
50 
51  int compileFile(
52  const std::string& path,
53  const std::string& flags = "",
54  const std::string& outputExtension = ".o",
55  bool verbose = false) const;
56 
57  int compileToSO(
58  const std::string& path,
59  const std::string& flags = "",
60  bool verbose = false) const;
61 
62  /// cpp flags used for compiled simulation
63  static const char* COMPILED_SIM_CPP_FLAGS;
64 
65  /// flags used when compiling .so files
66  static const char* COMPILED_SIM_SO_FLAGS;
67 
68 private:
69  /// Copying not allowed.
71  /// Assignment not allowed.
73 
74  /// Number of threads to use while compiling through a Makefile
76  /// The compiler to use
77  std::string compiler_;
78  /// Global compile flags (from env variable)
79  std::string globalCompileFlags_;
80 };
81 
82 #endif
CompiledSimCompiler::compileDirectory
int compileDirectory(const std::string &dirName, const std::string &flags="", bool verbose=false) const
Definition: CompiledSimCompiler.cc:125
CompiledSimCompiler::COMPILED_SIM_SO_FLAGS
static const char * COMPILED_SIM_SO_FLAGS
flags used when compiling .so files
Definition: CompiledSimCompiler.hh:66
CompiledSimCompiler::CompiledSimCompiler
CompiledSimCompiler()
Definition: CompiledSimCompiler.cc:79
CompiledSimCompiler::COMPILED_SIM_CPP_FLAGS
static const char * COMPILED_SIM_CPP_FLAGS
cpp flags used for compiled simulation
Definition: CompiledSimCompiler.hh:63
CompiledSimCompiler::~CompiledSimCompiler
virtual ~CompiledSimCompiler()
Definition: CompiledSimCompiler.cc:108
CompiledSimCompiler::threadCount_
int threadCount_
Number of threads to use while compiling through a Makefile.
Definition: CompiledSimCompiler.hh:75
CompiledSimCompiler
Definition: CompiledSimCompiler.hh:41
CompiledSimCompiler::compiler_
std::string compiler_
The compiler to use.
Definition: CompiledSimCompiler.hh:77
CompiledSimCompiler::compileFile
int compileFile(const std::string &path, const std::string &flags="", const std::string &outputExtension=".o", bool verbose=false) const
Definition: CompiledSimCompiler.cc:168
CompiledSimCompiler::compileToSO
int compileToSO(const std::string &path, const std::string &flags="", bool verbose=false) const
Definition: CompiledSimCompiler.cc:210
CompiledSimCompiler::globalCompileFlags_
std::string globalCompileFlags_
Global compile flags (from env variable)
Definition: CompiledSimCompiler.hh:79
CompiledSimCompiler::operator=
CompiledSimCompiler & operator=(const CompiledSimCompiler &)
Assignment not allowed.