使用conda环境在OSX上安装Galsim:fftw / tmv文件无法正确链接

时间:2016-01-23 20:14:25

标签: install openmp conda fftw galsim

我已经用conda安装了fftw和boost;

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

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

使用scons的tmv

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

具有前面指定的各种变量的scons,如下所示:

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

在config.log中查找有以下行:

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

1 个答案:

答案 0 :(得分:1)

这里最近的问题是它无法在运行时找到OpenMP库(libgomp.1.dylib)。以下是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"

我之前在Mac上遇到过与Anaconda类似的麻烦。他们似乎试图强迫Mac使用Unix风格的运行时库分辨率,而不是遵循Mac正常的方式,这是根本不同的。特别是,这个@rpath的东西在Linux / Unix系统上运行得非常好,但在Mac上并没有那么多。我想使用他们自己的conda安装的库,他们有办法使它完全正常工作,但它不能很好地与以普通Mac方式安装的外部库相互啮合。

无论如何,由于它只是TMV中的OpenMP内容,并且GalSim中的矩阵操作从来都不是时间关键,因此最简单的选择可能是使用scons install WITH_OPENMP=false安装没有OpenMP支持的TMV。

然后再次尝试安装GalSim。