installing Galsim on OSX with conda environment: fftw/tmv file failed to link correctly

187 views Asked by At

I have installed fftw and boost with conda;

conda install -c https://conda.anaconda.org/anaconda boost

conda install -c https://conda.anaconda.org/nlesc fftw

tmv with scons

tmv0.72){58}> scons install PREFIX=/home/rgm/local

the scons with the various variables specified earlier as shown below:

scons 
scons: Reading SConscript files ...
SCons is version 2.3.5 using python version 2.7.10
Python is from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
Using the following (non-default) scons options:
PREFIX = /home/rgm/local/
TMV_DIR = /Users/rgm/local
FFTW_DIR = /Users/rgm/anaconda/
BOOST_DIR = /Users/rgm/anaconda/
These can be edited directly in the file gs_scons.conf.
Type scons -h for a full list of available options.
Using python =  /home/rgm/anaconda/bin/python
Using default PYPREFIX =  /home/rgm/anaconda/lib/python2.7/site-packages
Using compiler: /home/rgm/anaconda/bin/g++
compiler version: 4.8.5
Determined that a good number of jobs = 4
Checking for C++ header file fftw3.h... yes
Checking for correct FFTW linkage... yes
Checking for boost header files... yes
Boost version is 1.57.0
Checking for C++ header file TMV.h... yes
TMV version is 0.72
Using TMV_LINK file: /Users/rgm/local/share/tmv/tmv-link
 -L/home/rgm/local/lib -ltmv -lblas -lpthread -fopenmp
Mac version is 10.10.5
XCode version is 7.2
Checking for correct TMV linkage... (this may take a little while)
Checking for correct TMV linkage...
Error: TMV file failed to link correctly
Check that the correct location is specified for TMV_DIR

looking in config.log there are lines like:

Undefined symbols for architecture x86_64:
  "_fftw_destroy_plan", referenced from:
  _main in conftest_2.o
1

There are 1 answers

1
Mike Jarvis On

The proximate problem here is that it cannot find the OpenMP library (libgomp.1.dylib) at runtime. Here are the relevant lines from the config.log:

g++ -o .sconf_temp/conftest_16 -fopenmp .sconf_temp/conftest_16.o -Llib -L/Users/rgm/anaconda/lib -L/Users/rgm/local/lib -L/home/rgm/local/lib -ltmv_symband -lfftw3 -lpthread -ltmv -lblas -lpthread
.sconf_temp/conftest_16 > .sconf_temp/conftest_16.out
dyld: Library not loaded: @rpath/./libgomp.1.dylib
  Referenced from: /data/vault/rgm/soft/MACOS/GalSim/.sconf_temp/conftest_16
  Reason: image not found
sh: line 1: 20592 Trace/BPT trap: 5       .sconf_temp/conftest_16 > ".sconf_temp/conftest_16.out"

I've had similar troubles with Anaconda before on Macs. They seem to try to force the Mac to use Unix-style run-time library resolution, rather than follow the normal way Macs do it, which is fundamentally different. In particular, this @rpath thing works really nicely on Linux/Unix systems, but not so much on Macs. I guess with their own conda-installed libraries, they have a way to make it all work correctly , but it doesn't mesh very well with outside libraries that are installed in the normal Mac way.

Anyway, since it's just the OpenMP stuff in TMV, and the matrix operations in GalSim are never time critical, your easiest option is probably to install TMV without OpenMP support using scons install WITH_OPENMP=false.

Then try installing GalSim again.