Compiling PBRT for Ubuntu

If you want to experiment with Physically Based Rendering, PBRT is the tool to use. Unfortunately, the latest builds (>1.03) have some incomplete instructions on how to build PBRT on your own machine.

Update: I’ve recently compiled PBRT on Ubuntu 12.10 using the following (shorter!) instructions. Might want to try these first

  • PBRT needs the following packages installed. Copy/paste the next line to install them
    sudo apt-get install build-essential openexr openexr-viewers libopenexr-dev libilmbase-dev libfl-dev
  • After installing these packages, I could just run make in the PBRT src directory succesfully.

Older info: I’ve built it on Ubuntu 9.10 and 10.04 using the following instructions:

  • PBRT needs the OpenEXR libraries, but unlike it mentions in its makefile, just installing openexr and libopenexr-devis not enough. The full apt-get install line should read:
    sudo apt-get install openexr openexr-viewers libopenexr-dev libilmbase-dev
  • The makefile looks for EXR libraries in /usr/local/*, while ubuntu installs them in /usr/lib. The following lines in the makefile should be changed:
    EXRINCLUDE = -I/usr/local/include/OpenEXR to EXRINCLUDE = -I/usr/include/OpenEXR
    EXRLIBDIR = -L/usr/local/lib to EXRLIBDIR = -L/usr/lib
  • PBRT should compile now, by running make in the source directory.
  • Before you can render scenes, you should set the PBRT_SEARCHPATH environment variable. In a terminal, type:
    export PBRT_SEARCHPATH = /location/to/pbrt/bin
    (the bin folder was created in the make process)

Well, I hope this is a timesaver! :)

Comments are closed.