Lomse library. Installing on Linux systems

This document contains detailed instructions for building Lomse library and tests program from sources, on Linux systems. If you find things that need to be fixed in this document and would like to contribute, you are welcome. Please post a message on the Lomse list. Thank you.

Requirements

To build the lomse library, the following software should be installed in your system:

Please refer to each package website for installation instructions. In many Linux distros, these packages are already installed in your system, but if anyone is missing, normally you can install it using the package manager. For instance, in Ubuntu 11.04:

    sudo apt-get install cmake cmake-data
    sudo apt-get install subversion
    sudo apt-get install libunittest++-dev
    sudo apt-get install libfreetype6-dev
    sudo apt-get install libpng++-dev
    sudo apt-get install zlib1g-dev
    sudo apt-get install libboost-date-time-dev libboost-thread-dev

Installation steps

Once you have checked that you have the required packages you can proceed to build Lomse.

1. Checkout a working copy

Open a terminal window, move to the folder in which you have sources, and create a folder for Lomse sources. For instance:

    cd ~/sources
    mkdir lomse
    cd lomse
    svn co https://lomse.svn.sourceforge.net/svnroot/lomse/trunk .

2. Create a folder to build

    cd ..
    mkdir build-lomse
    cd build-lomse

3. Generate Makefile

Now, using CMake, proceed to create the makefile:

    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../lomse

By default, Lomse library will be installed in [prefix]/lib and header files in [prefix]/include/lomse, with [prefix] defaulting to usr/local.

You can change the install location by running cmake like this:

    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/new/install/prefix  \
        -DCMAKE_BUILD_TYPE=Release ../lomse

4. Build the Lomse library, the test program (testlib) and the example program

    make

Alternatively, build step-by-step, checking results:

4.1. Build the library
    make lomse
        ...
        [100%] Built target lomse
4.2. Check that library is ok
    make testlib
        ...
        Lomse version 0.45. Library tests runner.

        Success: 825 tests passed.
        Test time: 9.23 seconds.
        [100%] Built target testlib

The number of tests will grow over time, and the times reported will depend on your computer.

4.3. Build example program
    make example_1
        ...
        [100%] Built target example_1

5. Run the example

    cd bin
    ./example_1

6. Install the library

When build is ok and test and example programs work, you can install lomse (in case of problems, see next section "Rebuilding the library"):

    sudo make install

That installs Lomse on your system. Lomse library is installed in [prefix]/lib and header files in [prefix]/include/lomse, with [prefix] defaulting to usr/local if you didn't specify a different prefix in step 3.

After installing Lomse you can delete the folder used to build:

    cd ..
    rm build-lomse -r

Also, you can delete Lomse working copy.

    rm lomse -r
 

Rebuilding the library

In case of problems, before repeating all the build procedure (after fixing the errors), the makefile should be re-created. The safest way to proceed is to delete the whole content of the build folder and start again from step 3. So move to folder to build and clean all:

    rm * -r     #AWARE: BE SURE YOU ARE IN THE build-lomse FOLDER !!!!

and repeat build process from step 3, after fixing the errors.