Compiling DIVE @ UCL
SGI |WinNT/2000, Visual Studio 6
|WinNT/2000 Visual Studio 7 NEW
To access the DIVE source code you need to be a member of the UNIX
group "divesrc".
The main code tree is stored:
/cs/research/vr/dive/starship/dive/dive3.3x4
where the 3.3x4 refers the to version number (i.e. UCL version 4
relative to released 3.3x)
Compilation on SGI is very simple (see below), though if you want to
make source changes, please make a complete copy of that repository
and DO NOT change the original without checking with Anthony. This is
because that directory is synchronised to the main CVS repository at
SICS.
- Install supporting libraries. Your build options will depend on
which libraries you want to bother installing (PNG support,
TextToSpeech support, etc...), for the build options below, you can
just copy the installation we have here.
- We will assume that the directory for your source code (either the base one above, or your own copy) is refered to as SRCDIR
- Create your build directory, preferably on local disk on
your machine (compilation is much faster if you do not use NFS). We will call this directory BUILDDIR
- Optional step. If for some reason you need to alter or change the
actual configure script you will need to run autoconf in the following
three directories:
$SRCDIR/
$SRCDIR/threads
$SRCDIR/sid2
this creates the actual configure scripts.
- Configure dive. cd to $BUILDDIR. If you want a standalone OpenGL
$SRCDIR/configure --enable-tcl=/cs/research/vr/dive/starship/build/dive_tools/n32-mips3/tcltk/irix6 --enable-audio --enable-zlib=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/zlib/irix6 --enable-tts=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/tts/irix6 --enable-gsm=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/gsm/irix6 --enable-video --enable-sproc --enable-jpeg=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/jpeg/irix6 --enable-png=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/png/irix6 --enable-mips3 --enable-cxx-plugin --enable-vrpn=/cs/research/vr/starship/vr/vrpn/vrpn6.02
The references to
/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3 are to
pick up all the default libraries you need to link in with DIVE.
By default we compile with VRPN support built in. Note that this is
done through a plugin, and the default DIVE build doesn't require
explicit configuration with the VRPN path. (References to vrpn within
modules are to a vrpn_vhcl.c which will become a generic vehicle).
If you want to compile with CAVElib and Performer, then you need this alternative:
$SRCDIR/configure --enable-tcl=/cs/research/vr/dive/starship/build/dive_tools/n32-mips3/tcltk/irix6 --enable-audio --enable-zlib=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/zlib/irix6 --enable-tts=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/tts/irix6 --enable-gsm=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/gsm/irix6 --enable-video --enable-sproc --enable-jpeg=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/jpeg/irix6 --enable-png=/cs/research/vr/starship/common/vr/dive/dive_tools/n32-mips3/png/irix6 --enable-performer --enable-cavelib=/usr/local/CAVE --enable-mips3 --enable-cxx-plugin
The differences are:
- --enable-performer - switch from OpenGL to Performer renderer
- --enable-cavelib=/usr/local/CAVE - local installation of the CAVElib libraries.
- Finally cd to $BUILDDIR/appl and type:
gmake diva
Note you must use gmake version 3.79 or better. You can find this for SGI in /cs/research/vr/starship/common/irix/bin/.
- You may want to compile the following processes as well:
proxyserver, diveserver. The other processes are experimental.
- You may want to compile the following plugins as well:
cd to $BUILDDIR/dive/plugins
gmake vrpn_plugin.so
gmake quake.so
gmake example_plugin.so
gmake quake.so
cd to $BUILDDIR/dive/plugins/vnc
gmake vnc_plugin.so
Notes
- The build is done with two flags that are non-standard:
--enable-cxx-plugin and --enable-mips3. The former is to support C++
plugins and is experimental to some extent. It has little impact on
normal users. The latter is purely to support older architecture
machines such as romulus. We may drop this in future, but note that
the auxiliary libraries (Tcl, jpeg, etc...) have been specifically
compiled for mips3.
- On SGI audio remains a problem, with occasionaly crashes in the
audio section. The compilation flag: --enable-sproc, alows the audio
to run in a separate process. However it seems to have occasionaly
memory conflicts. More experimentation is required on this.
Since 2005, this is now the preferred way to build DIVE. Under
bin/winnt_vs7/ is a build system for Visual Studio 7.1 (.Net 2003).
It is not tested on Visual Studio .Net 2000 (7.0).
There are two solution files:
- dive.sln
- dive_plugins.sln
In dive.sln are the applications:
- diva
- proxyserver
- diveserver
and all the DIVE internal libraries.
In dive_plugins.sln are the plugins:
- vrpn_server_plugin
- vrpn_plugin
- body_virman_plugin
- quake
more will be added here as they become available.
Getting Started
You MUST set the DIVE_TOOLS_DIR environment variable to point to the
directory where the Dive support tools are installed.
On my machine that is:
C:/dev/dive/dive_tools_vc
this is the directory usually called that contains the
sub-directories, jpeg, tcltk, X11, xdr, zlib.
In you want to compile with VRPN, you MUST set the VRPN_DIR. On my
machine that is:
C:\dev\vrpn\vrpn_06_06.beta7
also, you MUST compile VRPN with the "Multithreaded Debug" run-time
system. This may or may not be the default in your build system.
The VRPN version above uses Visual Studio 6, where you find the option
under Project/Settings/C-C++/Code-Generation.
Running DIVE
diva.exe is built to the directory bin/winnt_vs7/appl (i.e. in the
same relative directories as other build systems. To run DIVE Use you
favourite wrapper scripts, or e.g.:
export DIVEPATH=c:/dev/dive/dive3.3x5/data
./diva.exe -init vishnu_init.tcl -sin
If it complains that it could not find tcl83.dll, then you need to
copy the following four files into the appl directory: msvcrt.dll,
tcl83.dll, tclpip83.dll, tk83.dll. They can be found in the
dive_tools_vc/tcltk/win32/bin directory.
Notes
This is not a complete build from scratch, some steps have been
skipped because they rely on GNU tools. In particular:
- No flex and bison steps - I copied the intermediary files to the
binary build tree (NOT the source tree).
- ml use is hard-coded.
Note that I had to comment out one line in the assembler code to get
DIVE to compile with ml 7. Otherwise things seem very straightforward.
You can refer to original (slightly outdated) instructions
here. Note that the following instructions were written for a more
modern version of Cygwin than previous releases of DIVE. This has had
an impact on the actual configure script, but not the process of
running it.
- You need:
- Visual C++ 6.0, SP4 or later
- MASM 6.15 (download
instruction here - check which version you need - there are different
for SP4 or SP5 ). You do NOT need this just to compile plugins or
to link applications against the dive core libraries.
- Cygwin. Note the current source repository requires a
recent version of cygwin (later than September 2001). This is due to
some path mangling code in the configure file. Note that cygwin now
comes with autoconf, so this does not need installing
separately. NOTE as of 7/2/2002 we were having problems with
bison 1.30 failing with a core dump on the DIVE vrml parser. No time
to look in to this at the moment, but bison 1.28 works fine (not sure
what date the default bison installed under cygwin was switched).
- Download and unzip New dive help package for
vc to a directory on your c:\ drive, for example,
most machines at UCL are laid out so c:\dev\dive\ You will
get a sub-directory call dive_tools_vc. Note that the version of
dive_tools_vc on the SICS page contains an out of date version of
Tcl/Tk.
- Setting up the environment
- Depending on your preference, you can either add the variables
required for compilation direct to your environment, or use the
vcvars32.bat script to set them for you. Note you have to
compile from a cygwin bash shell, to use vcvars32, first run a DOS
shell, then run vcvars32.bat, then run cygwin.bat from the directory
where you installed cygwin. You can speed this up by adding the
directory containgin vcvars32 (somewhere under \Microsoft Visual
Studio\VC98\bin) and the directory containing cygwin.bat to your
path.
- Due to a quirk of the build process, you will have to find the
executable make.exe under the cygwin directory and make a copy called gmake.exe
- For actually running DIVE, you need to add the directory under
dive_tools_vc where you can locate tcl83.dll and
tk.dll to your
PATH. (e.g. c:\dev\dive\dive_tools\tcltk\win32\bin). Alternatively you
can copy the files tcl83.dll and tk83.dll to the directory
$BUILDDIR\appl, or into your windows system directory).
- We will assume that the directory for your source code (either
the base one above, or your own copy) is refered to as SRCDIR
- Create your build directory. We will call this directory
BUILDDIR
- Run autoconf in the following
three directories:
$SRCDIR/
$SRCDIR/threads
$SRCDIR/sid2
this creates the actual configure scripts.
NOTE for 3.3x5 and earlier (not CVS version)
There is a small issue with cygwin and dive3.3x5 and earlier here. The
dive3.3x5 and older source trees, rely on an old version of autoconf,
which has recently been superceeded. When you run autoconf, if you do
NOT see something like the following statements several times:
configure.in:547: warning: AC_TRY_RUN called without default to allow cross comp
iling
They you will need to insert this line as the 2nd line in each of
the three configure.in files in those directories listed above.
AC_PREREQ(2.13)
- Configure dive. cd to $BUILDDIR
$SRCDIR/configure --host i686-unknown-winnt --enable-tcl=c:/dev/dive/dive_tools_vc/tcltk/win32 --with-X11=c:/dev/dive/dive_tools_vc/X11/win32 --with-xdr=c:/dev/dive/dive_tools_vc/xdr/win32 --enable-audio --enable-zlib=c:/dev/dive/dive_tools_vc/zlib/win32 --enable-jpeg=c:/dev/dive/dive_tools_vc/jpeg/win32 --enable-pthreads --with-cc=cl
If you have a very old version of autoconf, you might replace --host
with --build.
Of course you will need to change /c/dive/dive/dive_tools_vc
to your own corresponding path.
-
This is what a successful configure output looks
like. Check that Tcl/Tk are found, as are X11, jpeg and XDR. Also
check that it could find the size of the types! I.E. check it doesn't
say that long has size 0.
-
NOTE for 3.3x5 and earlier (not CVS version) If you have a cygwin with X11 (if you don't know, then check the
following anyway). In your BUILDDIR, configure creates a file called
config.status. Look for a line like this:
s%@DEFS@% -DWIN32=1 -DCL=1 -DHAVE_FLOAT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_WINSOCK_H=1 -DHAVE_PROCESS_H=1 -DHAVE_IO_H=1 -DHAVE_MEMSET=1 -DHAVE_ALLOCA=1 -DHAVE_LIBTCL=1 -DHAVE_LIBTK=1 -DSIZEOF_CHAR=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_BOOLEAN=1 -DHAVE_JPEG=1 -DHAVE_ZLIB=1 -DHAVE_VRPN=1 -DHAVE_LIBX11=1 -DHAVE_LIBXMU=1 -DDIVEAUDIO=1 -DUSE_PTHREADS=1 %g
This line should NOT have " -DHAVE_LIBX11=1 -DHAVE_LIBXMU=1". Delete those statements, and run config.status (its a shell script - run "sh config.status"). Re-running config.status will re-generate all the GNUmakefiles.
Then look for a line like this:
s%@WINLIBS@%c:\\dev\\dive\\dive_tools_vc\\tcltk\\win32\\lib\\tk.lib \\usr\\X11R6\\lib\\libXmu.a -L\\usr\\X11R6\\lib -lX11%g
and change it to:
s%@WINLIBS@%c:\\dev\\dive\\dive_tools_vc\\tcltk\\win32\\lib\\tk.lib%g
- Build DIVE. cd to $BUILDDIR/appl
gmake diva
-
Again there is a minor wrinkle with dive3.3x5 and new cygwin system
here. If you build stops with this error:
../../../../dive/src/vrfile.y(270) : error C2143: syntax error : missing ';' bef
ore '}'
make[1]: *** [vrfile.tab.obj] Error 2
rm vrfile.tab.c
make[1]: Leaving directory `/c/dev/dive/dive3.3x5/bin/winnt/dive/src'
make: *** [../dive/src/libdive.lib] Error 2
then edit line 270 of src/vrfile.y and replace "YYABORT" with "YYABORT;"
retype "gmake diva" in the appropriate directory.
-
NOTE for 3.3x5 and earlier (not CVS version) Another minor wrinkle if you installed cygwin with X11 support. If
your build stops with this line:
Command line warning D4002 : ignoring unknown option '-L\usr\X11R6\lib'
Command line warning D4002 : ignoring unknown option '-lX11'
Command line warning D4024 : unrecognized source file type '\usr\X11R6\lib\libXm
u.a', object file assumed
LINK : fatal error LNK1104: cannot open file "\usr\X11R6\lib\libXmu.a"
make: *** [diva] Error 2
Unfortunately you forgot to check that configure generated the correct
variables at step 6. Go back to there and edit and run config.status
- Run DIVE. Use you favourite wrapper scripts, or e.g.:
export DIVEPATH=c:/dev/dive/dive3.3x5/data
./diva.exe -init vishnu_init.tcl -sin
If it complains that it could not find tcl83.dll, then you need to
copy the following four files into appl directory: msvcrt.dll,
tcl83.dll, tclpip83.dll, tk83.dll. They can be found in the
dive_tools_vc/tcltk/win32/bin directory.
Any local queries about Dive should go to Anthony Steed, A.Steed@cs.ucl.ac.uk