How to build GalSim with Anaconda on OS X 10.9
Install anaconda under the default ~/anaconda/.
We are trying to fix the problem described here, which you have if your anaconda python library is not listed with an absolute path by this command:
otool -L ~/anaconda/lib/libpython2.7.dylib
Patch your anaconda python library following solution #2, e.g.:
sudo install_name_tool -id /Users/david/anaconda/lib/libpython2.7.dylib /Users/david/anaconda/lib/libpython2.7.dylib
Rebuild your boost python library (if necessary) to use the patched python library:
./bootstrap.sh ./b2 --clean --with-python ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" link=shared headers --with-python ./b2 -a toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" link=shared --with-python sudo ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" link=shared --prefix=/usr/local install --with-python
Install TMV using clang++:
sudo scons install CXX=clang++ PREFIX=/usr/local
Clean up the previous GalSim, including cached config results (so that pyfits gets replaced with astropy.io.fits):
cd .../GalSim rm -rf .scon* scons --clean
Build GalSim, telling it to use clang and anaconda and where to find user-installed libs and headers:
scons PYTHON=/Users/david/anaconda/bin/python CXX=clang++ EXTRA_INCLUDE_PATH=/usr/local/include EXTRA_LIB_PATH=/usr/local/lib PREFIX=/usr/local sudo scons install
A successful build does not guarantee that you have fixed the problem, but if you can import galsim without errors then you should be ok.