Tar*_*ula 6 c++ makefile cmake llvm
问题:当从Ubuntu存储库安装LLVM 2.8时,Ubuntu 10.10不提供LLVM CMake模块(/usr/share/llvm)或(/usr/local/share/llvm).
所以我现在正在使用CMake编译LLVM 2.8,然后像这样安装它:
cmake ..
make
make install
Run Code Online (Sandbox Code Playgroud)
这将安装我需要将LLVM链接到我的库中的CMake模块.问题是当我使用CMake编译LLVM时,只编译静态库.我在LLVM文档中看到,您可以使用此参数将共享库编译到CMake中:
cmake -DBUILD_SHARED_LIBS=true ..
Run Code Online (Sandbox Code Playgroud)
但现在,CMake返回此错误:
-- Target triple: i686-pc-linux-gnu
-- Native target architecture is X86
-- Threads enabled.
-- Building with -fPIC
-- Targeting Alpha
-- Targeting ARM
-- Targeting Blackfin
-- Targeting CBackend
-- Targeting CellSPU
-- Targeting CppBackend
-- Targeting Mips
-- Targeting MBlaze
-- Targeting MSP430
-- Targeting PIC16
-- Targeting PowerPC
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting X86
-- Targeting XCore
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"LLVMARMCodeGen" of type SHARED_LIBRARY
depends on "LLVMARMAsmPrinter"
"LLVMARMAsmPrinter" of type SHARED_LIBRARY
depends on "LLVMARMCodeGen"
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
-- Build files have been written to: /llvm-2.8/build
Run Code Online (Sandbox Code Playgroud)
我无法将其编译为共享库,有谁知道如何解决这个问题?我需要共享库,因为它们是许多其他工具的依赖项.
1)来自Ubuntu存储库的LLVM 2.8安装LLVM共享库,但不安装我需要的CMake模块.
2)另一方面,如果我自己编译LLVM,它会安装我需要的CMake模块,但我只能在将LLVM编译为静态库时才这样做.
经过大量的调查(google、source 和 llvmdev 邮件列表),我发现这个问题实际上是 2.8 版本的问题,在该版本中使用 CMake 编译共享库被破坏。我现在正在将我的库移植到 2.9rc1 版本,该版本运行良好并且已经计划很快发布,感谢所有答案。
| 归档时间: |
|
| 查看次数: |
9480 次 |
| 最近记录: |