Build (Linux)
From Emergent
- Getting the source
- Installing from packages
- Building from packages (recommended!)
- OSX
- Fedora
- Ubuntu
- Ubuntu (64 bit)
- Gentoo (unsupported)
The Linux build of Emergent depends on several other toolkits, which in turn have other more standard dependencies and are described in About Emergent. All of these packages are also available at our ftp site. If the appropriate version (or higher) is available on your distribution via source, yum, apt-get, fink, port, cygwin, etc..., then you should be able to use that. Most distros do not have appropriate versions of SoQt, but GSL is fine. The following table illustrates the versions of these packages that we currently use.
For recent versions of Ubuntu and Fedora, where we have pre-built packages available for Installation, the easiest way (by far!) to build from source is to install the pre-built binary package, and then follow a much shorter set of platform-specific instructions:
- Build From Package Ubuntu -- for Ubuntu (including Kubuntu), version 7.04 or later (presumably)
- Build From Package Fedora -- for Fedora 8 or later (presumably)
The directions that follow are for a full build of all the prerequisites, which would be necessary on other Linux distributions or other versions of Unix (e.g., Solaris). We do not have any personal experience building on these other versions, so users of those other platforms will hopefully share their experiences on the wiki here.
| Package | Min Version | Web Link File Link | Description |
|---|---|---|---|
| OpenGL | (platform dependent) | OpenGL | Low-level 3d graphics toolkit (hardware accelerated); this is usually provided by the graphics card driver, or the OS. |
| Qt4 (open source edition) | Qt-4.2.3 or Qt-4.3.1 | http://www.trolltech.com/ | Main GUI Toolkit |
| sndfile | 1.0.17 | http://www.mega-nerd.com/libsndfile/ | sound reading library (except mp3); is also used by simage (below) |
| Coin3D | 2.4.6 | http://www.coin3d.org/ | Open Inventor providing higher-level 3d toolkit |
| SoQt | 1.4.1 | http://www.coin3d.org/ | Qt interface to Coin3d |
| simage | 1.6.1 | http://www.coin3d.org/ | library for loading textures (and doing media i/o) |
| GSL | 1.9 | http://www.gnu.org/software/gsl/ | Gnu Scientific Library: for matrix math and other math functions |
| ODE | 0.8 or 0.7 | http://ode.org/ | Open Dynamics Engine: for virtual environment simulations |
Step-by-Step Instructions For Full Build
Note, see above for links for building on systems where pre-built packages are available -- these instructions are for building all pre-requisites from scratch.
These instructions have been tested on Fedora Core 4 and later, and Kubuntu. Let us know if they work on your distribution. You need to be logged in as 'root' to install the prerequisites (Qt4, SoQT, Coin3d). You should fetch the Emergent source code and install it in your home area logged in as yourself, not root.
You need to have an OpenGL compatible library, such as mesa, installed. This is normally installed by default, but make sure the development package (e.g., mesa-devel) is also installed, otherwise Qt won't get compiled with OpenGL support.
The command examples assume the Bash shell -- if you don't use bash, it is suggested to enter "bash" to get the Bash shell prior to running the commands, since some, such as setting environment variables, are different in other shells.
You also need a set of tools for compiling software, which may or may not be installed already on your system. Here are lists of package installs needed for various platforms that we know about:
- Build Tools Ubuntu -- K/Ubuntu Feisty (7.04) or later (presumably)
- Build Tools Fedora -- Fedora 8 or later (presumably)
Change your variables
Edit your system's /etc/profile file to add the QTDIR -- this is the best place for it. You can also put it in your personal .bashrc or .cshrc. Re-login or just enter this command at the command line to make it active for the current session: export QTDIR=/usr/local/Trolltech/QT_VERSION, where QT_VERSION is something like Qt-4.2.3
Build/Install Qt4
Starting in v4.2 Qt (except Mac) only creates a release xor debug version. But the debugging symbols are put into a separate file, so even the debug version is not large. Make sure that you have all the necessary dependencies for Qt4, it is a good idea to install the development version that comes with your distribution.
- Download the packages for Qt4, SoQt, Coin3d, and simage (see above for current filenames) from our ftp site and save them in the
/tmpdirectory.
yum install Qt4-devel # Fedora # OR # apt-get install libqt4-dev # [K]Ubuntu/Debian
- The following OpenGL packages should be installed.
yum install mesa-libGL-devel, mesa-libGLU-devel, mesa-libGLw-devel # OR # apt-get install libgl1-mesa-dev libgl1-swx11-dev libglu1-mesa-dev libglut3-dev
- Assuming that you are in
/tmp, it's now time to start building. Qt does not build properly in parallel, so do not use the -j N multi-cpu switch.
mkdir /usr/local/Trolltech cd /usr/local/Trolltech tar -xzvf /tmp/qt-x11-opensource-src-4.3.1.tar.gz cd qt-x11-opensource-src-4.3.1
- There are two different sets of configure flags depending on whether you are using a particular version of the MPI distributed memory library. Most people will use this first version:
./configure -no-exceptions
If you are going to be running the mpich version of MPI (and maybe only the version that comes with old myrinet GM-based network cards, version 1.2.7 from myrinet is known to have this problem), you must do this:
./configure -no-exceptions -no-glib
(The gnome lib (glib) causes a crash in QCoreApplication::init at application startup when running under mpi -- if you get a crash at startup under mpi, this may be the problem. Some versions of MPI (Brad -- please fill in) are known NOT to have this problem).
- Observe the config output before running 'make' to insure that "uses OpenGL" indicates 'yes', otherwise OpenGL support won't be compiled. See the dependencies listed above, install them, and rerun configure. There may be other dependency warnings depending on your distribution -- make sure you do the above install of the existing Qt4 package to avoid these!
make make install
- This takes a very long time -- 2-3 hrs or more. You can interrupt 'make' by hitting 'Ctrl+C' and resume it later by just typing 'make' again.
Build/Install Coin3d, simage, and SoQt
It's now time to build and install Coin and SoQt, both of which build properly with the -j N multi-cpu switch, and simage (which may or may not build with -j N).
mkdir /usr/local/src/Coin3d cd /usr/local/src/Coin3d tar -xzvf /tmp/Coin-2.4.6.tar.gz tar -xzvf /tmp/SoQt-1.4.1.tar.gz tar -xzvf /tmp/simage-1.6.1.tar.gz cd Coin-2.4.6 ./configure --disable-debug make install cd ../SoQt-1.4.1 ./configure --disable-debug make install cd ../simage-1.6.1 ./configure --disable-debug make install
Build/Install SoQt to override /usr/local copy
You need to do this if you have a 64-bit CCN Lab machine with a 32-bit /usr/local sync'ed folder.
- make sure you have the coin-4 library installed in Adept
- make sure you have simage library installed
- follow the steps below
mkdir /usr/opt/src/Coin3d cd /usr/opt/src/Coin3d tar -xzvf /tmp/SoQt-1.4.1.tar.gz cd ../SoQt-1.4.1 ./configure --disable-debug --with-coin=/usr --prefix=/usr/opt make install
Build/Install Coin3d and SoQt with debugging symbols (optional)
This allows you to debug the Coin3d and SoQt libraries, which can be very useful in chasing bugs. It creates /usr/local/lib/libCoind.so* and /usr/local/lib/libSoQtd.so*
cd ../Coin-2.4.6 make clean # remove previous compile ./configure --enable-debug --with-suffix=d --with-alternate=debug make install cd ../SoQt-1.4.1 make clean # remove previous compile ./configure --enable-debug --with-suffix=d --with-alternate=debug make install
Confirm linkage
After building the libraries, you can confirm they are properly linked:
cd /usr/local/lib ldd libSoQt*.so
Make sure the libSoQt.so links to the libCoin.so and the libQtXxx.so libraries. Also make sure the libSoQtd.so links to the libCoind.so and the libQtXxx.so libraries and make sure that there are no references to libCoin.so.
Install the GNU Scientific Library (GSL)
The standard version with any distro should be fine, e.g.:
> yum install gsl-devel > # OR # > apt-get install libgsl0-dev
Install ODE (Open Dynamics Engine)
If your distribution has version 0.7 or 0.8, then install using yum or apt:
> apt-get install libode0-dev > # OR # > yum install ode-devel
Currently, Kubuntu Feisty has version 0.5, which does not work, so you need to install from source (easiest to just get from our ftp site: ftp://grey.colorado.edu/pub/emergent/ode-src-0.8.zip )
> unzip ode-src-0.8.zip # wherever you want to compile it > cd ode-0.8 > ./configure > make > make install
Building/Installing Emergent
Emergent can be compiled either from a tar file or by downloading from subversion. Currently, we are only supporting the subversion case.
Fetch Source
Follow the instructions in the Subversion article for fetching the Emergent source.
Configure/Build Emergent
To configure and build Emergent, navigate to the source directory you created, and run configure and make.
cd ~/emergent autoreconf ./configure # --enable-debug if you want to be able to debug make make install # need to run as su or with sudo
With the default install, the executable emergent will be in /usr/local/bin, and that is what you type to run it. Other support files will be in /usr/local/share/emergent, including demo test cases and standard library files for css.
Troubleshooting
- If you get error msg while running autoreconf make sure you have installed
- libtool
- libreadline5-devel
- automake1.4
- autoconf2.13
Building Plugins
This assumes that you have succeeded in building Emergent.
cd ~emergent/trunk/plugins make make install
