Installing POV-Ray Beta on Shamu
— David Wagner 2009/09/03 09:24
These notes document installation of POV-Ray 3.7.0 beta 34 on Shamu. To reproduce this installation, you will need to change every reference to abc123 to your user name, and put your name and email address in the COMPILED_BY setting.
The Boost libraries, ffmpeg, and POV-Ray itself may be compiled using Intel's icc (module load intel/64bit),
but compile the jpeg and tiff libraries with gcc.
However, the performance actually seems worse using icc,
with the benchmark at real 1m12s over the generic gcc time of 55s!
Download and Decompress Source Code
1. Download the POV-Ray beta source and the library sources needed from the install page to a folder ~/src/ in your home directory on Shamu.
2. Untar needed files.
cd ~/src tar xjf povray-3.7.0.beta.34.tar.bz2 tar xjf boost_1_40_0.tar.bz2 tar xzf jpegsrc.v7.tar.gz tar xzf tiff-3.9.1.tar.gz # tar zxf openexr-1.6.1.tar.gz # Optional, but recommended for better gamma? # FIXME: Requires IlmBase, and may have more dependencies. mkdir ~/installed
Compile Libraries
3. Compile the libraries. You may want to open more than one terminal to do these simultaneously.
As of Beta 34, compiling with the -march=nocona (Intel Xeon) compiler flag set seems to slow performance, with POV-Ray benchmark real time falling from about 59 to 55 seconds. However, if you do want to compile with these options, export the following environmental variables before configuring and compiling the following programs.
Note to self: the libraries are currently compiled with -march=nocona; recompile them without before recompiling POV-Ray again.
$>cat /proc/cpuinfo ... model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz ... # Note that setting these seems to decrease performance. export CHOST="x86_64-pc-linux-gnu" export CFLAGS="-march=nocona -O3 -pipe" export CXXFLAGS="${CFLAGS}"
Until I figure out why, just get to configuring and compiling without first setting the target architecture.
cd ~/src/boost_1_40_0 firefox more/getting_started/unix-variants.html & ./bootstrap.sh --help ./bootstrap.sh --prefix=/home/abc123/installed # Use --with-toolset=intel or something like that for icc ./bjam install # This can take a while. # The following may limit to just the libraries needed. #./bjam --with-thread --with-date_time install cd ~/src/jpeg-7 ./configure --prefix=/home/abc123/installed make make test make install cd ~/src/tiff-3.9.1 ./configure --prefix=/home/abc123/installed make make install cd ~/src/zlib-1.2.3 ./configure --prefix=/home/abc123/installed make install ./configure --prefix=/home/abc123/installed --shared make install # FIXME NO WORKY # cd ~/src/openexr-1.6.1 # ./configure --prefix=/home/abc123/installed --disable-ilmbasetest # make # make install
Fix Beta Expiration (Optional)
4. Fix expiration date.
If the beta is already expired and the next version is not yet available, you may edit the source code before compiling, or set an environment variable before executing an expired POV Ray.
cd ~/src/povray-3.7.0.beta.34/source/backend cp povray.h povray.h.orig cd
Change line 129 in /home/abc123/src/povray-3.7.0.beta.34/source/backend/povray.h.
#define EXPIRE_AT (1254434400 + DAYS(120))
+ DAYS(366) is max? If you don't do this, it should still be possible to run an expired beta after executing the following shell command.
export POVRAY_BETA=`povray --betacode 2>&1`
(As of 34, the code is sent on the error stream.)
Compile and Test POV-Ray
5. Compile POV-Ray.
Compiling static is the most straightforward.
Simply module load intel/64bit first to use Intel's toolset.
cd ~/src/povray-3.7.0.beta.34 ./configure COMPILED_BY="Your Name <abc123@my.utsa.edu>" \ --prefix=/home/abc123/installed \ --with-boost=/home/abc123/installed \ --with-libjpeg=/home/abc123/installed/lib \ --with-libtiff=/home/abc123/installed/lib \ --enable-static # Boost isn't found or can't link unless POV-Ray is compiled static. make check install
UPDATE: For ICC, the static libtiff headers seem to have gotten lost.
cd ~/src/povray-3.7.0.beta.34 module load intel/64bit export NON_REDISTRIBUTABLE_BUILD=yes ./configure COMPILED_BY="Your Name <abc123@my.utsa.edu>" \ --prefix=/home/abc123/installed \ --with-boost=/home/abc123/installed \ --with-libjpeg=/home/abc123/installed/lib \ --without-libtiff \ --enable-static # Boost isn't found or can't link unless POV-Ray is compiled static. make check install
Compiling for dynamic linking is tricky, and the library path must have the local library location added before invoking POV-Ray. Also, to get X-windows support, it must be built on the head node.
# Note the weirdness needed for both ''configure'' and the linker to use the correct boost libraries. cp /home/abc123/installed/lib/libboost_thread.so /home/abc123/installed/lib/libboost_thread-1_37.so # NOTE The following must be set and exported before invoking povray! LD_LIBRARY_PATH="/home/abc123/installed/lib" export LD_LIBRARY_PATH install_dir=/home/abc123/installed ./configure \ --prefix="${install_dir}" \ --with-libjpeg="/usr/lib64" \ --with-libtiff="/usr/lib64" \ --with-libpng="/usr/lib64" \ --with-boost="${install_dir}" \ --with-boost-thread="boost_thread-1_37" \ --disable-debug \ COMPILED_BY="Your Name <abc123@my.utsa.edu>" make check install
The Intel toolset also needs a shared ZLib. Sometimes it can't find libtiff…
# For ICC, forget compiling dynamic.
# This does not work.
module load intel/64bit
LD_LIBRARY_PATH="/home/abc123/installed/lib"
export LD_LIBRARY_PATH
install_dir=/home/abc123/installed
./configure \
--prefix="${install_dir}" \
--with-zlib="/home/abc123/installed" \
--with-libjpeg="/home/abc123/installed" \
--with-libtiff="/home/abc123/installed" \
--with-libpng="/home/abc123/installed" \
--with-boost="/home/abc123/installed" \
--with-boost-thread="boost_thread-1_37" \
--disable-debug \
COMPILED_BY="Your Name <abc123@my.utsa.edu>"
Add your local installation directory to LD_LIBRARY_PATH before running the dynamic executable.
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/abc123/installed/lib"
export LD_LIBRARY_PATH
povray
6. Test it.
# The path already has ~/installed/bin set ln -s ~/bin ~/installed/bin cd ~/installed/share/povray-3.7/scenes/advanced povray -D +W640 +H480 biscuit.pov
- Command-line thread number option:
+WT16uses 16 threads.+WT8threads, 1/core on each node, is the default on Shamu.
Install MPEG Software
Installing an MPEG encoding utility is straightforward.
cd ~/src svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg cd ~/src/ffmpeg/ ./configure --prefix=/home/abc123/installed/ make make install # Test it. cd ~/installed/share/povray-3.7/scenes/animation/slinky povray -D +W640 +H480 slnk.ini ffmpeg -f image2 -i slnk%2d.png -r 12 -vcodec wmv1 slnk-wmv1.asf
Now, try two-pass encoding.
# ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null ffmpeg -b 1000k -f image2 -i slnk%2d.png -r 12 -vcodec wmv1 -pass 1 -an -f rawvideo -y /dev/null ffmpeg -b 1000k -f image2 -i slnk%2d.png -r 12 -vcodec wmv1 -pass 2 -an slnk-1000k-2pass-wmv1.asf