Building GalSim with the LSST stack - GalSim-developers/GalSim GitHub Wiki

Follow the instructions for building from source here. See also here. Then, after the normal stack installation is complete, you can get (e.g.) the version 1.2 release of GalSim with

eups distrib install GalSim 1.2

They tend to follow a bit behind our release schedule, so they may or may not have the latest release.

If you want to install a development version of GalSim, you can do the above to get all the dependencies. Also, the LSST stack has fixed the python library problem that Chris describes below. However, the boost python library is still messed up. So you will still ned to manually fix the stack-supplied boost following the step marked *** below.

cd $LSST_PGKS/boost/1.55.0.1.lsst2/lib
install_name_tool -id $PWD/libboost_python.dylib libboost_python.dylib

Then you should be able to install a development version of GalSim with

scons TMV_DIR=$LSST_PKGS/tmv/0.72/ 
      FFTW_DIR=$LSST_PKGS/fftw/3.3.3/
      BOOST_DIR=$LSST_PKGS/boost/1.55.0.1.lsst2/
      EXTRA_LIB_PATH=$LSST_PKGS/miniconda2/3.19.0.lsst4/lib

(all on one line -- just broken up here for legibility) The final version numbers for each directory might be different for your system. Use the version that is installed on your machine.

After this is installed, you will need to tell eups to use this version of GalSim rather than the one that was installed with the stack:

eups declare -r /Users/Mike/GalSim GalSim $USER
eups declare -r /Users/Mike/GalSim GalSim $USER -t $USER
setup GalSim -t $USER

Finally, to use the galsim.lsst module, you'll also need to run the following:

eups distrib install obs_lsstSim -t sims
setup obs_lsstSim -t sims

========

Obsolete Notes

Notes from Chris Walter for building Galsim for LSST members using anaconda 2.1 and the Winter 2014 DM stack. These fixes are no longer necessary with the current version of the LSST stack, but they are provided here for posterity in case people run into similar problems with their own anaconda and/or boost installations.

The stack+anaconda should contain all dependencies except for TMV which you will need to build yourself.

Useful references related to problems with GalSim and boost and boost generally:

http://stackoverflow.com/questions/23771608/trouble-installing-galsim-on-osx-with-anaconda https://svn.boost.org/trac/boost/ticket/9141

Procedure

Make sure that you have setup the DM stack and:

setup boost
setup scons
setup fftw

Install TMV (>= 0.72 from http://code.google.com/p/tmv-cpp/). For example:

scons install PREFIX=/Users/walter/LSST/GalSim/tmv-0.72

Go to your anaconda library directory. For example:

cd LSST/anaconda/lib/

Look at the python library from anaconda:

otool -L libpython2.7.dylib

You will see the first entry (libpython2.7.dylib) has no full path this is going to cause the loader to grab the system version instead and mess things up. You need to fix this:

install_name_tool -id  $PWD/libpython2.7.dylib libpython2.7.dylib

Now if you do the otool -L libpython2.7.dylib the first entry should have the full path.

*** Now make the same change to the stack supplied boost library. Go to your stack boost library directory:

cd $BOOST_DIR/lib
install_name_tool -id $PWD/libboost_python.dylib libboost_python.dylib

There is one more change you need to make. You need to tell the stack's boost which system python to use. It is also currently entered without a path.

An example:

install_name_tool -change libpython2.7.dylib /Users/walter/LSST/anaconda/lib/libpython2.7.dylib libboost_python.dylib

Download GalSim (from https://github.com/GalSim-developers/GalSim/releases)

Now build Galsim. For example:

scons TMV_DIR=/Users/walter/LSST/GalSim/tmv-0.72 FFTW_DIR=$FFTW_DIR