Before we get started with the details of building OpenRM, we should spend a moment to identify the goals of the build process. The most obvious goal is to build OpenRM. A more subtle goal is consideration of the longer term objectives - are you going to place the OpenRM headers and libraries in a "standard location" for general use on your system?
Beginning with OpenRM version 1.5.2 (April 2004), a "make install" target is provided on Unix/Linux systems. However, since we're not using "autoconf" or a similar facility, the install directory path is located in the main Makefile, and must be edited by hand (sorry) if you don't like the default install location. Therefore, for these instructions, we assume that you will be unpacking the OpenRM distribution somewhere into /tmp for the purpose of building, and then will install into the default location, which is /usr/local/rm160.
For the purposes of simplifying the following discussion, we are going to make these assumptions:
First, create the openrm directory rooted in /tmp:
% cd /tmp % mkdir openrm
Next, unpack the OpenRM development package under that directory
% cd /tmp/openrm % gunzip -dc /tmp/openrm-devel-1.6.0.tar.gz | tar xvf -
That will create the subdirectory rm152 under /tmp/openrm, and the OpenRM source and headers will be unloaded into this new directory.
Starting with v1.4.0 of OpenRM, we've introducted dependencies upon third party software in order to provide support for i/o for different types of files. As of the time of this writing (August 2001), the only dependency is upon the JPEG library, and this will affect only Solaris (and Win32) users, as JPEG headers and libraries are provided with other OSs. In the future, this section will be expanded as a function of an increasing number of dependencies.
If you wish, you can disable the dependency upon the JPEG library and headers. This is a one-line change:
% cd /tmp/openrm/rm160/include/rmi % vi rmi.h
Inside rmi.h, change this line:
#define RM_JPEG 1
to this:
#define RM_JPEG 0
You must make this change prior to compiling the OpenRM distribution. This change will result in a build that does not depend upon the JPEG headers or libraries, and which will not support JPEG file i/o.
To build OpenRM, you start the make process from the directory where OpenRM is installed:
% cd /tmp/openrm/rm160 % make target-architecture
Where target-architecture is one of the following build targets:
Target | Notes |
---|---|
linux
linux-debug |
|
linux-x86_64 linux-x86_64-debug linux-x86_32 linux-x86_32-debug |
|
linux-nopthreads
linux-nopthreads-debug |
|
macosx-X11 macosx-X11-debug |
|
solaris
solaris-debug |
|
irix6-32
irix6-32-debug irix6-n32 irix6-n32-debug irix6-n32-mips4 irix6-n32-mips4-debug irix6-64 irix6-64-debug |
|
freebsd |
|
netbsd netbsd-debug netbsd-pkgsrc |
|
In most circumcstances, these assumptions will prove to be valid. If you need to alter paths, edit the make.cfg file.
Beginning with OpenRM version 1.5.2 (April 2004), there is a "make install" target that will copy the OpenRM libraries, headers and documentation into a "standard location". After you successfully compile OpenRM, to install the libraries, headers and docs, type:
% make install
Note that /usr/local/rm152 is the destination for the install. In most cases, you need sudo or root access to write into /usr/local. If you wish to install OpenRM into some other location, such as /home/joe/rm160, then you will need to edit the main OpenRM Makefile (sorry) and change the line that reads:
INSTALL_DIR = /usr/local/rm160
to this:
INSTALL_DIR = /home/joe/rm160
You can choose to install OpenRM anywhere you like. However, all of the the OpenRM demonstration programs – the RMdemo distribution, the OpenRM/Chromium distribution, the OpenRM/CAVE demos and the Gordo distribution – all expect that OpenRM is install in /usr/local/rm160.
First, create a directory for the OpenRM demonstration programs in the same location where you unpacked the OpenRM headers and libraries:
% cd /tmp/openrm % mkdir rmdemo
Next, unpack the OpenRM demonstration programs under that directory:
% cd /tmp/openrm % gunzip -dc /tmp/openrm-demo-1.6.0.tar.gz | tar xvf -
That will create the subdirectory rmdemo under /tmp/openrm, and the demo programs source code and data will be unpacked into /tmp/openrm/rmdemo.
Inside the /tmp/openrm/rmdemo directory are a couple of Makefiles: Makefile.x11 for Unix/X11 and Makefile.w32 for Win32 systems. The Makefile.x11 file includes a file called makeinclude, and makeinclude has the definitions that are likely to vary from system to system.
Also included in the /tmp/openrm/rmdemo directory is a shell script called configure that you should use to generate a makeinclude for your particular system. The configure script will detect which OS you are running, and in the absence of any command-line arguments, will generate reasonable default values for the "standard" libraries and headers, such as X11, OpenGL and JPEG (except for Solaris and MacOSX, where JPEG must be manually installed). Chances are, most of you will only need to specify the location of OpenRM Scene Graph on your system. The table below lists the command line flags, their default values along with some additional information.
The configure script takes up to seven command line arguments that specify:
Command line flag | Default Value | Info |
---|---|---|
-rm=/locationOf/OpenRMSceneGraph | /usr/local/rm160 | Specify the location of the OpenRM Scene Graph headers and libraries. Under the directory specified here, the headers should live in an "include" subdirectory, and the libraries should live in a "lib" subdirectory. |
-opengl=/locationOf/OpenGL |
Solaris: /usr/openwin Linux/FreeBSD/MacOSX/Irix: /usr |
Under most circumstances, you should not need to change the value of this flag. We use it occasionally to test against new versions of Mesa. Note that OpenRM requires the libGLU library in addition to libGL. If your system does not have libGLU, you can grab a tarball from the Mesa website and build/install for your system. |
-x11=/locationOf/x11 |
Solaris: /usr/openwin Linux/FreeBSD/MacOSX: /usr/X11R6 Irix: /usr |
Under most circumstances, you should not need to change the value of this flag. This command-line option will likely be deprecated in a future release. |
-jpeg=/location/of/JPEGstuff |
Linux, Irix: Depends upon ABI. Solaris, MacOSX: No default location. |
On some OSs where the JPEG headers and libraries are installed, their
location is a function of the ABI. For example, if you're building
for a 64-bit ABI on Linux, the libraries are located in /usr/lib64
and the headers are located in /usr/include. The configure script knows
about these nuances and will do the right thing. Note that the SGI
guys goofed when they put Irix together – there is no 64-bit
version of the JPEG library included with Irix. You'll have to
build it yourself. The version SGI ships is not compatible with
the most recent version of the source code from the JPEG working
group, so you're on your own here.
On the other hand, if you specify a value for this argument, it is assumed that JPEG headers and libs live in the one directory that you specify. This approach works if you have simply unpacked the jpeglib source into a single directory and built it - the headers and libs will both be in the directory. If you have done something a bit more ambitious like copy the JPEG headers into /usr/local/include and libjpeg.a into /usr/local/lib, then the values placed into makeinclude by the configure script (e.g., /usr/local) will not be accurate, and compilation will fail. You may have to modify the makeinclude file generated by the configure script to manually set up include and link lines to accommodate your setup. |
-cr=/locationOf/Chromium | None. |
Note: Unless you are purposefully attempting to use Chromium, you can
ignore this option. If you do with to use Chromium, be forewarned that this script will work only for Linux systems. If you are running on a non-Linux system, you must modify the makeinclude by hand. The places where changes are needed should be obvious. This option is intended to specify the root directory for the Chromium installation on your machine. |
-abi=[some abi spec] | Each system has a default ABI. |
All platforms have a default ABI (application binary interface): when you
compile and link using default parameters, you get a binary that will
run on your system. Some operating systems, like Irix and 64-bit Linux,
support multiple ABIs. Both Irix and Linux let you build 64- or 32-bit
binaries. The purpose of this flag is to let you specify a specific
ABI to match the one you used when building the OpenRM libraries. The
ABIs must be the same, otherwise the demo programs will not run. The ABI arguments that are supported by the configure script are:
% configure -abi=linux-x86_64 |
-opt=[compiler optimization] | None. |
Use this argument to set other compiler flags, such as optimization level. If
you want to specify multiple arguments, enclose the option group in quotes.
For example:
% configure -opt="-g -O2" |
After running the configure script, you may want to peek inside the resulting "makeinclude" file to make sure everything seems reasonable. Then, type:
% make -f Makefile.x11
All demonstration programs are launched from the command line, and each will do something reasonable with no command line arguments. Prior to running the demonstration programs, be sure to set the LD_LIBRARY_PATH variable:
% setenv LD_LIBRARY_PATH /usr/local/rm160/lib
For detailed information about each individual demonstration program, please refer to the OpenRM demonstration program description and usage page.
|
This page last modified -- Sunday, 07-Aug-2005 08:30:37 PDT |