In this page we describe how to compile the OpenHRP source files extracted from its source package, by using Make command.

On Linux, using Make command is the common way of compiling.

As for Windows, we usually use Visual C++ IDE(Integrated Development Environment) for compiling process. Refer "Installing OpenHRP on Windows" for more.Upto OpenHRP-3.0.0-RC3, we used DOS based command-line compilation procedure for windows, but it is not supported anymore.

Extracting source package

First, extract the downloaded source package "OpenHRP-xxx.zip", to a directory where ever you want, using what ever a ZIP extraction tool you use. ('xxx' refers to the version of OpenHRP package, such as '3.0.0-RC4'. Please substitute the version of the downloaded file, with 'xxx'.)

Extracting to an appropriate directory under users home directory, is the common manner on Linux platforms.

About Make.vars

When using Make command, configuration settings to compile OpenHRP are defined in a file named "Make.vars", placed in the source directory.

In this file, Configuration items and contents are basically defined as following format;

DYNAMICS_ENGINE = aist
OB_DIR =
JDK_DIR = $(HOME)/usr/jdk1.5.0_07
BOOST_INC_DIR =
BOOST_LIB_DIR =
BOOST_LIB_SFX = -mt
TVMET_INC_DIR = $(HOME)/usr/tvmet-1.7.1/include
NS_HOST = localhost
NS_PORT = 2809

Since this file is included by "Makefile", the syntax of both files are almost same. For example, the values of environment variables can be derived by specifying "$(Variable _Name)"and the line starting with '#' mark become commented.

Most of the configuration settings of this file are to indicate the locations of programs or libraries, that required for compiling. Basically, it is not necessary to configure "Make.vars", if the programs and libraries are already available in the OS or compile tool by default. You will have to do it only if, the programs and libraries installed by yourselves are not included in the SYSTEM PATH of your OS or compile tool.

Usually, these settings are done by an automatic-setup-script called "configure". However such a script is not available for OpenHRP at the moment. Since we introduced installing CMake for OpenHRP-3.1.0(β) this portion is scheduled to be cover in series 3.1.

Creating Make.vars

We have prepared a some Make.vars files(placed on source sirectory) as templates for diffrent OS/Distributions. Please select one of following that applys with your system/version.

Copy the selected file to the top directory of the source renaming as "Make.vars".

Configuration contents of Make.vars

Modify the copied Make.vars file as necessary.

Following table describes the meaning of main configuration items in Make.vars.

However, there are some configuration items that have not explained here, and even these configuration contents can also be changed in future versions. So not only this table, but it is better to refer the comments along with configuration items described in the template file.

Runtime environment settings
DYNAMICS_ENGINE Describe the Dynamics server you use. Specify either ut (The university of Tokyo edition) or aist (AIST edition). (1)
NS_HOST Name server host of the Middlewares(CORBA,OpenRTM). Default setting is 'localhost'.(1)
NS_PORT Port number of the Name Server of Middlewares(CORBA,OpenRTM). Default value is preferable.(1)
Programing Language Environment Settings
JDK_DIR Path to the JDK installed directory. Specify when this is not included in Ubuntu system path (which allows 'java' and 'javac' commands in command-line). (1)
JYTHON_DIR Path to the Jython installed directory (the directory where 'jython.jar' contains). (1)
Compiler Settings
DEBUG_VER Allows to select debug options. Select an appropriate number among followings;
    0 : (Optimization available, Debug information not available)
    1 : (Optimization available, Debug information available)
    2 : (Optimization not available, Debug information available)
CXX_CPU_FLAGS Specify the compiler options regarding with optimization of a specific CPU. (Specify here, if you use items like SSE etc.)
Library Settings
J3DHOME Path to the Java3D installed directory. If it is blank, "${OPENHRPHOME}/client/gui/Java3D/1.4.1/unix" is substituted. (1)
JMFHOME Path to the JMF installed directory. If it is blank, "${OPENHRPHOME}/client/gui/JMF2.1.1e/Unix" is substituted. (1)
OB_DIR Path to the omniORB installed directory.
BOOST_INC_DIR Directory path to the Boost header files.
BOOST_LIB_DIR Directory path to the Boost library files.
BOOST_LIB_SFX Suffixes of the Boost library files (Without extensions). Various suffixes are used to distinguish various versions of Boost library files. And these suffixes can be different depending on the environment. Generally, you may specify the suffixes corresponding with multi-thread(release) version.
TVMET_DIR Path to the tvmet installed directory
OPENRTM_DIR Path to the OpenRTM-aist installed directory
LAPACK_VARIANT Specify the implementation of LAPACK library. Select LAPACK (Fortran original edition), CLAPACK(C language conversion edition) or ATLAS.
LAPACK_INC_DIR Directory path to the LAPACK header files.
LAPACK_LIB_DIR Directory path to the LAPACK library files.
LAPACK_VARIANT_LIB_DIR Allows to specify additional LAPACK_LIB_DIR paths, when the library files have been placed in different directories.
CLAPACK_SUFFIX Specify if exists suffixes like "_LINUX" attached with CLAPACK library files.
M_ARCHITECTURE Used to specify library path or compile options for a specific architecture. Currently it supports i386 only. (Resevered variable)

(1) : Edit 'bin/unix/config.sh' to make changes, while runtime.

The following items related with directory path, must be kept blank, if the packages are installed in its default paths(In /usr, /usr/local or any pre-defined path by user) such as systems' binary path(/usr/bin), include path(/usr/include), library path (/usr/lib).

  • OB_DIR
  • BOOST_INC_DIR, BOOST_LIB_DIR
  • TVMET_DIR
  • OPENRTM_DIR
  • LAPACK_INC_DIR, LAPACK_LIB_DIR, LAPACK_VARIANT_LIB_DIR

The paths including space characters would not be accessible by coomand-line. So please be careful not to include space characters in your package install paths.

Make command execution

To start compilation, move to the top directory of OpenHRP source using Terminal, and run 'make' command.

If there are compile errors, refer the error message carefully and check whether the required programs and libraries have been installed properly, or whether the configuration settings of Make.vars are correct.

Notice that current Makefile contains some parts lacking with precise specification for dependencies. Therefore if you wish to re-configure and compile again, it would be better to run "make clean" once, and bring the system back to the initial condition.