【问题标题】:Unable to get python include path python executable for GalSim无法为 GalSim 获取 python 包含路径 python 可执行文件
【发布时间】:2015-07-21 23:32:10
【问题描述】:

我正在尝试通过运行 SCons 在 Ubuntu 14.04 上安装(更新)本地版本的 GalSim 软件。我已经安装了所有依赖项(boost、TMV 等)并且已经使用了很长时间。我使用 Python2.7。但是现在,当我从终端运行scons 时,出现以下错误:

scons: Reading SConscript files ...
SCons is version 2.3.0 using python version 2.7.6
Python is from /usr/include/python
Using the following (non-default) scons options:
PYPREFIX = /usr/lib/python2.7/dist-packages/
TMV_DIR = /media/arunkannawadi/Acads_CMU/Cosmology/WFIRST_Project/tmv0.72/
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/python
Using compiler: /usr/bin/g++
compiler version: 4.8.2
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.54.0
Checking for C++ header file TMV.h... yes
TMV version is 0.72
Using TMV_LINK file: /media/arunkannawadi/Acads_CMU/Cosmology   /WFIRST_Project/tmv0.72/share/tmv-link
-ltmv -lblas -lgfortran -lpthread -fopenmp
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 get python include path python executable: 
/usr/bin/python

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

which python 的输出为/usr/bin/python,python --version 的输出为Python 2.7.6。

【问题讨论】:

    标签: ubuntu-14.04 galsim


    【解决方案1】:

    经过进一步调查,这个问题与 GalSim 本身无关,而是指出了后来 Ubuntu 版本的一个奇怪之处。

    检查失败安装的 config.log 文件(此处未发布)后,很明显安装测试通过了,但解析这些测试的输出时失败。错误消息是

    sh: 1: 语法错误:错误的 fd 编号

    搜索向我指出了有关该错误消息的另一个问题: sh: Syntax error: Bad fd number 这指出在 Ubuntu 11.x 中 /bin/sh 链接到 /bin/dash 而不是 bin bash。因此,对于 GalSim 安装这个明显问题的解决方法是使用该页面上的解决方案将 /bin/sh 正确链接到 bash。

    【讨论】:

    • 显然问题在于我们使用>& 将stderr 重定向到stdout。虽然这是普遍的做法,但它显然不符合 posix 标准。 bash 允许的东西更适合来自 csh 的人,这是正确的语法。参看。 ubuntuforums.org/showthread.php?t=1460684 和 unix.stackexchange.com/questions/118303/… 适用于 dash 和 bash 的符合 posix 标准的东西显然是 cmd > file 2>&1
    • 谢谢!这解决了问题!
    • 更新:我在 master 上修复了这个问题,所以下一个版本的 GalSim 在非 bash shell 上应该不会有这个问题。具体来说,当 /bin/sh 真的破折号时,我重现了您的失败,并且更新解决了问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 2015-07-20
    • 1970-01-01
    • 2014-06-26
    相关资源
    最近更新 更多