[ Beneath the Waves ]

DaVinci's Shadow Build Process - Linux

article by Ben Lincoln

 

This article describes the process of assembling a build environment and compiling DaVinci's Shadow on Linux. Because there are many variations of Linux, you will need to read between the lines and modify these instructions if you are using a distribution other than openSUSE, Kubuntu/Ubuntu, or Fedora (which are the three I tested it with). If you are successful in building it on a different distribution, please let me know what steps you used. Usually it should only be a change to the command that installs dependencies via the package manager for that platform, unless you are using a very obscure distribution or building for an architecture other than Intel x86-64/i686.

In stark contrast to the Windows® build process using MinGW/MSYS (see DaVinci's Shadow Build Process - Windows), this is incredibly easy. Modern Linux is great!

Note that these instructions assume they are being followed on a system where sudo is used, and that the current user has the ability to issue sudo commands as root. If you are following them on a system without sudo, you replace the steps where it's used with a temporary su, execution of the command in question, then exit. E.g., if the command in the instructions is:

sudo make install

...you can instead issue these three commands:

su

make install

exit

You will most likely be prompted for the root password after the su.

Basic Build Environment Setup

The basic build environment will give you an end product which supports the following optional components:

The following optional components are not included in this basic build environment. Instructions for a more advanced build environment that supports them may be made available at a later date.

This process has been tested on openSUSE 11.3, Kubuntu 10.10, and Fedora 16.

  1. Use your distribution's package manager to install the following components (including the development packages, if they are separate), if they are not already installed:
     
    autoconf
    automake
    bison
    cfitsio[1]
    flex
    gcc
    gcc c++
    gcc fortran
    gcc-multilib (Kubuntu/Ubuntu only)
    giflib
    libjpeg
    libpng
    libtiff
    libtool
    m4
    make
    readline 6
    zlib
     
    Note 1: you can probably safely omit installing the GCC Fortran package, but it will mean your HDF5 build will not support that interface. Apparently, a lot of scientific software still depends on Fortran support, so to err on the side of caution these instructions enable it wherever possible.
     
    Note 2: the original version of these instructions included explicitly installing 32-bit versions of certain components (in addition to the 64-bit versions) on 64-bit systems. This shouldn't be necessary anymore, but if you run into odd problems, consider installing the 32-bit versions of gcc, gcc c++, libjpeg, libpng, and readline.
     
    Note 3: you probably won't be presented with both 64-bit and 32-bit packages on a 32-bit platform, or if your system installs both automatically (like Kubuntu). On a modern Linux distribution, you can typically perform this entire action with a single command in a terminal window/shell.
     
    On openSUSE, the command to install all of these packages is:
     
    sudo zypper install autoconf automake bison libcfitsio-devel libcfitsio0 flex gcc gcc-32bit gcc-c++ gcc-c++-32bit gcc-fortran giflib giflib-devel jpeg libjpeg8 libjpeg8-32bit libjpeg-devel libjpeg-devel-32bit libpng12-0 libpng12-0-32bit libpng12-devel libpng14-14 libpng14-14-32bit libpng14-devel libtiff3 libtiff3-32bit libtiff-devel libtiff-devel-32bit libtool m4 make libreadline6 libreadline6-32bit readline-devel zlib zlib-32bit zlib-devel zlib-devel-32bit zlib-devel-static
     
    On Kubuntu or Ubuntu, execute this command instead:
     
    sudo apt-get install autoconf automake bison build-essential libcfitsio3 libcfitsio3-dev flex gcc gfortran g++ cc-multilib libjpeg-dev libjpeg8 libjpeg8-dev libpng12-0 libpng12-dev libtiff4 libtiff4-dev libtool m4 make libreadline-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev
     
    On Fedora, the equivalent set of commands is:
     
    su
     
    [ Enter the root password if prompted. ]
     
    yum install autoconf automake bison bison-runtime bison-devel cfitsio cfitsio-devel cfitsio-static CCfits flex gcc gcc-c++ gcc-gfortran giflib giflib-devel libjpeg-turbo libjpeg-turbo-devel libjpeg-turbo-static libpng libpng-devel libpng-static libtiff libtiff-devel libtiff-static libtool m4 make ncurses-devel readline readline-devel readline-static zlib zlib-devel zlib-static
     
    exit
     
    If you have trouble locating one or more packages for your distribution, try using the search function in the GUI package manager (YaST on openSUSE, KPackageKit on Kubuntu, et cetera). Better distributions (like openSUSE and Fedora) let you search from the command-line (sudo zypper search somestring,
  2. Restart your system just to be sure the most current version of everything is running.
  3. Download the HDF5 1.8.8 Source Code (hdf5-1.8.8.tar.bz2) from the bottom of this page and place it in your home directory.
  4. Open a terminal window and execute the following commands:
     
    cd ~ [ or wherever your working directory for the downloaded archives is. ]
    tar -xjvf hdf5-1.8.8.tar.bz2
    cd hdf5-1.8.8
    ./configure --enable-fortran --enable-fortran2003 --enable-cxx --prefix=/usr [ IMPORTANT: make sure the prefix path is correct. For example, on some systems, you should use /usr/local instead. ]
    make
    make check [ note: this is optional, but recommended. ]
    sudo make install

On some distributions (like openSUSE), even though you install the cfitsio package, the DaVinci's Shadow configure process doesn't think it's there. If the Configuration Summary has a line that reads FITS: No, then follow these additional steps:

  1. Download the CFITSIO 3.29 Source Code (cfitsio3290.tar.gz) from the bottom of this page and place it in your home directory.
  2. Open a terminal window and execute the following commands:
     
    cd ~ [ or wherever your working directory for the downloaded archives is. ]
    tar -xzvf cfitsio3290.tar.gz
    mv cfitsio cfitsio3290 [ this is so you don't accidentally overwrite the 3.29 source with a future version. ]
    cd cfitsio3290
    ./configure --prefix=/usr [ IMPORTANT: make sure the prefix path is correct. For example, on some systems, you should use /usr/local instead. ]
    make
    sudo make install

You should now have a functioning build environment for DaVinci's Shadow (or the stock DaVinci). Note that some of the more esoteric (and enormous) components like ISIS are not included. Please see ASU's documentation if you need these features. Unless you actually work at NASA, you probably don't.

Building DaVinci's Shadow

You are now ready to perform the actual compile of DaVinci's Shadow.

  1. Download dshadow-2.9.2.tar.bz2 from the bottom of the DaVinci's Shadow page and place it in your home directory.
  2. Open a terminal window and execute the following commands:
     
    cd ~
    tar -xjvf dshadow-2.9.2.tar.bz2
    cd dshadow-2.9.2
    ./configure --prefix=/usr [ IMPORTANT: make sure the prefix path is correct. For example, on some systems, you should use /usr/local instead. ]
    make
    sudo make install

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.

Troubleshooting

Make sure you have all of the prerequisites installed (using your package manager) and try again. If you did something like try to build and install the prequisites yourself from source, well, have fun with that. The last time I tried that approach, I screwed up my Linux VMs so badly I had to rebuild them from scratch.

If the build succeeds, but when you try to run dshadow you receive an error regarding a shared library and the program doesn't start, make sure you followed the step about executing the command export LD_LIBRARY_PATH=.:/usr/local/lib/ before you ran the configure script for DaVinci's Shadow. After you've corrected that problem and run the configure command again, try running a make clean before you run the regular make. If that still doesn't work, try running make clean again, and this time run a make all.

Acknowledgements

These instructions are based (loosely) on ASU's Compiling DaVinci page.

This process would be much harder if not for the efforts of thousands of people who have contributed to Linux to make it incredibly easy to use, especially compared to its earlier incarnations.

 
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.
 
Download
File Size Version Release Date Author
HDF5 Source Code 5 MiB 1.8.8 2011-11-15 The HDF Group
Included here for convenience/GPL compliance. See The HDF Group's website for more information
 
Download
File Size Version Release Date Author
CFITSIO Source Code 4 MiB 3.29 2011-12-19 NASA
Included here for convenience/GPL compliance. See The FITSIO website for more information
 
Download
File Size Version Release Date Author
HDF5 Source Code 5 MiB 1.8.6 2011-02-16 The HDF Group
Included here for convenience/GPL compliance. See The HDF Group's website for more information
 
Download
File Size Version Release Date Author
CFITSIO Source Code 4 MiB 3.26 2011-01-13 NASA
Included here for convenience/GPL compliance. See The FITSIO website for more information
 
Footnotes
1. If you are attempting to build DaVinci's Shadow on a Linux distribution for which a CFITSIO package is not available, and need to compile it yourself, you should make sure your installation of GCC supports Fortran. Fortran support is not explicitly included in this list because it assumes a precompiled CFITSIO package is available.
 
[ Page Icon ]