In fact, LEMON provides two different build environments, one is based on autotool while the other is based on cmake. Your choise will mainly depend on the operation system you use - choose the autotool based one on Linux and other Unices, while use the cmake based one on M$ Windows.
You will need a recent C++ compiler. Our primary target is the GNU C++ Compiler (g++), from version 3.3 upwards. We also checked the Intel C++ Compiler (icc) and Microsoft Visual C++ (on Windows). If you want to develop with LEMON under Windows, you can use a Windows installer or you can consider using Cygwin.
In this description we will suppose a Linux environment and GNU C++ Compiler. If you would like to develop under Windows and use a Windows installer, you could skip the following sections and continue reading basic_concepts. However keep in mind that you have to make appropriate steps instead of the instructions detailed here to be able to use LEMON with your compiler.
INSTALL
file how to enable these at compile time..tar.gz
files (and Windows installers). If you want a developer version (for example you want to contribute in developing LEMON) then you might want to use our Mercurial repository. This case is detailed later, so from now on we suppose that you downloaded a .tar.gz
file.Thus you have to do the following steps.
Download the tarball either from the browser or just issuing
wget http://lemon.cs.elte.hu/pub/sources/lemon-1.0.tar.gz
lemon-x.y.z.tar.gz
where x
, y
and z
(which is missing if it is 0) are numbers indicating the version of the library, in our example we will have lemon-1.0.tar.gz
.
tar xvzf lemon-1.0.tar.gz cd lemon-1.0 ./configure make make check # This is optional, but recommended. It runs a bunch of tests. make install
These commands install LEMON under /usr/local
(you will need root privileges to be able to install to that directory). If you want to install it to some other place, then pass the --prefix=DIRECTORY
flag to ./configure
, for example:
./configure --prefix=/home/username/lemon
We briefly explain these commands below.
tar xvzf lemon-1.0.tar.gz
tar.gz
file into a directory named lemon-1.0
.
cd lemon-1.0
./configure
make
libemon.a
file. It also compiles the programs in the tools and demo subdirectories when enabled.
make check
make install
/usr/local
) so that your system can access it. This command should be issued as "root", unless you provided a --prefix
switch to the configure
to install the library in non-default location.
Several other configure flags can be passed to ./configure
. For more information see the INSTALL
file.
Once you have all these tools installed, the process is fairly easy. First, you have to get the copy of the latest version.
hg clone http://lemon.cs.elte.hu/hg/lemon-main lemon-src
The next step is to initialize the build system.
autoreconf -vif
Then the process is the same as in case of using the release tarball.
./configure make make check # This is optional, but recommended. It runs a bunch of tests. make install
To generate the documentation, just run
make html
make html
really necessary after make install
?You must also dowload and install CMake 2.6.2 (.exe installer) or later.
Finally - assuming you use a recent version of use Visual Studio - start a "Visual Studio Command Prompt" from the start menu. Then, in the command prompt, step into the extraced LEMON source directory and type in the following commands.
mkdir build
cd build
cmake -G "NMake Makefiles"
nmake
nmake install
/usr/local
was successful, then you have to issue a command like this to compile a source file that uses LEMON.
g++ -lemon [other options] <source file>
The argument -lemon
tells the compiler that we are using the installed library LEMON.
<dir>
).
g++ -lemon -I <dir>/include -L <dir>/lib [other options] <source file>