Skip to content

Building PBRT on CentOS

benjamin-heasly edited this page Mar 27, 2013 · 12 revisions

The RenderToolbox3 team has access to a computing cluster called Rhino, which is based on the CentOS 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, which means we can't install and update RPM packages normally.

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.

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

  • /home2/brainard/src will contain source code that we download
  • /home2/brainard/dependencies will contain PBRT dependencies
  • /home2/brainard/pbrt will contain PBRT itself
  • /home2/brainard/bin will contain links to PBRT executables

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 use 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

We use 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 -s /home2/brainard/pbrt/pbrt /home2/brainard/bin
ln -s /home2/brainard/pbrt/exrdiff /home2/brainard/bin
ln -s /home2/brainard/pbrt/exravg /home2/brainard/bin
ln -s /home2/brainard/pbrt/bsdftest /home2/brainard/bin

Test PBRT

Now PBRT should be installed for us, in our /home2/brainard folder. Before we can test PBRT, we need to set up the shell environment to locate PBRT and the GSL dependency that we just build:

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

Now we should be 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

The resulting metal.dat should contain multi-spectral output data. But it's not in a standard image file format, so we can't view it until we set up the rest or RenderToolbox3.

Clone this wiki locally