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 accessed in two ways: by zip file or through our CVS repository. 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

There are two ways to get the source code for PhysBAM_Tools. The first is by downloading: The second is to check it out directly from our CVS repository. The required modules are Look at the CVS section below for our repository information.
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. There are two ways to get the source code for PhysBAM_Geometry. The first is by downloading: Note that if you are getting the code via zip file, PhysBAM_Geometry requires PhysBAM_Tools to have been downloaded as well.

The second method of getting PhysBAM_Geometry is to check it out directly from our CVS repository. The required modules are Look at the CVS section below for our repository information.
PhysBAM_OpenGL

There are two ways to get the public version of PhysBAM_OpenGL. Similar to getting PhysBAM_Tools, one can download the following compressed files Note that if you are getting the code via zip file, PhysBAM_OpenGL requires PhysBAM_Tools and PhysBAM_Geometry to have been downloaded as well.

The second option for getting PhysBAM_OpenGL is to check out the code directly from CVS. The required modules are 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

There are two ways to get the public version of PhysBAM_Ray_Tracing. Similarly to PhysBAM_Tools, one can download PhysBAM_Ray_Tracing in the following compressed files Note that if you are getting the code via zip file, PhysBAM_Ray_Tracing requires PhysBAM_Tools and PhysBAM_Geometry to have been downloaded as well.

The second option for getting PhysBAM_Ray_Tracing is to check out the code directly from CVS. The required modules are 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.
CVS

CVS can be downloaded from here. To obtain permissions to our repository, contact Jon Su.
A couple of notes about the code and the CVS repository.
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 Jon Su an email, 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 forum for users to ask and answer each other questions.
We have also 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.