本文介绍了如何在freebsd上启用GMP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我按如下所示安装了swi-prolog:
I installed swi-prolog as below:
$./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 .
I am using FreeBSD and swi-prolog is stable release http://www.swi-prolog.org/download/stable/src/pl-6.2.6.tar.gz .
任何建议都值得赞赏!
推荐答案
通过设置CFLAGS和LDFLAGS进行修复:
It is fixed by set CFLAGS and 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)
致谢!
这篇关于如何在freebsd上启用GMP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!