[10066] | 1 | This document describes how the GPDL compiler can be built on |
---|
| 2 | Windows and Linux systems. |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | Windows |
---|
| 6 | ------- |
---|
| 7 | |
---|
| 8 | You can either use Visual Studio including the free Express Edition to |
---|
| 9 | open the solution file HeuristicLab.Problems.GPDL.sln, or |
---|
| 10 | alternatively you can use the msbuild command. For convenience we also |
---|
| 11 | provide the 'Build.cmd' script which can be used to build the |
---|
| 12 | solution. |
---|
| 13 | |
---|
| 14 | > Build.cmd |
---|
| 15 | |
---|
| 16 | The binary files will be generated in 'bin' folders within the |
---|
| 17 | projects. To try the SyntaxAnalyser use the command (from the solution |
---|
| 18 | directory): |
---|
| 19 | |
---|
| 20 | > SyntaxAnalyser/bin/Debug/SyntaxAnalyser.exe Examples/Multiplexer.txt |
---|
| 21 | |
---|
| 22 | There are more GPDL example files in the folder 'Examples'. |
---|
| 23 | |
---|
| 24 | To try the GPDL compiler use the following command: |
---|
| 25 | |
---|
| 26 | > GpdlCompiler/bin/Debug/GpdlCompiler.exe Example/Multiplexer.txt |
---|
| 27 | |
---|
| 28 | This will generate the file 'Multiplexer.cs' which can be compiled |
---|
| 29 | with the C# compiler: |
---|
| 30 | |
---|
| 31 | > csc Multiplexer.cs |
---|
| 32 | > Multiplexer.exe |
---|
| 33 | |
---|
| 34 | Linux |
---|
| 35 | ----- |
---|
| 36 | |
---|
| 37 | On Linux the compiler can be build with Mono. The source uses C# 4.0 |
---|
| 38 | syntax so you need a recent version of Mono that supports C# 4.0 (we |
---|
| 39 | tested with mono 2.10.8.1). |
---|
| 40 | |
---|
| 41 | On the development system (Debian Wheezy) the following packages and |
---|
| 42 | their requirements need to be installed: |
---|
| 43 | * mono-mcs |
---|
| 44 | * mono-xbuild |
---|
| 45 | * mono-dmcs |
---|
| 46 | * mono-gmcs |
---|
| 47 | |
---|
| 48 | To build the solution use the xbuild command. xbuild is the mono |
---|
| 49 | equivalent for the msbuild command and can be used to build Visual |
---|
| 50 | Studio solution files on Linux. |
---|
| 51 | |
---|
| 52 | > xbuild HeuristicLab.Problems.GPDL.sln |
---|
| 53 | |
---|
| 54 | The compiled binaries will be generated in 'bin/' folders within the |
---|
| 55 | projects. |
---|
| 56 | To test the syntax analyser use the command: |
---|
| 57 | |
---|
| 58 | > mono SyntaxAnalyser/bin/Debug/SyntaxAnalyser.exe Examples/LawnMower.txt |
---|
| 59 | |
---|
| 60 | There are further examples of GPDL definition files in the 'Examples' |
---|
| 61 | folder. |
---|
| 62 | |
---|
| 63 | To test the compiler use the command: |
---|
| 64 | > mono GpdlCompiler/bin/Debug/GpdlCompuler.exe Examples/LawnMower.txt |
---|
| 65 | |
---|
| 66 | This command will generate the C# source file of the solver |
---|
| 67 | 'Lawnmower.cs' which can be compiled to an executable using the |
---|
| 68 | C#-compiler |
---|
| 69 | |
---|
| 70 | > mcs LawnMower.cs |
---|
| 71 | > mono LawnMower.exe |
---|
| 72 | |
---|
| 73 | MacOS |
---|
| 74 | ----- |
---|
| 75 | |
---|
| 76 | We have not yet tried to build the source on MacOS with Mono. Most |
---|
| 77 | likely it is necessary to create a 'GenerateFromAtg' script which |
---|
| 78 | works on MacOS. Additionally, the pre-build events of the two projects |
---|
| 79 | 'HeuristicLab.Problems.GPDL.csprj' and 'SyntaxAnalyser.csprj' have to |
---|
| 80 | be changed to call the correct script. Please let us know if you |
---|
| 81 | manage to compile and run the GPDL compiler on MacOS! |
---|
| 82 | |
---|
| 83 | Oct. 2013, Gabriel Kronberger |
---|