Skip to content

Building PBRT on CentOS

benjamin-heasly edited this page Apr 30, 2013 · 12 revisions

The RenderToolbox3 team has access to a computing cluster called Rhino, which is based on the CentOS version 5.9 Linux distribution. We were able to build PBRT on Rhino, but it took some extra steps because we don't have root privileges on Rhino. Instead of installing and updating PBRT's dependencies the normal way, with the yum package manager, we had to build them by hand.

Here are the steps we took to build PBRT and its dependencies. These are specific to our situation, but we hope they will be helpful if you find yourself in a similar situation.

Our general approach was to install things in the /home2/brainard folder that we have access to. In particular:

  • /home2/brainard/src contains source code that we downloaded
  • /home2/brainard/dependencies contains PBRT dependencies that we built
  • /home2/brainard/pbrt contains PBRT that we built
  • /home2/brainard/bin contains links to PBRT executables
  • /home2/brainard/test contains output data from testing PBRT

Bison

PBRT uses Bison to parse scene files. We installed Bison like so:

cd /home2/brainard/src
wget 'http://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz'
tar xzf bison-2.7.tar.gz
cd bison-2.7
./configure --prefix=/home2/brainard/dependencies/bison-2.7 2>&1 | tee log.configure
make 2>&1 | tee log.build
make install 2>&1 | tee log.install
ln -s /home2/brainard/dependencies/bison-2.7/ /home2/brainard/dependencies/bison

Commands like 2>&1 | tee log.build cause error messages and output messages to be saved in a log file.

GSL

PBRT depends on the GNU Scientific Library. We installed GSL like so:

cd /home2/brainard/src
wget 'http://mirror.team-cymru.org/gnu/gsl/gsl-1.15.tar.gz'
tar xzf gsl-1.15.tar.gz
cd gsl-1.15
./configure --prefix=/home2/brainard/dependencies/gsl-1.15 2>&1 | tee log.configure
make 2>&1 | tee log.build
make install 2>&1 | tee log.install
ln -s /home2/brainard/dependencies/gsl-1.15/ /home2/brainard/dependencies/gsl

GitHub SSH

We used git to access the pbrt-v2-spectral repository here at GitHub. But the version of git on our Rhino system was not configured to use the HTTPS protocol that GitHub recommends. Instead, we set up SSH access using GitHub instructions:

PBRT

RenderToolbox3 uses a modified version of PBRT called pbrt-v2-spectral. pbrt-v2-spectral is set up for multi-spectral rendering and can produce multi-spectral output data files. We installed pbrt-v2-spectral like so:

cd /home2/brainard/src
git clone git@github.com:ydnality/pbrt-v2-spectral.git pbrt-v2-spectral
cd pbrt-v2-spectral/src

# the "realistic" camera seems to be broken the master branch, we don't need it
rm cameras/realistic.h
rm cameras/realistic.cpp

export PATH=/home2/brainard/dependencies/bison/bin/:$PATH
make HAVE_EXR=1 EXR_INCLUDES=-I/usr/include/OpenEXR/ EXR_LIBDIR="-L/usr/lib64 -L/home2/brainard/dependencies/gsl/lib/" 2>&1 | tee log.build
mkdir /home2/brainard/pbrt
cp bin/* /home2/brainard/pbrt
ln -sf /home2/brainard/pbrt/pbrt /home2/brainard/bin
ln -sf /home2/brainard/pbrt/exrdiff /home2/brainard/bin
ln -sf /home2/brainard/pbrt/exravg /home2/brainard/bin
ln -sf /home2/brainard/pbrt/bsdftest /home2/brainard/bin

Test PBRT

Before we could test PBRT, we had to set up the shell environment to locate the PBRT executable and the GSL library dependency:

export PATH=/home2/brainard/bin:$PATH
export LD_LIBRARY_PATH=/home2/brainard/dependencies/gsl/lib:$LD_LIBRARY_PATH

Now we were able to render one of the PBRT demo scenes:

mkdir /home2/brainard/test
cd /home2/brainard/test
pbrt /home2/brainard/src/pbrt-v2-spectral/scenes/metal.pbrt --outfile metal.dat
pbrt src/pbrt-v2-spectral/scenes/metal.pbrt --outfile metal.dat

pbrt-v2-spectral produces data files like metal.dat. We would not be able to view the file until we set up the rest of RenderToolbox3. See Installing RenderToolbox3.

Clone this wiki locally