使用anaconda在OSX上安装GalSim

时间:2014-01-06 12:35:00

标签: galsim

我正在尝试使用anaconda python发行版在OSX Mavericks上安装GalSim,但一直遇到错误:

Unable to build a python loadable module using the python executable:
/usr/bin/env python,
the library name libpython2.7.a,
and the libdir /Users/harrison/anaconda/lib/python2.7/config.
If these are not the correct library names, you can tell scons the
correct names to use with the flags EXTRA_LIB_PATH and/or EXTRA_LIBS.
/ usr / bin / env python是anaconda,在libdir中确实有一个libpython2.7.a。

scons通过conda包管理系统安装。 按照建议通过

手动安装boost
./bootstrap.sh --with-python=/Users/harrison/anaconda/bin/python --with-python-root=/Users/harrison/anaconda/
./b2 -a link=shared
sudo ./b2 -a --prefix=/usr/local link=shared install

检查python boost链接的版本给出

$ otool -L /usr/local/lib/libboost_python.dylib
  /usr/local/lib/libboost_python.dylib:
  libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0)
  libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
  /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

这是否正确(对我来说似乎不是这样 - 提升似乎链接到/ usr / local /中的libpython2.7),这是导致安装GalSim的问题吗?

由于

伊恩

完整输出:

$ scons
scons: Reading SConscript files ...
SCons is version 2.3.0 using python version 2.7.6
Python is from /Users/harrison/anaconda/include/python2.7
Using the following (non-default) scons options:
   CXX = g++
These can be edited directly in the file gs_scons.conf.
Type scons -h for a full list of available options.
Using python =  /usr/bin/env python
Using default PYPREFIX =  /Users/harrison/anaconda/lib/python2.7/site-packages
Using compiler: /usr/bin/g++
compiler version: 4.2.1
Determined that a good number of jobs = 4
Checking for C++ header file fftw3.h... yes
Checking for correct FFTW linkage... yes
Checking for C++ header file boost/shared_ptr.hpp... yes
Checking for C++ header file TMV.h... yes
Using TMV_LINK file: /usr/local/share/tmv/tmv-link
     -L/usr/local/Cellar/tmv-cpp/0.71/lib -ltmv -lblas
Mac version is  10.9
WARNING: The Apple BLAS library has been found not to be thread safe on
         Mac OS version 10.7 (and possibly higher), even across multiple
         processes (i.e. not just multiple threads in the same process).
         The symptom is that `scons tests` will hang when running nosetests
         using multiple processes.
         If this occurs, the solution is to compile TMV either with a
         different BLAS library (e.g. ATLAS) or with no BLAS library at
         all (using WITH_BLAS=false).
Checking for correct TMV linkage... (this may take a little while)
Checking for correct TMV linkage... yes
Checking if we can build against Python...
Unable to build a python loadable module using the python executable:
/usr/bin/env python,
the library name libpython2.7.a,
and the libdir /Users/harrison/anaconda/lib/python2.7/config.
If these are not the correct library names, you can tell scons the
correct names to use with the flags EXTRA_LIB_PATH and/or EXTRA_LIBS.

Please fix the above error(s) and rerun scons.
Note: you may want to look through the file INSTALL.md for advice.
Also, if you are having trouble, please check the INSTALL FAQ at
   https://github.com/GalSim-developers/GalSim/wiki/Installation%20FAQ

2 个答案:

答案 0 :(得分:0)

伊恩,谢谢发帖。基于config.log和我自己的经验,我有一个应该至少解决这个问题的答案(不能保证你不会在构建的后期点击别的东西)。

这里的关键问题是,如果你告诉它编译器是gcc(默认情况下),它会尝试使用openMP。但实际上在Mavericks上调用gcc会给你clang ++,openMP不起作用。所以,你必须明确告诉galsim编译器是clang ++所以它不会尝试使用openMP。 (关于这一点的线索在config.log,在x86_64架构的各个地方都有关于未定义符号的消息......当我开始使用Mavericks时,我在自己的系统上遇到了这个问题。参见{{ 3}})

所以,请scons CXX=clang++,这个问题应该消失。但是,我不能保证你以后不会遇到助推问题。

答案 1 :(得分:0)

另请参阅this question,其中有两条建议可能有助于您解决问题。