【发布时间】:2016-11-05 09:47:57
【问题描述】:
所以我正在尝试使用 LLVM 构建一个玩具编译器,并且我想使用 CMake 作为我的构建系统。我尝试使用 LLVM 网站上的sample CMakeLists.txt,但在运行cmake 时遇到以下错误:
CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:178 (include):
include could not find load file:
/usr/share/llvm/cmake/LLVMExports.cmake
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:181 (include):
include could not find load file:
/usr/share/llvm/cmake/LLVM-Config.cmake
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
当我去调查问题时,我发现我系统上的路径实际上是/usr/share/llvm-3.8/。当我尝试按照预期将路径更改为 /usr/share/llvm/ 时,我收到另一个错误:
CMake Error at /usr/share/llvm/cmake/LLVMExports.cmake:1034 (message):
The imported target "LLVMSupport" references the file
"/usr/lib/libLLVMSupport.a"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/share/llvm/cmake/LLVMExports.cmake"
but not all the files it references.
对于 CMake 的工作原理,我并不是真正的专家,所以我不确定从这里可以去哪里。我正在运行 Ubuntu 16.04,我尝试通过各种不同的软件包安装 LLVM,结果相同。这是 Ubuntu 的打包系统的问题,还是我可以解决的问题?
【问题讨论】:
-
当
/usr/share/llvm-3.8下的文件想要在/usr/share/llvm/下包含一个(没有版本后缀)时,在我看来,该文件以某种方式损坏了 99%。请注意,用于find_package()的文件大多是不可重定位的。您安装了哪些exact llvm 软件包?哪个包包含/usr/share/llvm-3.8/cmake/LLVMConfig.cmake和/usr/share/llvm/cmake/LLVMExports.cmake文件? -
我通过 Ubuntu 的包管理器安装了 llvm-3.8,这就是为什么我觉得它只是用错误的链接打包
-
您是否检查过
.cmake文件是否包含相同的软件包? -
打包在 /usr/share/llvm-3.8/ 中的 .cmake 文件似乎引用了 /usr/share/llvm 中的文件