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