PBRT Help

Please email cs348b-spr0506-staff@lists.stanford.edu if you are having problems building or running PBRT using your preferred environment. You might also check the Homework1Discussion page where everyone is encouraged to post problems and solutions encountered running pbrt on various environments. The following instructions might help you out though (big thanks to Lee Hendrickson for taking good notes as he went through the trouble).

Extra Utilities

Building pbrt on Linux (the 'myth' machines in Sweet Hall)

The public release of pbrt 1.02 available on www.pbrt.org requires modification to build on Stanford's 'myth' machines. We have placed a myth-specific tar file online at /afs/ir/class/cs348b/pbrt/pbrt1.02.cs348b.tar.gz. This archive contains two subdirectories:

After unzipping this archive to %%MY_LOCAL_DIR%% in your home directory, you will need to add the following directories to your environment's library search path.

For example, assume I unzipped the archive to /afs/ir/users/k/a/kayvonf/src. Then in csh I'd set my LD_LIBRARY_PATH to:

setenv LD_LIBRARY_PATH /afs/ir/users/k/a/kayvonf/src/pbrt/bin:/afs/ir/users/k/a/kayvonf/src/cs348b_extras/lib

So the entire process to compile PBRT on a myth machine is:

  1. extract /afs/ir/class/cs348b/pbrt/pbrt1.02.cs348b.tar.gz into your local AFS space.

  2. set the appropriate LD_LIBRARY_PATH (probably a good idea to add this to your .login)
  3. build pbrt by typing 'make' from the /pbrt directory
  4. build the tools by typing 'make' from the /pbrt/tools directory
  5. Before running pbrt, you will need to add PBRT_SEARCHPATH=%%FULL_PATH_TO_MY_LOCAL_DIR%%/pbrt/bin to your environment.

Building pbrt on Windows Using Visual Studio 2003

The build of pbrt using Visual Studio 2003 is pretty much straight out of the box, and following the instructions in the pbrt book should get you all the way there. A couple notes:

Building pbrt on Windows Using Visual Studio 2005

Due to popular demand, here are fairly explicit instructions for building pbrt under Visual Studio 2005. However, for those that don't want to build the whole system themselves, here are the pbrt binaries built in VS 2005.

Two notes for that package:

  1. You can use the pbrt binaries as is (in the pbrt/bin, and pbrt/win32/Projects/[Debug, Release] directories), but if you want to recompile (which I'm going to assume we'll need to for later homeworks), use the provided solution file in pbrt/win32/pbrt.sln. (If you already have a pbrt source tree, just replace the win32 directory with this one.) To do this you will have to also grab some of the support libraries below (namely, OpenEXR).

  2. The default solution file doesn't build the tools directory (as in Linux). I've provided a solution file just for exrtotiff (since it seems to be the most useful tool), or you can just use the binaries in pbrt/bin. I would strongly recommend the latter, building it yourself is a royal pain.

Support Libraries:

  1. OpenEXR - you'll need this if you want to recompile pbrt. To set up the necessary build environment, see the instructions above.

  2. zlib - only if you want to also recompile OpenEXR.

  3. fltk - only if you want to also recompile OpenEXR's exrdisplay utility.

  4. libjpeg - only if you want to recompile exrtotiff (though you'll need the bin/jpeg62.dll file to actually run the utility).

  5. libtiff - again, only if you want to recompile exrtotiff (though you'll need the bin/libtiff3.dll file to actually run the utility).

If you run into any problem, you can let me know, though I can't promise any particular level of support.

Building pbrt on Gentoo Linux (and possibly other distros)

Installing PBRT:

1. emerge openexr and tar -xzvf pbrt -C $PATH_TO_PBRT_SRC

2. edit Makefile, changing to:

3. edit core/pbrtlex.l, changing to:

4. edit tools/Makefile, changing to:

5. make

6. cd tools && make

Setting Environment Variables:

1. edit ~/.bashrc or similar, adding:

2. source ~/.bashrc

Good to go! Just type pbrt $FILE to run the program.