Installation

From YARS

Jump to: navigation, search

Contents

How to compile YARS

Prerequisites

  1. YARS requires the following libraries
    1. Linux (in brackets the library names as under Ubuntu 7.04 are indicated):
      1. GLEW (libglew-dev)
      2. GLU (libglu1-mesa-dev)
      3. glut (libglut3-dev and possibly glutg3-dev --> recheck)
      4. xerces-c (libxerces27-dev)
      5. ode 0.8 (has to be downloaded from ode.org)
      6. boost (libboost-dev, libboost-program-options-dev, libboost-filesystem-dev)
      7. [optionally log4cpp (liblog4cpp-dev)]
      8. [optionally unittest++ (libunittest++-dev)]
    2. Mac OS X (Leopard with fink or macports)
      1. boost
      2. ode (>0.9)
      3. xerces-c
      4. AGL
      5. OpenGL
      6. Carbon
  2. YARS requires the following executable:
    1. cmake
    2. make
    3. c++ compiler (tested with gnu under Linux)
    4. [optionally gnuplot (gnuplot)]

Ubuntu example

  • Install the required packages via apt-get (or alternatively via Synaptics Packet Manager):
    • Edgy (6.10), Feisty (7.04) + Gutsy (7.10)
      • sudo apt-get install build-essential cmake libglew-dev mesa-common-dev libglu1-mesa-dev libglut3-dev glutg3-dev libxerces27-dev libboost-dev libboost-program-options-dev libboost-filesystem-dev liblog4cpp4-dev gnuplot
    • Hardy (8.04)
      • sudo apt-get install build-essential cmake libglew-dev mesa-common-dev libglu1-mesa-dev libglut3-dev glutg3-dev libxerces27-dev libboost-dev libboost-program-options-dev libboost-filesystem-dev liblog4cpp4-dev gnuplot libunittest++-dev
    • Intrepid (8.10), Jaunty (9.04)
      • sudo apt-get install build-essential cmake libglew-dev mesa-common-dev libglu1-mesa-dev libglut3-dev glutg3-dev libxerces-c2-dev libboost-dev libboost-program-options-dev libboost-filesystem-dev liblog4cpp5-dev gnuplot libunittest++-dev
    • Karmic (9.10), Lucid (10.04), Maverick (10.10)
      • sudo apt-get install build-essential cmake cmake-curses-gui libglew-dev mesa-common-dev libglu1-mesa-dev libglut3-dev glutg3-dev libgl1-mesa-dev libxerces-c2-dev libboost-dev libboost-program-options-dev libboost-filesystem-dev liblog4cpp5-dev gnuplot libunittest++-dev
      •  sudo ln -s /usr/lib/libboost_program_options-mt.so /usr/lib/libboost_program_options.so
      •  sudo ln -s /usr/lib/libboost_filesystem-mt.so /usr/lib/libboost_filesystem.so
  • Install ode from source
    • TODO: add libraries required by ode here
    • mkdir ode
    • cd ode
    • Get latest ode source from Sourceforge, e.g.
      wget http://downloads.sourceforge.net/opende/ode-0.11.1.tar.bz2
      (Note: if you installed older versions of ODE before, e.g. ode 0.8, please make sure to remove the old include and lib files -- searching for ode.h and libode.so will help).
    • tar xvjf ode-0.11.1.tar.bz2
    • cd ode-0.11.1
    • ./configure --enable-release --enable-double-precision --enable-shared --prefix=${HOME}/local/ --disable-asserts
    • make
    • make install
    • add $HOME/local/lib to your LD_LIBRARY_PATH, e.g. by adding "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/lib" to your .bashrc, .zshrc or similar:
      echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/lib" >> ~/.bashrc

Obtaining the sources

Please note: Since Yars still is in a pre-release state you have to obtain the sources via SVN checkout:
svn co https://yars.svn.sourceforge.net/svnroot/yars yars-svn-co
Please see also the Development section of this Wiki.

Build

The CMake build system is used [1]. You may choose between two different build procedures. The Out-of-source procedure has the advantage that source files and build files are completely separated. The In-Source build has the advantage of all files being located in one directory. WARNING: After having started an "In-Source" build you cannot simply make an "Out-of-Source" build, please see [2] for details.

Out-of-source build (recommended)

To compile YARS "out of source" the following steps are required (for Linux):

  1. make a new directory, e.g.
    mkdir yarsBuild
    and go there
    cd yarsBuild
  2. Call:
    ccmake <path to directory containing yars CMakeLists.txt> 
    , this path usually is the path your yars svn checkout trunk directory, e.g. yars-svn-co/trunk (see also section "Obtaining the sources" above)
  3. Change configuration to match your system (see section "How to configure cmake to match your current OS setup" below).
  4. (If you want more control over debug messages then turn USE_LOG4CPP on.)
  5. (If you want to globally install yars take care of choosing the appropriate CMAKE_INSTALL_PREFIX, e.g. /home/<user>/local or /usr/local)
  6. Press 'c'.
  7. Make sure that at the bottom of the page you see something starting like this
    ------- User configuration -----------------------
    Compiling yars in DEBUG mode.
    Important is the line "Compiling yars in ... mode". If this line does appear your configuration was succesful and you may proceed to compilation. Otherwise configuration was not (completely) succesful and you have to modify it - check the cmake messages to find out which part of the configuration was not successful.
  8. Press 'e'.
  9. Press 'g'.
  10. Call
    make
  11. The binary is located in the bin/ directory and you may directly invoke it by calling
    bin/yars
    .
    1. When using this local invocation, you have to specify the path to the xml-file, the xsd-dir, the library-dir and the textures-dir, e.g.
      bin/yars -d <path-to-your-xml-file> -t <yars-svn-co/trunk> -x <yars-svn-co/trunk> -l <yars-svn-co/trunk>
  12. Optionally you can globally install yars by calling
    make install
    or
    sudo make install
    (in case the CMAKE_INSTALL_PREFIX is pointing to a system directory). If CMAKE_INSTALL_PREFIX is in your $PATH then you may call yars from anywhere and you do not have to specify the xsd, textures and library dirs like during local invocation, only the xml file has to be specified.

In-Source build

To compile YARS "in source" the following steps are required (for Linux):

  1. Go to the yars svn checkout trunk directory, e.g.
    cd yars-svn-co/trunk
    (see also section "Obtaining the sources" above)
  2. Call:
    ccmake
  3. Following step are the same as described under "Out-of-source build" above.

How to configure cmake to match your current OS setup

Yars uses hand written Find-Script for the following packages:

  • Boost
  • ODE
  • XercesC
  • Log4cpp

This section describes how to make cmake find them. For the other libs, please check the Find-scripts distributed with cmake.

Linux

For each package you will find a global variable, which you can set. It should point to the directory containing the include and lib directory of the package. As an example, for ODE there exists a variable called ODE_ROOT. If you have ode installed in

 /home/user/ode/

and this directory has the subdirectories with the files"

 /home/user/ode/include/ode/ode.h
 /home/user/ode/lib/libode.a

than set ODE_ROOT = /home/user/ode. The same holds for all packages:

Xerces-C: XERCES_ROOT
ODE: ODE_ROOT
Log4cpp: LOG4CPP_ROOT

Most commonly, locally installed packages are all installed into one directory, similar to the global /usr or /usr/local directory. So you will typically find the header files and libraries of the packages mentioned above in the same directories. An example would be

 /home/user/local

which contains

 /home/user/local/include
 /home/user/local/lib
 /home/user/local/main
 /home/user/local/share
 ...

and other directories, that typical calls of

  make install

create. In order not to give the same directory in all upper cases, YARS provides a global variable, which is also searched in all find scripts distributed with YARS. This variable is called

  YARS_EXTERNAL_PACKAGES_PREFIX

This variable is by default to

  YARS_EXTERNAL_PACKAGES_PREFIX = $HOME/local

or if this directory doesn't exist to

  YARS_EXTERNAL_PACKAGES_PREFIX = $HOME/.local

(Note the "." (dot) before local).

SunOS

MacOS

(under construction)

Requirements:

  • Fink or macports
  • ODE
  • Boost

Boost is available through fink and macports. ODE included in macports was not tested. Both can also be installed from the tarballs. Consult the source documentation for instructions how to install either one of them from source. For ODE, use the following configure string:

   ./configure --with-x --with-drawstuff=OSX --enable-demos --enable-shared --enable-double-precision --prefix=<path> CFLAGS="-Wall -g3" CXXFLAGS="-Wall -g3" LDFLAGS="-g3" 

For explanation, see this thread in the ode-users group.

If you decide to use user configured <path>, you must enter it in the cmake configuration.

Win32

Personal tools