My favorites | Sign in
Project Home Downloads Issues Source
Search
for
BuildingOpenNero  
This page describes how to build OpenNERO from source for a variety of platforms.
Updated Feb 2, 2012 by ikarpov

Overview

OpenNERO uses the CMake cross-platform build system. The general steps are:


Mac OS X

Prerequisites

Steps to build

  1. (recommended) create a new directory for your build
  2. in your build directory, run cmake -G Xcode /path/to/opennero/checkout
  3. open the resulting OpenNERO.xcodeproja Xcode project file
  4. Build OpenNERO using Xcode

Windows

Prerequisites

Steps to build

  1. Open CMake, specify the source directory (opennero checkout directory) and build directory (another directory). Choose 'Suppress dev Warnings -WnoDev' from the Options menu. Click the Configure button twice, then click the Generate button.
  2. Open the OpenNERO.sln solution file and build OpenNERO using Visual Studio.
  3. To run from within Visual Studio, set OpenNERO as startup project. Also set the working directory of OpenNERO for debugging to $(TargetDir) (right mouse click on OpenNERO, select properties, debugging).

Linux

Summary

  1. mkdir opennero
  2. cd opennero
  3. svn checkout http://opennero.googlecode.com/svn/trunk
  4. mkdir build-of-trunk
  5. cd build-of-trunk
  6. cmake ../trunk
  7. make
  8. cd dist
  9. ./OpenNERO

Prerequisites

Install the following packages (using sudo apt-get install)

Required

Ubuntu DEB Packages

  • libboost-all-dev
  • libx11-dev
  • libxxf86vm-dev
  • libgl-dev
  • libz-dev

or, Fedora RPMs

  • boost-devel
  • libX11-devel
  • libXxf86vm-devel
  • mesa-libGL-devel
  • zlib-devel

Optional

  • python-matplotlib
  • python-wxgtk

Steps to build

  1. (recommended) create a new directory for your build
  2. in your build directory, run cmake /path/to/opennero/checkout
  3. building using make: make

To run

  1. cd dist
  2. ./OpenNERO

Update build

  1. cd trunk
  2. svn update
  3. cd ..\build-of-trunk
  4. make
Comment by Dennis.I.89, Apr 9, 2011

A typo in step 6: cmake ..\trunk should read cmake ../trunk

Also, trying to install libgl-dev results in this:

Package libgl-dev is a virtual package provided by:
libgl1-mesa-swx11-dev 7.9~git20100924-0ubuntu2 libgl1-mesa-dev 7.9~git20100924-0ubuntu2
You should explicitly select one to install.

So I left it out and tried to build OpenNERO then got these errors:

Comment by serg...@gmail.com, Aug 6, 2011

I've tried libgl1-mesa-dev and also python-wxgtk2.8 instead of wxgtk, build was successful and application seems works OK

Comment by project member ikarpov, Sep 7, 2011

For the error noted by Dennis.I.89, the error is actually different - on 64-bit machines, you need to install libpng-dev in order to not get this error.

Comment by nas...@gmail.com, Sep 13, 2011

I'm getting the same error as Dennis.I.89. I have a 64-bit machine. The package libpng-dev is already installed on my computer.

Comment by project member ikarpov, Sep 13, 2011

It looks like in your case the error actually talks about libbz2, though I'm not sure where the longer version of your post went:

Linking CXX shared library ../../../dist/libIrrlicht.so
/usr/bin/ld: ../../../dist/libbz2.a(bzlib.c.o): relocation R_X86_64_32S against `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
../../../dist/libbz2.a: could not read symbols: Bad value
Comment by gregast...@gmail.com, Sep 19, 2011

I'm getting the same error as Dennis when trying to make:

Linking CXX shared library ../../../dist/libIrrlicht.so
/usr/bin/ld: ../../../dist/libjpeg.a(jcmainct.c.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
../../../dist/libjpeg.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [dist/libIrrlicht.so] Error 1
make[1]: *** [external/source/Irrlicht/CMakeFiles/Irrlicht.dir/all] Error 2
make: *** [all] Error 2

I've double and triple checked the libraries you guys mentioned, and they're all installed and up to date. Was this ever officially resolved?

Comment by project member ikarpov, Sep 19, 2011

The error in your post is occurring when Irrlicht (which OpenNERO uses for rendering) tries to build its own version of libjpeg unsuccessfully. As with libpng, libgz2 and the others, the workaround for this is to install the development version of these libraries on your system when building OpenNERO. Do do so, use

$ sudo apt-get install libpng-dev libjpeg-dev libbz2-dev

The other part of the workaround is that these libraries have to be installed when running cmake - cmake can fail to notice that they have been installed if you just rerun it. To make sure, delete CMakeCache.txt in the directory you are building in and re-run cmake.

I opened Issue #83 for further tracking of this problem.

Comment by gregast...@gmail.com, Sep 19, 2011

Ah, thanks much. I'll post further comments in the Issue 83 thread.

Comment by maciej.h...@gmail.com, Nov 13, 2011

Hi, it may be worth mentioning that you want libpng 1.2. Irrlicht does not compile against 1.5:

[ 34%] Building CXX object external/source/Irrlicht/CMakeFiles/Irrlicht.dir/CImageLoaderPNG.cpp.o                                                                                       
/home/banshee/development/opennero/trunk/external/source/Irrlicht/CImageLoaderPNG.cpp: In function ‘void irr::video::png_cpexcept_error(png_structp, png_const_charp)’:                 
/home/banshee/development/opennero/trunk/external/source/Irrlicht/CImageLoaderPNG.cpp:31:17: error: invalid use of incomplete type ‘png_struct {aka struct png_struct_def}’
/usr/include/png.h:825:16: error: forward declaration of ‘png_struct {aka struct png_struct_def}’
/home/banshee/development/opennero/trunk/external/source/Irrlicht/CImageLoaderPNG.cpp: In function ‘void irr::video::user_read_data_fcn(png_structp, png_bytep, png_size_t)’:
/home/banshee/development/opennero/trunk/external/source/Irrlicht/CImageLoaderPNG.cpp:40:45: error: invalid use of incomplete type ‘png_struct {aka struct png_struct_def}’
/usr/include/png.h:825:16: error: forward declaration of ‘png_struct {aka struct png_struct_def}’
make[2]: *** [external/source/Irrlicht/CMakeFiles/Irrlicht.dir/CImageLoaderPNG.cpp.o] Error 1
make[1]: *** [external/source/Irrlicht/CMakeFiles/Irrlicht.dir/all] Error 2
make: *** [all] Error 2
Comment by bevan.be...@gmail.com, Dec 3, 2011

For Fedora, the dependency rpms appear to be: boost-devel libX11-devel libXxf86vm-devel mesa-libGL-devel zlib-devel

Comment by vandy...@gmail.com, Dec 3, 2011

On ubuntu 10.04 note that the libgl1-mesa-swx11-dev package puts the libraries in /usr/lib/mesa, where the cmake scripts won't find them. I manually added symlinks to /usr/lib, and then cmake seemed happy.

Comment by rashmira...@gmail.com, Dec 4, 2011

Using Ubuntu 10.10

rashmi@ferrari:~/opennero/build-of-trunk$ cmake ../trunk/ -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Found ZLIB: /usr/include -- Found PNG: /usr/lib/libpng.so -- Found JPEG: /usr/lib/libjpeg.so -- Found BZip2: /usr/lib/libbz2.so -- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.so -- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.so - found -- TRUE /usr/include /usr/lib/libbz2.so -- Boost version: 1.42.0 -- Found the following Boost libraries: -- python -- filesystem -- serialization -- system -- date_time -- Found PythonLibs?: /usr/lib/libpython2.6.so -- Found Python libraries in /usr/include/python2.6 and /usr/lib/libpython2.6.so CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: GL_LIBRARY

linked by target "Irrlicht" in directory /home/rashmi/opennero/trunk/external/source/Irrlicht
OPENGL_LIBRARY
linked by target "OpenNERO" in directory /home/rashmi/opennero/trunk/source

-- Configuring incomplete, errors occurred!

Comment by soujiro0...@gmail.com, Dec 5, 2011

for MacOSX 10.6, I'm getting an error

cmake -G Xcode ~/OpenNero?/opennero-read-only -- configured /Users/xxx/OpenNero?/opennero-read-only/doxy.config.in --> /Applications/OpenNERO.app/Contents/Resources/TestMod?/doxy.config -- TRUE /usr/include /usr/lib/libbz2.dylib -- Could NOT find Boost CMake Error at source/CMakeLists.txt:26 (MESSAGE):

Boost libraries were not found

Does anyone have any clue?


Sign in to add a comment
Powered by Google Project Hosting