HowTo:Install multiple versions of POV-Ray
the following shows how to install several POV-Ray versions (and or branches/forks) to allow easy concurrent use of.
the "intended audience" are Linux and (Free)BSD users, assuming a Bourne Again SHell and the usual GNU tools.
if this will be the first install of POV-Ray on the machine, I recommend first installing a packaged version, to ensure all required libraries are at hand; note that Debian etc users also need the *-dev bits, to get the headers.
the following then outlines one "solution" to this problem which works for me;
its advantage is that I can have separate 'povray.{conf,ini}' configuration files for every program.
other approaches exist, of course :-).
you will need to be the 'root' user to make a couple of preparations, thereafter everything is done as you, your user.
first, and not perhaps required, I use an "administrative" group to own the directory and installed programs; 'adm', 'wheel', 'staff', 'operator', every Linux distribution provides one or more of those. add your user to one, in the examples below I'll use "admin" ('adm').
next create the directory which will contain all of the POV-Ray installations, so make sure there's sufficient (disk) space for "the future". you could, of course, simply make it a mount-point. change the permissions and owner to yourself, with a suitable group:
# mkdir /home/povray # chown you:adm /home/povray # chmod g+w /home/povray
with the directory in place, we can install the first POV-Ray, I will use the 'beta.2' as the example.
the following "official" place has the archives:
<https://github.com/POV-Ray/povray/tags>.
create a directory for it, and a 'priv' ("private") directory within, ie
$ mkdir -p /home/povray/v3.8.0-beta.2/priv/ $ chown -R you:adm /home/povray/v3.8.0-beta.2
I use this private space to store the downloaded archive, and later the build script and log, and a simple "one-liner" script for access.
building has been documented elsewhere, see eg installing POV-Ray, I show here only the key steps from my "usual" build-script.
in an ideal world you'd write a basic build script to automate part or all of the procedure. this script can then be copied and used, with little modification, for every subsequent installation of a POV-Ray.
also recommended is the use of the 'script(1)' program, as it provides a record of all the information which "scrolled by" etc. if you are not using a build script, record the session manually but don't forget to 'exit' from the sub-shell it starts.
and another "also recommended" :-). I usually will do a
$ ./configure --no-create --help > confighelp
beforehand, to see which options are available, and to have to hand as reference; sometimes the 'INSTALL' file documentation is incomplete.
I use the '/tmp' directory for "transient" stuff, the building, as it usually is mounted in RAM (tmpfs).
- important -- if this is not the first installation of a v3.8, you will need to protect your existing
~/.povray/3.8/povray.*files, make them readonly. then the install will rename the existing files to*.bakbefore writing its own (and you get a chance to recover :-)).
$ cd /tmp $ script build-log $ tar -xf /home/povray/v3.8.0-beta.2/priv/povunix-v3.8.0-beta.2-src.tar.gz $ chown -R you:adm povunix-v3.8.0-beta.2-src $ chmod -R u+w,go+r-w,a-s povunix-v3.8.0-beta.2-src $ cd povunix-v3.8.0-beta.2-src $ CXXFLAGS="-std=c++11 -march=native -mtune=native -ffast-math -O2 -fPIC" \ > ./configure \ > --prefix=/home/povray/v3.8.0-beta.2 \ > --sysconfdir=/home/povray/v3.8.0-beta.2/etc \ > --mandir=/home/povray/v3.8.0-beta.2/man \ > --without-libmkl \ > --without-libsdl \ > --with-x \ > COMPILED_BY="you@home" $ make -j8 $ make check $ make install $ exit $ mv /tmp/build-log /home/povray/v3.8.0-beta.2/priv/
re the configuration, for the build flags (CXXFLAGS) I prefer -O2 over more "aggressive" optimisation.
I would also have added --docdir=..., but that is ignored, apparently.
the 'doc' directory (if wished, and as shown below) needs to be moved manually from 'share/doc'.
you should, at this point have the same beta.2 directory as below. as you can see, the '/home/povray/*/' layouts mirror that of '/usr/local/'.
$ ls /home/povray/{v3.7.0.8,v3.8.0-beta.2}/
/home/povray/v3.7.0.8/:
bin/ doc/ etc/ man/ priv/ share/
/home/povray/v3.8.0-beta.2/:
bin/ doc/ etc/ man/ priv/ share/
adding the v3.7 could be your next "project" :-).
edit the '/home/povray/v3.8.0-beta.2/etc/povray/3.8/povray.*' files to suit, as well as the "personal" ones, ie '~/.povray/3.8/*'.
the last thing to do is to create a BASH function to run the program.
you could store this and other functions in ~/.bash_functions, the "proper" place.
I prefer "one-liner" shell scripts which I source when needed the first time.
$ cat /home/povray/v3.8.0-beta.2/priv/fnbeta2-sh
fnbeta2 () {
POVINI=/home/povray/v3.8.0-beta.2/etc/povray/3.8/povray.ini \
/home/povray/v3.8.0-beta.2/bin/povray $@
}
similarly, for the v3.7.0.8 there is a 'fn3708' function, stored in '/home/povray/v3.7.0.8/priv/fn3708-sh'.
to use, simply:
$ source /home/povray/v3.8.0-beta.2/priv/fnbeta2-sh $ fnbeta2 myscene.pov ...
--
enjoy, jr.