Home > Software > DaVinci's Shadow Build Process - BSD
DaVinci's Shadow Build Process - BSD
Unlike the other articles on compiling DaVinci's Shadow, this one isn't exactly a list of steps that should end up with you having a working build of the software. I was able to make it work on one specific BSD system (a VM running PC-BSD 8.2), but based on my experience, I suspect the steps necessary to do so will not carry over exactly to other BSD systems. But, hey, if you are a BSD user, you're probably accustomed to having to do things the hard way. :p
Please note that even though Mac OS X is based on BSD, that doesn't mean these instructions will work on Mac OS. They might, but again, the process will probably not match these steps exactly. This is especially true if you are using an older Mac system that has a non-Intel processor.
Prerequisites
These are the steps I used to install all of the necessary prerequisites for building DaVinci's Shadow.
The first handful of steps, where Perl is upgraded, were necessary because otherwise I couldn't upgrade libtool.
The section where zlib is manually built and installed were necessary because there doesn't seem to be a standard BSD package for zlib. Oddly, before I did this, both libtiff 3.9.5 and libpng 1.2.46 would both building thinking zlib was installed, but attempting to use zlib-related functionality would cause a segfault.
libglut is included because one of the libraries uses OpenGL functionality for some reason.
Please note that although this series of steps looks fairly concise and straightforward, it does not include the many days of woe, misery and dead-ends I experienced before I actually got everything to work. If I hadn't been running BSD in a VM (which I could snapshot along the way, and revert to previous snapshots if something went wrong), it is very likely that I would not have bothered to finish the process. If you have to deviate from this process at all, then, uh, good luck.
su
portsdb -Ffu
pkgdb -Ff
env DISABLE_CONFLICTS=1 portupgrade -o lang/perl5.12 -f perl-5.10.\*
cd /usr/ports/devel/libtool/ && make install clean
cd /usr/ports/graphics/libglut/ && make install clean
cd /usr/ports/astro/cfitsio/ && make install clean
cd /usr/ports/graphics/giflib/ && make install clean
cd /usr/ports/devel/readline/ && make install clean
cd /usr/ports/science/hdf5-18/ && make install clean
exit
cd ~
tar -xjvf ds291prereq.tar.bz2
cd ds291prereq
tar -xzvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
su
make install
exit
cd ~
DaVinci's Shadow Build Process
Assuming all of that went well (this is a big assumption), you should be able to build DaVinci's Shadow itself using the standard process:
tar -xjvf dshadow-2.9.2.tar.bz2
cd dshadow-2.9.2
./configure
make
su
make install
exit
One of the many surprising quirks I ran across getting everything working on BSD was that if I added virtually any flags to the call to configure, odd results would occur. Therefore, I do not recommend attempting this unless you are highly experienced with this sort of thing.
Another of those quirks was that for some reason, when I build libtiff 3.9.5 under BSD, it doesn't include support for JPEG compression. This is whether I install the "turbo" JPEG library from /usr/ports or build jpeg-8c from scratch out of the DaVinci's Shadow prerequisites package. I can't imagine this will impact very many people, because if you wanted JPEG compression you'd save the files as JPEGs (which works fine). But on the off chance that it causes someone a problem, I'll mention it here. There may be a way to build libtiff with support for JPEG compression under BSD, but it's not important enough to me to figure out how.
IMPORTANT: if you use a prefix other that /usr in your calls to configure, you will need to update the library_linux.dvrc file in library/ underneath the build directory as well as the shared location that it is installed to. For example, if you use a prefix of /usr/local, the second location of the file to edit will be /usr/local/share/dshadow/library/library_linux.dvrc. The lines to edit are the ones in which DV_MOD_PATH, DV_HELP, DV_HOME, and DV_GDAL_PATH are defined.
Additional Notes on BSD
During some of the many, many attempts I made to build DaVinci's Shadow on BSD, I had to use a few additional workarounds to get the build to succeed. I don't think any of these were used in the end, but in case anyone runs into similar issues, here are a few of the more memorable ones:
Problems With the First Line of the configure.ac Script When Running autoconf
In the end, I believe I avoided using autoconf (explicitly, at least), altogether. But when I tried to use it at one point, it errored out on the first line of the configure.ac script. That line looks like this:
AC_INIT(dshadow, m4_esyscmd([grep 'DShadow Version #' version.h | sed -e 's/\(.*\)#\(.*\)";/\2/' | tr -d '\n']), [Use_the_Contact_form_on_the_website@beneaththewaves.net])
This is a fancy way of calling AC_INIT with three parameters - the name of the package, the version number, and an email address to contact to report bugs. IIRC, the BSD version of autoconf didn't like having a third parameter, and also didn't seem to like the method used for dynamically obtaining the version number. So I replaced it with this (I wasn't sure if it would accept a three-part version number):
AC_INIT(dshadow, 2.9)
Errors Related to OpenGL Code When Running autoconf on the libtiff 3.9.5 Package in the iomedley Subdirectory
Apparently autoconf on BSD doesn't like the scripts for this software. Even after installing libglut, I believe I ran into some issues I couldn't get around. As far as I know, libtiff will build just fine without OpenGL, but the configure script doesn't include a flag to turn it off. So after I had autoconf generate the script, I just manually edited the result to force the script to behave as if it hadn't detected the OpenGL libraries. Unfortunately, I forgot to make a note of the specific changes.
The best thing to do is just avoid running autoconf against this package on BSD, unless you know a lot more about it than I do.
Disabling the "Optional" X11 Support in the Main configure Script Prevents Enabling HDF5 and CFITSIO
I never found a workaround for this one. I was trying to disable X11 support because I thought it was interfering with something, and every time I did, it turned off HDF5 and CFITSIO too, even though if X11 is legitimately not found by the script, those other two packages can still be enabled. Don't try to explicitly disable X11 support on BSD, I guess?
Download | ||||
File | Size | Version | Release Date | Author |
DaVinci's Shadow (Source Code) | 41 MiB | 2.9.2 | 2012-01-15 | Numerous |
This is the complete source code package for DaVinci's Shadow 2.9.2. If you are compiling DaVinci's Shadow, this is probably the file you want. |
Download | ||||
File | Size | Version | Release Date | Author |
DaVinci's Shadow Build Prerequisites | 111 MiB | 2.9.1 | 2012-01-14 | Numerous |
This package includes everything needed to create the cross-compile environment so someone can build DaVinci's Shadow on Linux for Windows®. If you're following the directions for compiling DaVinci's Shadow for any other platform, you won't be using all of the contents of this file. |