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