wiki:other/xnbody

Versions

README 0.8.0 (21.10.2009)

OpenSUSE 10.2

QT/X11 OpenSource Edition for C++-Developers 4.4.0

VTK 5.0.4

CMake 2.6.0

XNBODY 2.1beta

Prerequisites

If possible, remove old QT/VISIT/VTK/XNBODY installation + sources and clear old environment variables VISIT_ROOT, QTDIR, VTK_DIR.

Then, download the following software:

  1. XNBODY 2.1 Beta for VTK5, i.e. xnbody2.1beta.tar.gz [1]
  2. Qt/X11 Open Source Edition, i.e. qt-x11-opensource-src-4.4.0.tar.gz [2]
  3. VTK5, i.e. vtk-5.0.4.tar.gz [3]
  4. CMake 2.6.0 Binary, i.e. cmake-2.6.0-Linux-i386.sh [4], if needed

Install 4. with

sh cmake-2.6.0-Linux-i386.sh

to ~/cmake-2.6.0-Linux-i386/ (default path) and untar 1.- 3. to ~/sources/{1.-3.} or any other preferred directory.

In the following let ~/sources/ include the source directories and ~/programs/ the build directories.

Installing VISIT

You can skip this step right now and put it before step 6, but configuring VISIT here helps avoiding library problems during the QT installation phase.

So let's start with the easiest part: Change to ~/sources/xnbody2.1beta/visit/ and run

./configure prefix=~/programs/visit

Then compile with

make
make install

which should create the directory ~/programs/visit. If there occur some problems this soon, you probably have to install missing librarys like libx11, libxml2-dev et. al..

Finally, propagate the new VISIT location by

export VISIT_ROOT=~/programs/visit

Note: Although step 6 should already contain the VISIT installation it will fail without pre-installing VISIT before XNBODY itself!

Installing QT

This step is an easy one, too, but it is also the longest one! Depending on the hardware configuration this procedure will take up to 4 hours.

Change to ~/sources/qt-x11-opensource-src-4.4.0/ and run

./configure -prefix ~/programs/qt4

Notice the "-" and no "=", the command

./configure --help 

gives a detailed overview.

Now compile QT with

make
make install

Warning: The first command will take most of the time in this procedure!

Finally, propagate the new QT location by

export QTDIR=~/programs/qt4

and reset the PATH-variable with

export PATH=~/programs/qt4/bin:$PATH

This will help VTK to locate the right QT installation!

Installing VTK

Now this part is really tough, but crucial: Although the final XNBODY installation seems to run perfect, the binary xnbody may not start up due to VTK problems.

Change to ~/sources/VTK and use the cmake command according to step 2 by executing

~/cmake-2.6.0-Linux-i386/ccmake .

The upcoming wizard will ask for many different things, divided by user pressing "c". We will restrict to options the user has to change:

  • CMAKE_BACKWARDS_COMPATIBILITY should remain untouched -> press "c"
  • Switch BUILD_SHARED_LIBS to ON and set CMAKE_INSTALL_PREFIX to ~/programs/vtk, then press "t" to toggle on advanced mode
  • Switch VTK_USE_GUISUPPORT, VTK_USE_SYSTEM_JPEG and VTK_USE_SYSTEM_PNG to ON (?) -> press "c"
  • Switch VTK_USE_QVTK to ON -> press "c"
  • You will be asked to give the desired QT version (3 or 4). Enter "4".
  • This is important: If ccmake does not find the right QT version read step 8, else: Check the paths ccmake provides for QT, they must look like ~/programs/qt4 -> press "c"
  • If the correct Qt-path has not been found, exit ccmake by pressing "q", delete the file CMakeCache.txt and make sure, that the environment variables have been set as given above.
  • This should be the last step, so press "g" to generate Makefiles

If everything is ok, type

make clean
make
make install

and wait a few minutes...

Finally, propagate the new VTK location by

export VTK_DIR=~/programs/vtk

Installing XNBODY

Before installing XNBODY, double-check the environment variables VISIT_ROOT, QTDIR, VTK_DIR! Then, change to ~/sources/xnbody2.1beta.

By default, xnbody is set up for the astrophysics code NBODY++. To change the setup to include volumetric data and a steering menu compatible with PEPC, edit the file xnbodysrc/Makefile.in

Locate the section:

 # default: configure xnbody for PEPC/NBODY
 #SIM=PEPC
 SIM=NBODY

and uncomment the PEPC flag:

 SIM=PEPC
 #SIM=NBODY

Now run

./configure prefix=~/programs/xnbody

Check the output for missing paths or libraries!

If everything is fine, compile XNBODY with

make
make install

and keep your fingers crossed!

Finally, there should be a file .xnbody.bin and an executable xnbody in ~/programs/xnbody. Execute xnbody to check if it is starting up. If not: I'm really sorry, try last step...

Running XNBODY

For a quick start we refer to [1] again. The file .visitrc in your home directory is very important, do not skip its setup.

Troubleshooting

  1. First, the VTK installation: If there is another QT installation available on the machine, ccmake may not find the right one. Lucky developers get a chance to specify the right version the QT-step by choosing the right include file and qmake executable (which is more important!). Check your environment variables!
  2. If xnbody will not come up: Double-check your VTK installation for missing ONs or wrong QT paths. If everything is ok here, try to copy the source files into the build directories (but do not count on this!) and rebuild VTK. After this, you have to remove the build-directory ~/programs/xnbody completely, because a simple "make clean" misses this point! Sometimes running qtconfig in ~/programs/qt4/bin can give a hint, too. Try to check OpenGL by running glxgears. But this problem is still unsolved, so keep trying!
  3. Another possibility if xnbody does not start after invocation is a possible problem with your LD_LIBRARY_PATH variable during make install, hence the shared libraries are not found. As a solution empty your LD_LIBRARY_PATH before compiling xnbody, hence in your xnbody-directory invoke
    make clean
    export LD_LIBRARY_PATH=""
    make
    make install
    
  4. Back to VTK: If you have to reinstall VTK it is essential to remove everything ccmake left in the source directory. Otherwise there may occur strange conflict situations. The easiest way is to delete the VTK source directory and untar it again.
  5. Running XNBODY: If XNBODY does not connect to your seapserver, check your firewall for the listen-port you have specified in .visitrc
  6. Warning: Rebooting your machine during these steps destroys the environment variables unless you put them into your login shell script (like .bashrc)

Additional Information

Meanwhile, the installation of XNBODY has been tested on various OS, including Ubuntu 9.04. By providing the adequate paths via export most of the installation process can be replaced by standard installation routines (like apt-get in Ubuntu). However, the execution problem is not resolved...

[1] http://www.fz-juelich.de/jsc/xnbody/download

[2] http://trolltech.com/developer/downloads/qt/x11

[3] http://www.vtk.org/get-software.php

[4] http://www.cmake.org/HTML/Download.html

Last modified 14 years ago Last modified on 02/05/10 10:47:24
Note: See TracWiki for help on using the wiki.