COIN-OR::LEMON - Graph Library

Changes between Version 1 and Version 2 of HowToCompile


Ignore:
Timestamp:
12/01/10 12:19:02 (13 years ago)
Author:
Peter Kovacs
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToCompile

    v1 v2  
     1= How to Compile a Code Using LEMON =
     2
    13LEMON is basically a large collection of C++ header files plus a small static library. If you want to use LEMON from your own code, you must somehow let the compiler know where to find them. There are three ways for doing it.
    2  - Firstly, you can install LEMON to your system. Use can either install some prebuilt binary version or [InstallGuide install it from source] (don't worry, it easy)
    3    - If you install it system-wide on Unices (Linux, OSX, AIX etc), then the compiler will automatically find LEMON, thus you can simply compile your code like this:
     4 - Firstly, you can install LEMON to your system. You can either install some prebuilt binary version or [InstallGuide install it from source] (don't worry, it's easy).
     5   - If you install it system-wide on Unices (Linux, OSX, AIX etc.), then the compiler will automatically find LEMON, thus you can simply compile your code like this:
    46     {{{
    57g++ mycode.cc -lemon
    68     }}}
    79   - If you want to use an installed LEMON on Windows or a user-local installed version on Unices, you must explicitly tell the location of the header files and the lib to the compiler. Please consult the documentation of your compiler on how to do it.
    8  - Secondly, if you want to compile a single .cc file very fast (or with the prospect that your algorithm eventually will be migrated into the core LEMON itself), you can download LEMON and add your code to it. For this, put the `.cc` file into the [source:demo /demo] subdirectory, adjust [source:demo/CMakeLists.txt demo/CMakeLists.txt] and compile it according to [InstallCmake Build with CMAKE] guide. Of course you can omit the final installation step.
    9  - Thirdly, you can use the [ProjectTemplate LEMON project template] either with a installed or a project local version of LEMON. This template is a preconfigured CMAKE build environment for LEMON based C++ projects. It is especially recommended for larger project with several source codes (and even multiple executables), but it pretty easy to set up for small applications, too.
     10 - Secondly, if you want to compile a single `.cc` file very fast (or with the prospect that your algorithm eventually will be migrated into the core LEMON itself), you can download LEMON and add your code to it. For this, put the `.cc` file into the [source:demo /demo] subdirectory, adjust [source:demo/CMakeLists.txt demo/CMakeLists.txt] and compile it according to [InstallCmake Build with CMAKE] guide. Of course you can omit the final installation step.
     11 - Thirdly, you can use the [ProjectTemplate LEMON project template] either with an installed or a project local version of LEMON. This template is a preconfigured CMAKE build environment for LEMON based C++ projects. It is especially recommended for larger project with several source codes (and even multiple executables), but it pretty easy to set up for small applications, too.
    1012
    1113The second and the third option has two important advantages.