INSTALL 9.67 KB

Installation and Compilation (coolbot-project)
================================================================================

Summary:

1. Introduction.
2. Prerequisites.
3. Installation and Compilation in Linux.
4. Installation and Compilation in Windows.

--------------------------------------------------------------------------------
1. Introduction
--------------------------------------------------------------------------------

As of now, the CoolBOT Project is supported mainly in GNU/Linux distributions, we have tested
it mainly on Ubuntu and Debian. To use the project in other GNU/Linux distributions and other
Unix compatible systems should be easy, although it is something nobody has done yet. As to
Windows, we have managed to compile the CoolBOT Compiler and Workspace successfully with Visual
Studio (Visual C++). We encourage Windows users to test it as well, following the steps we
present in the Installation and Compilation section for your convenience.

Having all this in mind, consider that the next instructions for having CoolBOT compiled and
installed are applicable to GNU/Linux distributions, although probably they will work
approximately for other GNU/Linux and Unix variations, like MacOS, and for Windows. Please be
free to tell us if you have managed to have CoolBOT working on one of these systems.

--------------------------------------------------------------------------------
2. Prerequisites
--------------------------------------------------------------------------------

The CoolBOT Project has some prerequisites in order to be installed and compiled, mainly:

    1. The Adaptive Communication Environment (ACE) for the network support allowing for
    distributed computation.

    2. The GTK+ 2.0 libraries for the support for CoolBOT views.

    3. Bison and Flex for the CoolBOT Compiler (coolbot-c).

    4. The pkg-config tool to store compiler and linker options for the CoolBOT Project
    libaries and tools.

    5. The CMake tool for installation and compilation facilities.

Prerequisites 1 and 2 are needed for the C++ CoolBOT framework infrastructure, the first to
support system distributed computation, since CoolBOT use ACE for network communications, the
second one because CoolBOT views are implemented using GTK+, so GTK+ 2.0 libraries should be
installed previously. Prerequisite 3 is necessary to have the CoolBOT compiler (coolbot-c)
working, it uses bison and flex. The CoolBOT Project uses the pkg-config tool intensively to
facilitate compilation, this is the reason to need Prerequisite 4. The last prerequisite,
Prerequisite 5, is necessary because this project use CMake for the phase of compilation and
installation.

--------------------------------------------------------------------------------
3. Installation and Compilation in Linux
--------------------------------------------------------------------------------

To compile and install the CoolBOT Project the procedure is as follows:

    1. Install the prerequisites. 
       
       In Debian-based distributions:

       $ sudo apt-get install libace-dev    (Adaptive Communication Environment, ACE)

       $ sudo apt-get install libgtk2.0-dev    (GTK+ 2.0 libraries)

       $ sudo apt-get install bison flex pkg-config    (Bison, Flex and pkg-config tools)

       $ sudo apt-get install cmake cmake-curses-gui cmake-qt-gui    (CMake tool)

    2. cd <coolbot-project>/build

    3. ccmake ..

    4. Put OFF the DEBUG_MODE variable (enable release mode)

    5. Press 'c' to continue and, if all has gone well, press 'g' to generate the project and
       exit (if any prerequisite is not met, CMake aborts indicating which one has not been
       found on the system).

    6. make (compile the whole project, specific targets can be also specified)

    7. make install (you might need to have administrator permissions)

    8. Once got to this point without errors in previous steps, you will have the CoolBOT
    Project installed in your system.

--------------------------------------------------------------------------------
4. Installation and Compilation in Windows
--------------------------------------------------------------------------------

The CoolBOT Compiler and Workspace have some prerequisites in order to be installed and compiled:

1. The Adaptive Communication Environment (ACE) for the network support allowing for
   distributed computation.

Proceed to download the last full release of ACE from here:

    http://www1.cse.wustl.edu/~schmidt/ACE.html

Once unzipped, you can find several solutions for Visual C++ in ACE_wrappers/ace folder. The
solution to be opened depends on the version of Visual C++ you may have installed. Next URL
will provide you with information in relation to this:

    http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html#win32

Step 2 in the document above has to be fulfilled in order to build ACE successfully. Next steps
can be avoided unless you want a more personalized built. For CoolBOT, the minimum steps are as
follows:

    1.1. Create a file called config.h in ACE_wrappers/ace folder that contains:

         #include "ace/config-win32.h"

    1.2. Load the solution file for ACE for MS-Visual C++ (Visual Studio or Visual C++ Express)

    1.3. Change from Debug to Release configuration.

    1.4. Open ACE project properties to :

        1.4.1. Change the configuration type, located in the General properties of the project,
              from Dynamic library (.dll) to Static librar (.lib).
        1.4.2. Include the macro ACE_AS_STATIC_LIBS in the pre-processor configuration.

    1.5.  Build ACE solution.

Once finished, you may find ACE.lib library in ACE_warppers/lib folder. In order to make this
visible to CoolBOT, add the following environment variables to your windows configuration:

    ACE_ROOT =<path_to_ace_wrappers_folders>
    PATH =%PATH%;%ACE_ROOT%/lib

2. The GTK+ 2.0 libraries for the support for CoolBOT views.

Proceed to download all-in-one bundles of GTK from here:

        http://www.gtk.org/download/win32.php

Please note that all-in-one bundles include all dependences. This prevents you from downloading
and installing every single package required by GTK to work. Once unzipped, add the following
environment variables to your windows configuration in order to make GTK visible to CoolBOT:

    GTK_ROOT=<path_to_gtk_folder>
    PATH =%PATH%;%GTK_ROOT%/bin;%GTK_ROOT%/lib

3. Bison and Flex for the CoolBOT Compiler (coolbot-c).

Proceed to download Flex and Bison packages from here:

    http://gnuwin32.sourceforge.net/packages.html

Previous URL provides you with complete downloadable setup packages to make it easier to
install Flex and Bison in Windows. Please, install both packages, full instalation option,
in the same GnuWin32 folder for your convenience. Once instlaled, add the following environment
variables to windows configuration in order to make both packages visible to CoolBOT:

    GNU=<path_to_gnu_win32_folder>
    PATH =%PATH%;%GNU%/bin;%GNU%/lib;%GNU%/include

As of the CoolBOT Compiler (coolbot-c), unistd.h file is needed for it to compile. So that,
after completing full installations on both packages, check that unistd.h file is stored in
the %GNU%/include directory where they are installed. If it is not, we encourage you to
reinstall both packages again selecting full installation.

4. The pkg-config tool to store compiler and linker options for the CoolBOT Project
   libaries and tools.

If you downloaded all-in-one bundles from GTK site as specified in step 2, then pkg-config
binary had to be stored in %GTK_ROOT%/bin. If you can’t find the file, you can download it
from "Other third party software" here:

    http://www.gtk.org/download/win32.php

Once downloaded, include the file to %GTK_ROOT%/bin folder. Either if you had the file in
the first place or if you downloaded it afterwards, add the following environment variables
to your windows configuration:

    PKG_CONFIG_PATH=%GTK_ROOT%/lib/pkgconfig

5. The CMake tool for installation and compilation facilities.

Proceed to download CMake tool from here:

http://www.cmake.org/cmake/resources/software.html

On this website, you can download the CMake source code or an installer for Ms-Windows.

Finally, when we have solved the prerequisites, we will compile the project. To
compile and install the CoolBOT Project the procedure is as follows:

    1. Run the CMake executable, cmake-gui.exe, and specify the source (where the
       CMakeLists.txt file) and build directories(<coolbot-project>/build).

    2. Configure the cache settings

      2.1. Click the Configure button. If this is the first time you are
           running cmake-gui in this directory, you will be prompted for the
           generator you wish to use (for example on Windows, Visual Studio 2010 Express).
           CMake will read in the CMakeLists.txt files from the source directory and
           display options for the CoolBOT project. After the first configure you
           can adjust the cache settings and/or specify locations of other programs.

      2.2. Put OFF the DEBUG_MODE variable (enable release mode) and click the
           Configure button.

      2.3. Finally, if there is no conflict or other problem, click the Generate button
           to produce the appropriate build files (the solution and project files will
           be created in the build folder).

    3. Open the solution file in your build directory. Load the solution with
       Visual Studio or Visual C++ Express. Be sure to select Release mode.

    4. See the properties of solution and include the macro ACE_AS_STATIC_LIBS in the pre-processor
       configuration.

    5. Finally, build and install the solution.

    6. Once got to this point without errors in previous steps, you will have the CoolBOT
    Project installed in your system.