gpt4 book ai didi

linux - 在 linux build/temp.linux-x86_64-3.6/_clips.c 上安装 clipspy :523:19: fatal error: clips. h : No such file or directory #include

转载 作者:太空宇宙 更新时间:2023-11-04 09:12:14 25 4
gpt4 key购买 nike

有人可以提供有关如何在 linux 环境中安装 clips 和 clipspy 的分步过程。 pip install clipspy 对我不起作用,因为我的组织不允许使用 pip。我需要从源代码构建。

我尝试从 clipspy-0.3.0 安装 python setup.py install 但编译终止。

gcc -pthread -B /anaconda3/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes /clips_core_source_630/core/ -fPIC -Ic -Itmpclips_core_source_630core -I/anaconda3/include/python3.6m -c build/temp.linux-x86_64-3.6/_clips.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_clips.o
build/temp.linux-x86_64-3.6/_clips.c:523:19: fatal error: clips.h: No such file or directory
#include <clips.h>
^
compilation terminated.

我知道我必须安装 clips_6.30 但 src 代码中有很多 make 文件

clips_core_source_630/makefiles> ls

makefile.g++ makefile.gcc makefile.lib makefile.lib++ makefile.win

我没有 c/c++ 技术经验,无法理解 clips_core_source_630 中存在的各种 makefile。

最佳答案

可以看看clipspy travis installation引用示例的脚本。

提取 CLIPS 存档后,您可以复制源文件夹中的 makefile.lib 文件。

然后您需要稍微修改 Makefile 以将 CLIPS 构建为共享库。为此,请将 -fPIC 标志添加到 gcc 编译命令。这将生成几个适合包含在库中的 .o 文件。

使用make 命令构建源代码。然后,您可以将目标文件链接在一起以生成库文件。

ld -G *.o -o libclips.so

完成后,您可以构建并安装 clipspy,确保您拥有最新的 cffisetuptools Python 模块。

python setup.py build_ext --include-dirs <clips_dir>/core/ --library-dirs <clips_dir>/core/
python setup.py install

关于linux - 在 linux build/temp.linux-x86_64-3.6/_clips.c 上安装 clipspy :523:19: fatal error: clips. h : No such file or directory #include <clips. h>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53928786/

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