【问题标题】:CMake Error: The following variables are used in this project, but they are set to NOTFOUND. PYTHON_LIBRARIES (ADVANCED)CMake 错误:此项目中使用了以下变量,但它们设置为 NOTFOUND。 PYTHON_LIBRARIES(高级)
【发布时间】:2016-01-15 03:16:45
【问题描述】:

我正在尝试安装此软件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 和所有其他依赖项。

【问题讨论】:

  • 您与我们共享的链接有一个明确的示例,其中 PYTHON_LIBRARIES 设置为 homebrew 安装 Python 的路径。你有没有遵循这个?您是否从 homebrew 安装了所有依赖项?
  • 在那个页面上没有这样的例子,那就是 PYTHON_ROOT。另外我不是在 Mac 上,而是在 Ubuntu 14.04 上。
  • 为什么投反对票?这是一个问题,也是该问题的答案。

标签: python cmake


【解决方案1】:

首先我接受了这个建议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 .。

【讨论】:

  • 我告诉过你将 PYTHON_LIBRARIES 传递给 CMake。导出变量使其成为 CMake 不评估的环境变量。也许你不得不删除你的缓存;这可以通过返回 CMake 3.4 来触发。如果 CMake 3.4.1 现在可以运行,您介意再试一次吗?否则可能是 CMake 错误。
猜你喜欢
  • 2012-05-29
  • 1970-01-01
  • 1970-01-01
  • 2018-03-16
  • 2023-02-10
  • 1970-01-01
相关资源
最近更新 更多