Downloading and Compiling the Code

Below we explain how to download the code, as well as how to set up your environment to be able to compile and run the code once you have it. The code can be downloaded using the archives below. You can download the entire library at once, or follow the instructions below to get only the pieces you need, which should center around one of the four main parts of PhysBAM - PhysBAM_Tools, PhysBAM_Geometry, PhysBAM_OpenGL, and PhysBAM_Ray_Tracing - as outlined here.

PhysBAM_Tools
PhysBAM_Geometry

First note that this is not the full PhysBAM_Geometry described on the "How to Get the Code" page, it is a reduced set that is intended to be used by the PhysBAM_OpenGL and PhysBAM_Ray_Tracing libraries. PhysBAM_Geometry requires PhysBAM_Tools to have been downloaded as well.
PhysBAM_OpenGL PhysBAM_OpenGL requires PhysBAM_Tools and PhysBAM_Geometry to have been downloaded as well. The following modules are optional, but are included in the compressed files above. Note that the current version of PhysBAM_OpenGL depends only on PhysBAM_Tools and a small subset of PhysBAM_Geometry. To use the opengl viewer, one should compile the desired project (1D, 2D, or 3D) under the Projects module. There are three versions of the opengl viewer, which are used for 1D, 2D and 3D data structures.
PhysBAM_Ray_Tracing PhysBAM_Ray_Tracing requires PhysBAM_Tools and PhysBAM_Geometry to have been downloaded as well. The following modules are optional, but are included in the compressed files above. Note that the current version of PhysBAM_Ray_Tracing depends only on PhysBAM_Tools and a small subset of PhysBAM_Geometry. To use the renderer, one should compile the ray_tracing project under the Projects module.
Compiling the Code

We use a combination of gcc 4.5.2 and SCons .96 to build our library on our linux systems. We do not have a build systems for other environments, such as for Windows or using Makefiles. However, if someone gets a working build system other than the default one we have provided, please send an email to us, and we will gladly put a link to your version on this site (as well as your name, of course) to share with others.

Once you have gcc and Scons installed properly, follow these steps to setup your build environment:
  1. Create a root directory (i.e. /physbam)
  2. Set the environment variable $PHYSBAM to your root directory
  3. Set the environment variable $PLATFORM to nocona for 64 bit machines
  4. Either extract the desired zip files above into $PHYSBAM, or CVS checkout the desired libraries into $PHYSBAM.
  5. There should now be a Scripts and Public_Library folder in $PHYSBAM, as well as possibly a Projects folder depending on what you checked out or unzipped.
  6. Go into $PHYSBAM/Scripts/Archives/scons, and type
    • python setup_scons.py
    • This should create two symbolic links for SConstruct and SConstruct.options
  7. Your environment is now setup.
Once your environment is setup properly, go into the the desired directory (e.g. PhysBAM_Tools, PhysBAM_OpenGL, or one of the project directories), and type
      scons -Q --random -u CXX="/usr/bin/g++"
where /usr/bin/g++ should be replaced by the path of your g++ compiler. If gcc and Scons are installed properly, this should create a build directory under the root directory which should contain all the build binaries that you can link against.


User Q&A

We have provided a mailing list, physbam-all@mailman.stanford.edu. To subscribe go here.
We also have compiled a list of troubleshooting tips and gotchas here.