installation - 如何在 freebsd 上启用 GMP?

标签 installation swi-prolog

我安装了 swi-prolog 如下:

$./configure --prefix=/home/***/swi-prolog/ --enable-gmp
$gmake && gmake check && gmake install

however, it still reports no GMP syupport:

?- random(33).
Warning: This version of SWI-Prolog is not compiled with GMP support.
Warning: Floating point random operations are not supported.
ERROR: is/2: Arithmetic: `random_float/0' is not a functionenter code here

$find /usr/local/lib -name "libgmp*"                                  
/usr/local/lib/libgmp.so.10
/usr/local/lib/libgmp.so
/usr/local/lib/libgmp.la
/usr/local/lib/libgmpxx.so.6
/usr/local/lib/libgmpxx.so
/usr/local/lib/libgmpxx.la
/usr/local/lib/libgmp.a
/usr/local/lib/libgmpxx.a

我正在使用 FreeBSD 并且 swi-prolog 是稳定版本 http://www.swi-prolog.org/download/stable/src/pl-6.2.6.tar.gz .

感谢任何建议!

最佳答案

它由设置 CFLAGS 和 LDFLAGS 固定:

$echo $LDFLAGS                                       
-L/usr/local/lib
$echo $CFLAGS                                       
-I/usr/local/include
$./configure --prefix=/home/sw2wolf/swi-prolog/ --enable-gmp
$gmake && gmake install

$ldd ~/swi-prolog/lib/swipl-6.3.8/bin/i386-freebsd9.0/swipl                                                                                 
**libgmp.so.10** => /usr/local/lib/libgmp.so.10 (0x2815b000)
libexecinfo.so.1 => /usr/local/lib/libexecinfo.so.1 (0x281b9000)
librt.so.1 => /usr/lib/librt.so.1 (0x281c4000)
libreadline.so.6 => /usr/local/lib/libreadline.so.6 (0x281ca000)
libncursesw.so.5.9 => /usr/local/lib/libncursesw.so.5.9 (0x281ff000)
libm.so.5 => /lib/libm.so.5 (0x28229000)
libthr.so.3 => /lib/libthr.so.3 (0x28243000)
libc.so.7 => /lib/libc.so.7 (0x28264000)
libncurses.so.8 => /lib/libncurses.so.8 (0x28383000)
libtinfow.so.5.9 => /usr/local/lib/libtinfow.so.5.9 (0x283c3000)

问候!

关于installation - 如何在 freebsd 上启用 GMP?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14299421/

相关文章:

c# - 证书安装安全警告解决方法?

java - IzPack 安装程序,找不到元素“安装”的声明

prolog - 理解clpfd中label/5的实现

prolog - 在Prolog DCG中,如何去除超通解?

arrays - 在 prolog 中断言和使用快速、大型数组

prolog - 如何在 Prolog 中以数字形式获取当前系统年份

java - 在桌面上运行 Java 程序

wix - 使用 WiX/Burn 安装后启动应用程序

windows - 安装程序 Oracle 11g windows 64 位不起作用

list - 如何避免 SWI-Prolog 中的 "out of global stack"错误?