gpt4 book ai didi

找不到路径中的 CMake 编译器

转载 作者:行者123 更新时间:2023-12-01 16:41:49 25 4
gpt4 key购买 nike

我正在尝试使用 cmake 编译程序,但出现以下错误:

CMake Error at /.../3dg.cmake:8 (enable_language):
The CMAKE_CXX_COMPILER:

CC

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
CMakeLists.txt:8 (include)

CMake Error at /.../3dg.cmake:8 (enable_language): The CMAKE_C_COMPILER:

cc

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

我在我的 cmake 文件中设置了这两个变量:

set(CMAKE_C_COMPILER cc)
set(CMAKE_CXX_COMPILER CC)

此外,我可以确认它们都在我的路径中并且位于正确的位置。

>>which cc
/opt/cray/pe/craype/2.5.14/bin/cc
>>which CC
/opt/cray/pe/craype/2.5.14/bin/CC

我的路径包括这个目录!

>>echo $PATH
/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/bin:/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/sbin:/opt/cray/job/2.2.3-6.0.7.0_44.1__g6c4e934.ari/bin:/opt/cray/pe/hdf5/1.10.0.3/bin:/opt/cray/pe/craype/2.5.14/bin:/opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/usr/common/software/metis/5.1.0/bin:/usr/common/software/darshan/3.1.4/bin:/usr/common/software/altd/2.0/bin:/usr/common/software/bin:/usr/common/mss/bin:/usr/common/nsg/bin:/opt/cray/pe/mpt/7.7.0/gni/bin:/opt/ovis/bin:/opt/ovis/sbin:/usr/syscom/nsg/sbin:/usr/syscom/nsg/bin:/opt/cray/pe/modules/3.2.10.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/cray/pe/bin:

cmake 文件看到的路径与终端相同。我已经确认,如果我将我的 cmake 代码更改为:

set(CMAKE_C_COMPILER /opt/cray/pe/craype/2.5.14/bin/cc)
set(CMAKE_CXX_COMPILER /opt/cray/pe/craype/2.5.14/bin/CC)

但这不是长期修复,因为 cc/CC 的实际位置取决于我使用的模块和编译器的更新版本。

有谁知道发生了什么,以及如何强制 cmake 识别这些编译器位于正确的位置?谢谢。

最佳答案

转到 download glfw 的页面并下载他们的 source package .现在解压并进入目录。

现在使用 sudo cmake -G "Unix Makefiles" 生成 make 文件。现在执行 sudo makesudo cmake。安装过程应该完成。有关更多信息,请查看 here

关于找不到路径中的 CMake 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53017019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com