Business Card Raytracer and POV-Ray Installation in Ubuntu 13.04

Via HN. A step-by-step decipher  of the Raytracer source code that fit a business card. A Raytracer is a program that generate an image through ray tracing technique. Hard to imagine me ever getting close to what he, Andrew Kensler managed to achieve.


The post somehow reignite my love for computer-generated imagery. That also reminds me of the classic raytracer, POV-Ray that I used to play and waited hours to generate one tiny small image. Unfortunately, due to licensing issue, the program was dropped from Ubuntu since 12.04. No worry, we still can install it using source code compilation. Installation steps for Ubuntu 13.04 as follows:

1. Download and extract the latest greatest version, I am using the 3.7 RC7 beta.
$ wget http://www.povray.org/beta/source/povray-3.7.0.RC7.tar.bz2
$ tar jxvf povray-3.7.0.RC7.tar.bz2

2. Configure the software before compilation. You should encounter quit a few warnings of missing required libraries. Note the COMPILED_BY flag is compulsory.
$ cd povray-3.7.0.RC7
$ ./configure COMPILED_BY="foobar baz "

3. Install the prerequisite packages. Note that I choose to install all the Boost-related packages but some are optional.
$ sudo apt-get install libboost1.53* zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libopenexr-dev libsdl1.2-dev

4. Run the configure script again. You will still encounter the dreadful 'cannot link with boost thread library' (see below). Took me a while of googling to find the exact solution.
$ ./configure COMPILED_BY="foobar baz "
...
checking whether the boost thread library is usable... no
configure: error: in `/home/kmang/project/povray-3.7.0.RC7':
configure: error: cannot link with the boost thread library
See `config.log' for more details
...

5. Based on the solution proposed, append the LIBS="-lboost_system" option to the configure script to make compilation works. Compile and create the .deb package using checkinstall program (easy for uninstallation later). Note that compilation is quite long, roughly around 49 minutes.
$ ./configure COMPILED_BY="foobar baz " LIBS="-lboost_system"
$ time make
...
real    49m43.344s
user    47m11.508s
sys     2m15.908s

$ sudo make install && sudo checkinstall

6. To test the application, let's render Utah teapot, the famous standard reference object in the computer graphics community. See below for the sample rendered output.
$ cp -rv /usr/local/share/povray-3.7/scenes/advanced/teapot/ /tmp
$ cd /tmp/teapot
$ povray -w320 -h240 teapot.pov

No comments:

Post a Comment