[5] | 1 | Installation Instructions |
---|
| 2 | ========================= |
---|
| 3 | |
---|
[1148] | 4 | This file contains instructions for building and installing LEMON from |
---|
| 5 | source on Linux. The process on Windows is similar. |
---|
[5] | 6 | |
---|
[1148] | 7 | Note that it is not necessary to install LEMON in order to use |
---|
| 8 | it. Instead, you can easily integrate it with your own code |
---|
| 9 | directly. For instructions, see |
---|
| 10 | https://lemon.cs.elte.hu/trac/lemon/wiki/HowToCompile |
---|
| 11 | |
---|
[526] | 12 | |
---|
[318] | 13 | In order to install LEMON from the extracted source tarball you have to |
---|
[5] | 14 | issue the following commands: |
---|
| 15 | |
---|
[1148] | 16 | 1. Step into the root of the source directory. |
---|
[5] | 17 | |
---|
[1148] | 18 | $ cd lemon-x.y.z |
---|
[5] | 19 | |
---|
[1148] | 20 | 2. Create a build subdirectory and step into it. |
---|
[5] | 21 | |
---|
[1148] | 22 | $ mkdir build |
---|
| 23 | $ cd build |
---|
[5] | 24 | |
---|
[1148] | 25 | 3. Perform system checks and create the makefiles. |
---|
[5] | 26 | |
---|
[1148] | 27 | $ cmake .. |
---|
[5] | 28 | |
---|
[1148] | 29 | 4. Build LEMON. |
---|
[5] | 30 | |
---|
[1148] | 31 | $ make |
---|
[5] | 32 | |
---|
[1148] | 33 | This command compiles the non-template part of LEMON into |
---|
| 34 | libemon.a file. It also compiles the programs in the 'tools' and |
---|
| 35 | 'demo' subdirectories. |
---|
| 36 | |
---|
| 37 | 5. [Optional] Compile and run the self-tests. |
---|
| 38 | |
---|
| 39 | $ make check |
---|
| 40 | |
---|
| 41 | 5. [Optional] Generate the user documentation. |
---|
| 42 | |
---|
| 43 | $ make html |
---|
| 44 | |
---|
| 45 | The release tarballs already include the documentation. |
---|
| 46 | |
---|
| 47 | Note that for this step you need to have the following tools |
---|
| 48 | installed: Python, Doxygen, Graphviz, Ghostscript, LaTeX. |
---|
| 49 | |
---|
| 50 | 6. [Optional] Install LEMON |
---|
| 51 | |
---|
| 52 | $ make install |
---|
[5] | 53 | |
---|
[245] | 54 | This command installs LEMON under /usr/local (you will need root |
---|
[1148] | 55 | privileges to be able to do that). If you want to install it to |
---|
| 56 | some other location, then pass the |
---|
| 57 | -DCMAKE_INSTALL_PREFIX=DIRECTORY flag to cmake in Step 3. |
---|
| 58 | For example: |
---|
| 59 | |
---|
| 60 | $ cmake -DCMAKE_INSTALL_PREFIX=/home/username/lemon' |
---|
[5] | 61 | |
---|
[245] | 62 | Configure Options and Variables |
---|
| 63 | =============================== |
---|
| 64 | |
---|
[1148] | 65 | In Step 3, you can customize the build process by passing options to CMAKE. |
---|
[245] | 66 | |
---|
[1148] | 67 | $ cmake [OPTIONS] .. |
---|
[245] | 68 | |
---|
[1148] | 69 | You find a list of the most useful options below. |
---|
[5] | 70 | |
---|
[1148] | 71 | -DCMAKE_INSTALL_PREFIX=PREFIX |
---|
[245] | 72 | |
---|
| 73 | Set the installation prefix to PREFIX. By default it is /usr/local. |
---|
[5] | 74 | |
---|
[1148] | 75 | -DCMAKE_BUILD_TYPE=[Release|Debug|Maintainer|...] |
---|
[245] | 76 | |
---|
[1148] | 77 | This sets the compiler options. The choices are the following |
---|
[245] | 78 | |
---|
[1148] | 79 | 'Release': A strong optimization is turned on (-O3 with gcc). This |
---|
| 80 | is the default setting and we strongly recommend using this for |
---|
| 81 | the final compilation. |
---|
[245] | 82 | |
---|
[1148] | 83 | 'Debug': Optimization is turned off and debug info is added (-O0 |
---|
| 84 | -ggdb with gcc). If is recommended during the development. |
---|
[5] | 85 | |
---|
[1148] | 86 | 'Maintainer': The same as 'Debug' but the compiler warnings are |
---|
| 87 | converted to errors (-Werror with gcc). In addition, 'make' will |
---|
| 88 | also automatically compile and execute the test codes. It is the |
---|
| 89 | best way of ensuring that LEMON codebase is clean and safe. |
---|
[5] | 90 | |
---|
[1148] | 91 | 'RelWithDebInfo': Optimized build with debug info. |
---|
[5] | 92 | |
---|
[1148] | 93 | 'MinSizeRel': Size optimized build (-Os with gcc) |
---|
[5] | 94 | |
---|
[1148] | 95 | -DTEST_WITH_VALGRIND=YES |
---|
[5] | 96 | |
---|
[1148] | 97 | Using this, the test codes will be executed using valgrind. It is a |
---|
| 98 | very effective way of identifying indexing problems and memory leaks. |
---|
[5] | 99 | |
---|
[1148] | 100 | -DCMAKE_CXX_COMPILER=path-to-compiler |
---|
[5] | 101 | |
---|
[1148] | 102 | Change the compiler to be used. |
---|
[5] | 103 | |
---|
[1148] | 104 | -DBUILD_SHARED_LIBS=TRUE |
---|
[5] | 105 | |
---|
[1148] | 106 | Build shared library instead of static one. Think twice if you |
---|
| 107 | really want to use this option. |
---|
[5] | 108 | |
---|
[1232] | 109 | -DLEMON_DOC_SOURCE_BROWSER=YES |
---|
| 110 | |
---|
| 111 | Include the browsable cross referenced LEMON source code into the |
---|
| 112 | doc. It makes the doc quite bloated, but may be useful for |
---|
| 113 | developing LEMON itself. |
---|
| 114 | |
---|
| 115 | -DLEMON_DOC_USE_MATHJAX=YES |
---|
| 116 | |
---|
| 117 | Use MathJax (http://mathjax.org) for rendering the math formulae in |
---|
| 118 | the doc. It of much higher quality compared to the default LaTeX |
---|
| 119 | generated static images and it allows copy&paste of the formulae to |
---|
| 120 | LaTeX, Open Office, MS Word etc. documents. |
---|
| 121 | |
---|
| 122 | On the other hand, it needs either Internet access or a locally |
---|
| 123 | installed version of MathJax to properly render the doc. |
---|
| 124 | |
---|
| 125 | -DLEMON_DOC_MATHJAX_RELPATH=DIRECTORY |
---|
| 126 | |
---|
| 127 | The location of the MathJax library. It defaults to |
---|
| 128 | http://www.mathjax.org/mathjax, which necessitates Internet access |
---|
| 129 | for proper rendering. The easiest way to make it usable offline is |
---|
| 130 | to set this parameter to 'mathjax' and copy all files of the MathJax |
---|
| 131 | library into the 'doc/html/mathjax' subdirectory of the build |
---|
| 132 | location. |
---|
| 133 | |
---|
| 134 | See http://docs.mathjax.org/en/latest/installation.html for more details. |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | -DLEMON_ENABLE_GLPK=NO |
---|
| 138 | -DLEMON_ENABLE_COIN=NO |
---|
| 139 | -DLEMON_ENABLE_ILOG=NO |
---|
| 140 | |
---|
| 141 | Enable optional third party libraries. They are all enabled by default. |
---|
| 142 | |
---|
| 143 | -DLEMON_DEFAULT_LP=GLPK |
---|
| 144 | |
---|
| 145 | Sets the default LP solver backend. The supported values are |
---|
| 146 | CPLEX, CLP and GLPK. By default, it is set to the first one which |
---|
| 147 | is enabled and succesfully discovered. |
---|
| 148 | |
---|
| 149 | -DLEMON_DEFAULT_MIP=GLPK |
---|
| 150 | |
---|
| 151 | Sets the default MIP solver backend. The supported values are |
---|
| 152 | CPLEX, CBC and GLPK. By default, it is set to the first one which |
---|
| 153 | is enabled and succesfully discovered. |
---|
| 154 | |
---|
[1148] | 155 | -DGLPK_ROOT_DIR=DIRECTORY |
---|
| 156 | -DCOIN_ROOT_DIR=DIRECTORY |
---|
[1230] | 157 | -DILOG_ROOT_DIR=DIRECTORY |
---|
[5] | 158 | |
---|
[1232] | 159 | Root directory prefixes of optional third party libraries. |
---|
[890] | 160 | |
---|
| 161 | Makefile Variables |
---|
| 162 | ================== |
---|
| 163 | |
---|
[1148] | 164 | make VERBOSE=1 |
---|
[890] | 165 | |
---|
[1148] | 166 | This results in a more verbose output by showing the full |
---|
| 167 | compiler and linker commands. |
---|