INSTALL
changeset 1022 523e45e37e52
parent 824 974c48bda29e
child 1040 60c0c3ed8d11
child 1062 caf16813b1e8
equal deleted inserted replaced
6:81236520069b 7:b9dd3e378797
     1 Installation Instructions
     1 Installation Instructions
     2 =========================
     2 =========================
     3 
     3 
     4 Since you are reading this I assume you already obtained one of the release
     4 This file contains instructions for building and installing LEMON from
     5 tarballs and successfully extracted it. The latest version of LEMON is
     5 source on Linux. The process on Windows is similar.
     6 available at our web page (http://lemon.cs.elte.hu/).
       
     7 
     6 
     8 LEMON provides two different build environments, one is based on "autotool",
     7 Note that it is not necessary to install LEMON in order to use
     9 while the other is based on "cmake". This file contains instructions only for
     8 it. Instead, you can easily integrate it with your own code
    10 the former one, which is the recommended build environment on Linux, Mac OSX
     9 directly. For instructions, see
    11 and other unices or if you use Cygwin on Windows. For cmake installation
    10 https://lemon.cs.elte.hu/trac/lemon/wiki/HowToCompile
    12 instructions visit http://lemon.cs.elte.hu.
    11 
    13 
    12 
    14 In order to install LEMON from the extracted source tarball you have to
    13 In order to install LEMON from the extracted source tarball you have to
    15 issue the following commands:
    14 issue the following commands:
    16 
    15 
    17    1. `cd lemon-x.y.z'
    16    1. Step into the root of the source directory.
    18 
    17 
    19       This command changes to the directory which was created when you
    18       $ cd lemon-x.y.z
    20       extracted the sources. The x.y.z part is a version number.
       
    21 
    19 
    22    2. `./configure'
    20    2. Create a build subdirectory and step into it.
    23 
    21 
    24       This command runs the configure shell script, which does some checks and
    22       $ mkdir build
    25       creates the makefiles.
    23       $ cd build
    26 
    24 
    27    3. `make'
    25    3. Perform system checks and create the makefiles.
    28 
    26 
    29       This command compiles the non-template part of LEMON into libemon.a
    27       $ cmake ..
    30       file. It also compiles the programs in the tools subdirectory by
       
    31       default.
       
    32 
    28 
    33    4. `make check'
    29    4. Build LEMON.
    34 
    30 
    35       This step is optional, but recommended. It runs the test programs that
    31       $ make 
    36       we developed for LEMON to check whether the library works properly on
       
    37       your platform.
       
    38 
    32 
    39    5. `make install'
    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
    40 
    53 
    41       This command installs LEMON under /usr/local (you will need root
    54       This command installs LEMON under /usr/local (you will need root
    42       privileges to be able to do that). If you want to install it to some
    55       privileges to be able to do that). If you want to install it to
    43       other location, then pass the --prefix=DIRECTORY flag to configure in
    56       some other location, then pass the
    44       step 2. For example: `./configure --prefix=/home/username/lemon'.
    57       -DCMAKE_INSTALL_PREFIX=DIRECTORY flag to cmake in Step 3.
    45 
    58       For example:
    46    6. `make install-html'
    59       
    47 
    60       $ cmake -DCMAKE_INSTALL_PREFIX=/home/username/lemon'
    48       This command installs the documentation under share/doc/lemon/docs. The
       
    49       generated documentation is included in the tarball. If you want to
       
    50       generate it yourself, then run `make html'. Note that for this you need
       
    51       to have the following programs installed: Doxygen, Graphviz, Ghostscript,
       
    52       Latex.
       
    53 
       
    54 
    61 
    55 Configure Options and Variables
    62 Configure Options and Variables
    56 ===============================
    63 ===============================
    57 
    64 
    58 In step 2 you can customize the actions of configure by setting variables
    65 In Step 3, you can customize the build process by passing options to CMAKE.
    59 and passing options to it. This can be done like this:
       
    60 `./configure [OPTION]... [VARIABLE=VALUE]...'
       
    61 
    66 
    62 Below you will find some useful variables and options (see `./configure --help'
    67 $ cmake [OPTIONS] ..
    63 for more):
       
    64 
    68 
    65 CXX='comp'
    69 You find a list of the most useful options below.
    66 
    70 
    67   Change the C++ compiler to 'comp'.
    71 -DCMAKE_INSTALL_PREFIX=PREFIX
    68 
       
    69 CXXFLAGS='flags'
       
    70 
       
    71   Pass the 'flags' to the compiler. For example CXXFLAGS='-O3 -march=pentium-m'
       
    72   turns on generation of aggressively optimized Pentium-M specific code.
       
    73 
       
    74 --prefix=PREFIX
       
    75 
    72 
    76   Set the installation prefix to PREFIX. By default it is /usr/local.
    73   Set the installation prefix to PREFIX. By default it is /usr/local.
    77 
    74 
    78 --enable-tools
    75 -DCMAKE_BUILD_TYPE=[Release|Debug|Maintainer|...]
    79 
    76 
    80    Build the programs in the tools subdirectory (default).
    77   This sets the compiler options. The choices are the following
    81 
    78 
    82 --disable-tools
    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.
    83 
    82 
    84    Do not build the programs in the tools subdirectory.
    83   'Debug': Optimization is turned off and debug info is added (-O0
       
    84     -ggdb with gcc). If is recommended during the development.
    85 
    85 
    86 --with-glpk[=PREFIX]
    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.
    87 
    90 
    88    Enable GLPK support (default). You should specify the prefix too if
    91   'RelWithDebInfo': Optimized build with debug info.
    89    you installed GLPK to some non-standard location (e.g. your home
       
    90    directory). If it is not found, GLPK support will be disabled.
       
    91 
    92 
    92 --with-glpk-includedir=DIR
    93   'MinSizeRel': Size optimized build (-Os with gcc)
    93 
    94 
    94    The directory where the GLPK header files are located. This is only
    95 -DTEST_WITH_VALGRIND=YES
    95    useful when the GLPK headers and libraries are not under the same
       
    96    prefix (which is unlikely).
       
    97 
    96 
    98 --with-glpk-libdir=DIR
    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.
    99 
    99 
   100    The directory where the GLPK libraries are located. This is only
   100 -DCMAKE_CXX_COMPILER=path-to-compiler
   101    useful when the GLPK headers and libraries are not under the same
       
   102    prefix (which is unlikely).
       
   103 
   101 
   104 --without-glpk
   102   Change the compiler to be used.
   105 
   103 
   106    Disable GLPK support.
   104 -DBUILD_SHARED_LIBS=TRUE
   107 
   105 
   108 --with-cplex[=PREFIX]
   106   Build shared library instead of static one. Think twice if you
       
   107   really want to use this option.
   109 
   108 
   110    Enable CPLEX support (default). You should specify the prefix too
   109 -DGLPK_ROOT_DIR=DIRECTORY
   111    if you installed CPLEX to some non-standard location
   110 -DCOIN_ROOT_DIR=DIRECTORY
   112    (e.g. /opt/ilog/cplex75). If it is not found, CPLEX support will be
   111 -DCPLEX_ROOT_DIR=DIRECTORY
   113    disabled.
       
   114 
   112 
   115 --with-cplex-includedir=DIR
   113   Install root directory prefixes of optional third party libraries.
   116 
       
   117    The directory where the CPLEX header files are located. This is
       
   118    only useful when the CPLEX headers and libraries are not under the
       
   119    same prefix (e.g.  /usr/local/cplex/cplex75/include).
       
   120 
       
   121 --with-cplex-libdir=DIR
       
   122 
       
   123    The directory where the CPLEX libraries are located. This is only
       
   124    useful when the CPLEX headers and libraries are not under the same
       
   125    prefix (e.g.
       
   126    /usr/local/cplex/cplex75/lib/i86_linux2_glibc2.2_gcc3.0/static_pic_mt).
       
   127 
       
   128 --without-cplex
       
   129 
       
   130    Disable CPLEX support.
       
   131 
       
   132 --with-soplex[=PREFIX]
       
   133 
       
   134    Enable SoPlex support (default). You should specify the prefix too if
       
   135    you installed SoPlex to some non-standard location (e.g. your home
       
   136    directory). If it is not found, SoPlex support will be disabled.
       
   137 
       
   138 --with-soplex-includedir=DIR
       
   139 
       
   140    The directory where the SoPlex header files are located. This is only
       
   141    useful when the SoPlex headers and libraries are not under the same
       
   142    prefix (which is unlikely).
       
   143 
       
   144 --with-soplex-libdir=DIR
       
   145 
       
   146    The directory where the SoPlex libraries are located. This is only
       
   147    useful when the SoPlex headers and libraries are not under the same
       
   148    prefix (which is unlikely).
       
   149 
       
   150 --without-soplex
       
   151 
       
   152    Disable SoPlex support.
       
   153 
       
   154 --with-coin[=PREFIX]
       
   155 
       
   156    Enable support for COIN-OR solvers (CLP and CBC). You should
       
   157    specify the prefix too. (by default, COIN-OR tools install
       
   158    themselves to the source code directory). This command enables the
       
   159    solvers that are actually found.
       
   160 
       
   161 --with-coin-includedir=DIR
       
   162 
       
   163    The directory where the COIN-OR header files are located. This is
       
   164    only useful when the COIN-OR headers and libraries are not under
       
   165    the same prefix (which is unlikely).
       
   166 
       
   167 --with-coin-libdir=DIR
       
   168 
       
   169    The directory where the COIN-OR libraries are located. This is only
       
   170    useful when the COIN-OR headers and libraries are not under the
       
   171    same prefix (which is unlikely).
       
   172 
       
   173 --without-coin
       
   174 
       
   175    Disable COIN-OR support.
       
   176 
       
   177 
   114 
   178 Makefile Variables
   115 Makefile Variables
   179 ==================
   116 ==================
   180 
   117 
   181 Some Makefile variables are reserved by the GNU Coding Standards for
   118 make VERBOSE=1
   182 the use of the "user" - the person building the package. For instance,
       
   183 CXX and CXXFLAGS are such variables, and have the same meaning as
       
   184 explained in the previous section. These variables can be set on the
       
   185 command line when invoking `make' like this:
       
   186 `make [VARIABLE=VALUE]...'
       
   187 
   119 
   188 WARNINGCXXFLAGS is a non-standard Makefile variable introduced by us
   120    This results in a more verbose output by showing the full
   189 to hold several compiler flags related to warnings. Its default value
   121    compiler and linker commands.
   190 can be overridden when invoking `make'. For example to disable all
       
   191 warning flags use `make WARNINGCXXFLAGS='.
       
   192 
       
   193 In order to turn off a single flag from the default set of warning
       
   194 flags, you can use the CXXFLAGS variable, since this is passed after
       
   195 WARNINGCXXFLAGS. For example to turn off `-Wold-style-cast' (which is
       
   196 used by default when g++ is detected) you can use
       
   197 `make CXXFLAGS="-g -O2 -Wno-old-style-cast"'.