【问题标题】:Python_LIBRARY in CMake NotFoundCMake NotFound 中的 Python_LIBRARY
【发布时间】:2021-12-29 01:50:32
【问题描述】:

我正在尝试构建开源软件 LMGC90 (https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/-/wikis/compilation),但在尝试使用命令 >cmake 时遇到了问题。详情如下:

CMake 错误:此项目中使用了以下变量,但是 它们被设置为 NOTFOUND。请设置它们或确保它们已设置 并在 CMake 文件中正确测试:PYTHON_LIBRARY

linked by target "ann_manh" in directory /home/tphan/lmgc90_user_2021.rc1/src/contribs/ann-1.1.2/wrap
linked by target "ann_eucl" in directory /home/tphan/lmgc90_user_2021.rc1/src/contribs/ann-1.1.2/wrap
linked by target "lmgc90" in directory /home/tphan/lmgc90_user_2021.rc1/src/ChiPy

完整的错误信息是:

tphan@tphan-XPS-15-9570:~/lmgc90_user_2021.rc1/build$ cmake .. -DPYTHON_EXECUTABLE=/usr/bin/python3
-- You try to build LMGC90_dev
fatal: not a git repository (or any of the parent directories): .git
-- Building  git branch
-- A library with LAPACK API found.
-- Found Python executable: /usr/bin/python3.8
-- Found Python library: PYTHON_LIBRARY-NOTFOUND
-- Python version is : 3.8.10
-- Python include dir is : /usr/include/python3.8
-- Cython not found... deactivate rTree Python binding
-- Matlib Library used  : /home/tphan/lmgc90_user_2021.rc1/build/lib/libmatlib.so
-- Sparse linear algebra include path found: /home/tphan/lmgc90_user_2021.rc1/build/include
-- Sparse linear algebra libraries found: /home/tphan/lmgc90_user_2021.rc1/build/lib/libdmumps.so
-- Sparse linear algebra binding found: /home/tphan/lmgc90_user_2021.rc1/src/contribs/Mumps_SparseLinearAlgebra.f90
-- matlib library : /home/tphan/lmgc90_user_2021.rc1/build/lib/libmatlib.so
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_LIBRARY
    linked by target "ann_manh" in directory /home/tphan/lmgc90_user_2021.rc1/src/contribs/ann-1.1.2/wrap
    linked by target "ann_eucl" in directory /home/tphan/lmgc90_user_2021.rc1/src/contribs/ann-1.1.2/wrap
    linked by target "lmgc90" in directory /home/tphan/lmgc90_user_2021.rc1/src/ChiPy

-- Configuring incomplete, errors occurred!
See also "/home/tphan/lmgc90_user_2021.rc1/build/CMakeFiles/CMakeOutput.log".
See also "/home/tphan/lmgc90_user_2021.rc1/build/CMakeFiles/CMakeError.log".```


Do you know how I can fix this?

【问题讨论】:

    标签: python cmake


    【解决方案1】:

    您必须将 Python 库的路径指定为:

    cmake .. -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-16
      • 1970-01-01
      • 2022-10-05
      • 2017-03-05
      • 2020-12-24
      • 2023-03-04
      相关资源
      最近更新 更多