Cmake 在FreeBSD 12和Debian 10上编译c2ffi有困难

Cmake 在FreeBSD 12和Debian 10上编译c2ffi有困难,cmake,common-lisp,Cmake,Common Lisp,我在FreeBSD 12和Debian 10上安装c2ffi()时遇到问题。我需要c2ffi,以便使用一些依赖于c2ffi的常见Lisp绑定 在FreeBSD12上,我安装了Clang6.0(默认)和10.0;c2ffi需要LLVM 10.0。因为CC和C++在我的FreeBSD安装中引用了CLAN 6,所以我将路径>代码> > /Ur/Prase/LLVM10/bin:$PATH < /C> >,我还设置别名来引用 CLAN< /COD>和 CLAN++。我已经安装了cmake版本3.17.

我在FreeBSD 12和Debian 10上安装c2ffi()时遇到问题。我需要c2ffi,以便使用一些依赖于c2ffi的常见Lisp绑定

在FreeBSD12上,我安装了Clang6.0(默认)和10.0;c2ffi需要LLVM 10.0。因为CC和C++在我的FreeBSD安装中引用了CLAN 6,所以我将<代码>路径>代码> <代码> > /Ur/Prase/LLVM10/bin:$PATH < /C> >,我还设置别名来引用<代码> CLAN< /COD>和<代码> CLAN++<代码>。我已经安装了cmake版本3.17.3。但是,当我进入安装c2ffi的
make
阶段时,我遇到了以下错误:

Scanning dependencies of target c2ffi
[  7%] Building CXX object CMakeFiles/c2ffi.dir/src/AST.cpp.o
[ 15%] Building CXX object CMakeFiles/c2ffi.dir/src/Decl.cpp.o
[ 23%] Building CXX object CMakeFiles/c2ffi.dir/src/Expr.cpp.o
[ 30%] Building CXX object CMakeFiles/c2ffi.dir/src/OutputDriver.cpp.o
[ 38%] Building CXX object CMakeFiles/c2ffi.dir/src/Template.cpp.o
[ 46%] Building CXX object CMakeFiles/c2ffi.dir/src/Type.cpp.o
[ 53%] Building CXX object CMakeFiles/c2ffi.dir/src/c2ffi.cpp.o
[ 61%] Building CXX object CMakeFiles/c2ffi.dir/src/drivers/JSON.cpp.o
/home/michael/c2ffi/src/drivers/JSON.cpp:36:26: warning: passing an object that
      undergoes default argument promotion to 'va_start' has undefined behavior
      [-Wvarargs]
            va_start(ap, close);
                         ^
/home/michael/c2ffi/src/drivers/JSON.cpp:32:61: note: parameter of type 'bool'
      is declared here
        void write_object(const char *type, bool open, bool close, ...) {
                                                            ^
1 warning generated.
[ 69%] Building CXX object CMakeFiles/c2ffi.dir/src/drivers/Null.cpp.o
[ 76%] Building CXX object CMakeFiles/c2ffi.dir/src/drivers/Sexp.cpp.o
[ 84%] Building CXX object CMakeFiles/c2ffi.dir/src/init.cpp.o
[ 92%] Building CXX object CMakeFiles/c2ffi.dir/src/options.cpp.o
[100%] Linking CXX executable bin/c2ffi
/usr/bin/ld: error: unable to find library -lclang-cpp
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[2]: stopped in /usr/home/michael/c2ffi/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/michael/c2ffi/build
*** Error code 1

Stop.
make: stopped in /usr/home/michael/c2ffi/build
文件
libclang cpp.so
存在于我的
/usr/local/llvm10/lib
目录中,但cmake没有检测到它。我尝试了各种其他方法,包括设置
LD_LIBRARY_路径
CMAKE_LIBRARY_路径
环境变量,但没有效果;我收到了与上面相同的错误消息

我放弃了在FreeBSD上安装c2ffi,并尝试将其安装在新安装的Debian 10上,其中包含LLVM 10.0和cmake 3.18.1。然而,当我在Debian上运行
make
时,我得到了以下错误消息:

[  7%] Building CXX object CMakeFiles/c2ffi.dir/src/AST.cpp.o
/home/michael/c2ffi/src/AST.cpp:24:10: fatal error: 'clang/AST/ASTConsumer.h' file not found
#include <clang/AST/ASTConsumer.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/c2ffi.dir/build.make:82: CMakeFiles/c2ffi.dir/src/AST.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/c2ffi.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
[7%]构建CXX对象CMakeFiles/c2ffi.dir/src/AST.cpp.o
/home/michael/c2ffi/src/AST.cpp:24:10:致命错误:“未找到clang/AST/astcummer.h”文件
#包括
^~~~~~~~~~~~~~~~~~~~~~~~~
生成1个错误。
make[2]:***[CMakeFiles/c2ffi.dir/build.make:82:CMakeFiles/c2ffi.dir/src/AST.cpp.o]错误1
make[1]:***[CMakeFiles/Makefile2:123:CMakeFiles/c2ffi.dir/all]错误2
make:**[Makefile:149:all]错误2

我想知道如何在我的FreeBSD和Debian系统上构建c2ffi?

该项目的
CMakeLists.txt
已损坏,因此bug会向上游蔓延。实际上,已经提交了许多请求:


您可以尝试这些方法,或者将它们组合到一个工作解决方案中。

项目的
CMakeLists.txt
已损坏,因此错误会向上。实际上,已经提交了许多请求:


您可以尝试这些,或者将它们组合成一个工作解决方案。

在我的FreeBSD安装中,在CMakeLists.txt中,我替换了该行

target_link_libraries(c2ffi PUBLIC clang-cpp LLVM)


在我的Debian安装中,我没有安装任何libclang开发包。安装该软件包后,我可以毫无问题地运行
make

在我的FreeBSD安装中,在CMakeLists.txt中,我替换了该行

target_link_libraries(c2ffi PUBLIC clang-cpp LLVM)

在我的Debian安装中,我没有安装任何libclang开发包。安装该软件包后,我可以毫无问题地运行
make