To build the project it is recommnded to use some POSIX or POSIX like environment - it guaratees that both project's own builder and possible dependancies builders will work correctly.
Currently it is required to have installed:
g++
at version that supports C++11 (e.g. 4.7.2
),bison
at version at least 2.5
,flex
(Fast Lexical Analyser
not Adobe's Flex
),gmp
(GNU MultiPrecision
),boost
libraries,scons
builder.On majority of Linux distributions those tools can be obtained by their respective pagage mangers. For instance Debian's APT can download the with following command:
On distrubutions where either package managers are not available or some library is not obtainable that way it still possible to build it with instructions attatched to the respective project.
On Windows it is recommended to build project using Cygwin
environment or similar.
Following packages should be installed among its dependencies:
gcc-core
,gcc-c++
,bison
,flex
,scons
,gmp
,libgmp-devel
,libgmp10
,libgmpxx4
,glpk
,libglpk-devel
,libglpk.35
.Boost
libraries need to be build manually separately since version provided with Cygwin
doesn't contain e.g. Boost Unit Test Framework
. After downloading and extracting source to directory of choice call commands under Cygwin terminal:
making sure that choosen architecture matches Cygwin
's one. Alternatively you might try any other tutorial explaining how to install Boost on Windows and make it visible to Cygwin
environment.
If you want to use Clang instead of GCC keep in mind that at least version 1.48
of boost generates errors in Clang that are not displayed by GCC. To avoid it use Clang version that fully supports C++11 and Boost
version with this issue fixed e.g. Clang 3.3
and Boost 1.54
:
It is caused by lack of typename
word that was fixed somwhere between 1.49
and 1.50.0-beta1
(see https://github.com/boostorg/container/commit/7f1456c30fa5ed58af912d67352f55bc961be55e ). GCC didn't treated it as error (mistakingly?) and so it ended up in a released version.
Once all dependencies are available project can be build with scons
script. Navigate to the project directory with terminal and call chosen command to build respective target:
scons -Q buildModels
- builds Models' classes,scons -Q buildModelsTests
- builds Models' test classes with dependancies,scons -Q runModelsTests
- runs Models' test classes building theirs dependancies,scons -Q buildRoutines
- builds Routines' classes,scons -Q buildRoutinesTests
- builds Routines' test classes with dependancies,scons -Q runRoutinesTests
- runs Routines' test classes building theirs dependancies,scons -Q buildParserClasses
- builds Parser and Scanner with yacc (bison) and lex (flex),scons -Q buildGTL
- builds GTL classes,scons -Q buildGTLTests
- builds GTL test classes with dependancies,scons -Q runGTLTests
- runs GTL test classes building theirs dependancies,scons -Q buildPrograms
- builds Program's Controllers classes,scons -Q buildProgramsTests
- builds Program's Controllers test classes with dependancies,scons -Q runProgramsTests
- runs Program's Controllers test classes building theirs dependancies,scons -Q buildExecutables
- builds actual executables,scons -Q buildLibraries
- builds static and shared library with Models and Routines. Running it without any argument will simply build all targets.Usually you'd want to build either execuitables or libraries depending on wheter you want to run GTL parser or use library in a C++ program.
To build project using Clang define environment variables CXX
and CC
:
To build project with statically linked libraries use static=1
argument e.g.:
To build project in debug mode use debug=1
argument e.g.:
By default it is turend off (release mode).
To build project with optimized binaries use optimize=1
argument e.g.:
It's by default turned on on release and turned off on debug mode.