CMake错误:此项目中使用以下变量,但它们设置为NOTFOUND。 PYTHON_LIBRARIES(高级)

时间:2016-01-15 03:16:46

标签: python cmake

我正在尝试安装此软件http://www.openstructure.org/docs/1.4/install/,我收到此错误:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PYTHON_LIBRARIES (ADVANCED)
    linked by target "_ost_conop" in directory /opt/ost/modules/conop/pymod
    linked by target "_ost_gfx" in directory /opt/ost/modules/gfx/pymod
    linked by target "_ost_img" in directory /opt/ost/modules/img/base/pymod
    linked by target "_ost_img_alg" in directory /opt/ost/modules/img/alg/pymod
    linked by target "ost_gui" in directory /opt/ost/modules/gui/src
    linked by target "_ost_gui" in directory /opt/ost/modules/gui/pymod
    linked by target "_ost_io" in directory /opt/ost/modules/io/pymod
    linked by target "_ost_info" in directory /opt/ost/modules/info/pymod
    linked by target "_ost_seq" in directory /opt/ost/modules/seq/base/pymod
    linked by target "_ost_seq_alg" in directory /opt/ost/modules/seq/alg/pymod
    linked by target "_ost_mol" in directory /opt/ost/modules/mol/base/pymod
    linked by target "_ost_mol_alg" in directory /opt/ost/modules/mol/alg/pymod
    linked by target "_ost_geom" in directory /opt/ost/modules/geom/pymod
    linked by target "_ost_base" in directory /opt/ost/modules/base/pymod

-- Configuring incomplete, errors occurred!
See also "/opt/ost/CMakeFiles/CMakeOutput.log".
See also "/opt/ost/CMakeFiles/CMakeError.log".

我猜我必须将PYTHON_LIBRARIES的路径传递给cmake,但我不知道是什么。我安装了正确的python和所有其他依赖项。

1 个答案:

答案 0 :(得分:2)

首先,我接受了这个建议https://askubuntu.com/questions/479260/cmake-can-not-find-pythonlibs并从源代码安装了最新的cmake(3.4.1)。这没有解决问题,我得到了同样的错误。但是我确实使用cmake 3.4来解决它,但不确定它是否有所作为。

我必须运行cmake,明确显示同一个线程中建议的PYTHON_LIBRARIES。

cmake . -DPYTHON_LIBRARIES=/usr/lib/python2.7/config/libpython2.7.so

使用

并不够简单
export PYTHON_LIBRARIES=/usr/lib/python2.7/config/libpython2.7.so

然后cmake .