= PBRT Help = Please email cs348b-spr0506-staff@lists.stanford.edu if you are having problems building or running PBRT using your preferred environment. The following instructions might help you out though (big thanks to Lee Hendrickson for taking good notes as he went through the trouble). == Building pbrt on Linux (the 'myth' machines in Sweet Hall) == The public release of pbrt 1.02 available on [http://www.pbrt.org 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: * {{{/pbrt}}} - which contains the PBRT 1.02 source tree with modifications made to its makefiles * {{{/cs348b_extras}}} - which contains a build of OpenEXR and libtiff that are required to properly build PBRT on myth. 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. * {{{%%FULL_PATH_TO_MY_LOCAL_DIR%%/pbrt/bin}}} * {{{%%FULL_PATH_TO_MY_LOCAL_DIR%%/cs348b_extras/lib}}} For example, assume I unzipped the archive to {{{/afs/ir/stanford/users/k/a/kayvonf/src}}}. Then in csh I'd set my LD_LIBRARY_PATH to: {{{setenv LD_LIBRARY_PATH /afs/ir/stanford/users/k/a/kayvonf/src/pbrt/bin:/afs/ir/stanford/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: * You will need a mimimal installation of [http://www.cygwin.com cygwin] (for flex and bison) to properly build pbrt. Note that if you install cygwin into the default {{{c:\cygwin}}} directory, no modifications to the Visual Studio build are necessary. If cygwin is not installed into this directory, you will need to do change the ''custom build step'' for the files {pbrtlex.l} and {pbrtparse.y} in the 'parser files' directory of the 'core' project. Right click on these files to bring up the property page, and change the commandline for the custom build step to correctly call the cygwin flex and bison executables on your system. * A complete Visual Studio solution file to build pbrt is located in the {{{/win32}}} sudirectory of the distribution. After a successful build, pbrt binaries and plugins are located in the {{{/win32/Projects/Debug}}} or {{{win32/Projects/Release}}} directories (depending on which build you chose to perform). To run pbrt, you will need to set the environment variable {{{PBRT_SEARCHPATH}}} to one of these directories. * pbrt includes no Visual Studio projects to build {{{exrtotiff}}} on Windows. I'm working on Visual Studio project file to build {{{exrtotiff}}}. It should be available shortly. * To view high-dynamic range (exr) images on Windows, download the OpenEXR Windows binaries from http://savannah.nongnu.org/download/openexr/OpenEXR-1.2.2-win32.zip. The program {{{exrdisplay}}} in this package is a simple exr viewer for Windows. * If you have Photoshop, the OpenEXR software provides an exr-photoshop plugin for both Windows and OS X. You may download the package from http://www.openexr.com/downloads.html. The documentation is at http://www.openexr.com/photoshop_plugin.html. == Building pbrt on Windows Using Visual Studio 2005 == Unfortunately, pbrt doesn't build straight out of the box using Visual Studio 2005. I'll get instructions up on how to do this shortly. Shout loudly if you need this immediately. == Building pbrt on Gentoo Linux (and possibly other distros) == 1. emerge openexr 2. edit Makefile, changing to: * line 6: EXRINCLUDE=/usr/include/OpenEXR * line 36: EXRLIBDIR=/usr/lib 3. edit core/pbrtlex.l, changing to: * line 82-83: WHITESPACE [ \t\r]+ * [this is due to the ^M not being parsed correctly by lex] 4. edit tools/Makefile, changing to: * line 7: EXRDIR=/usr/include/OpenEXR * line 9: CXXFLAGS = $(OPT) -I/sw/include -I$(EXRDIR) -I$(PBRTDIR)/core * line 16: LDFLAGS=-L/usr/lib 5. make 6. cd tools && make