1

I am trying to compile CVC4 from source on FreeBSD, but I'm running into a hiccup at configuration time - GMP cannot be found, even though the shared object is clearly in a common path:

$> ls /usr/local/lib | grep gmp
libgmp.a
libgmp.la
libgmp.so
libgmp.so.10
libgmp.so.10.1.3
libgmpxx.a
libgmpxx.la
libgmpxx.so
libgmpxx.so.4
libgmpxx.so.4.3.3

$> echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin: \
/usr/local/bin:/root/bin:/usr/local/lib

...and here is the output of ./configure:

...
checking how to hardcode library paths into programs... immediate
checking for __gmpz_init in -lgmp... no
configure: error: GNU MP (libgmp) not found, see http://gmplib.org/

After that, I did a bit of googling and found an article describing an ABI error that I thought could be related. I then compiled GMP from source, but still with no luck being found from the configure script.

What might be causing this error? Any creative ideas or help would be much appreciated. Thank you!

Athan Clark
  • 3,886
  • 2
  • 21
  • 39
  • 2
    PATH is irrelevant. How about looking at config.log to see how exactly that test failed? Also, is your freebsd configured to look for libraries in /usr/local/lib at runtime? Was GMP installed by yourself or by freebsd's package manager? – Marc Glisse Sep 10 '14 at 06:33
  • Try "./configure LDFLAGS='-L/usr/local/lib/' ". If that works, then Marc is likely right and either "/usr/local/lib/" or libgmp.a is not being properly found by ld. If that wasn't it, you should probably give your full "./configure" command and "builds/config.log" file. (The config.log file may also be in a directory like "builds/x86_64-unknown-linux-gnu/debug/config.log" i.e. architecture and configuration name). You may also email cvc-bugs@cs.nyu.edu and I or another CVC4 developer can ask more in-depth questions. – Tim Sep 10 '14 at 20:50
  • You guys are my heroes. Anyway, manually adding /usr/local/lib did not work, so here are my [configure](https://github.com/athanclark/freebsd-cvc4/blob/master/configure) and [config.log](https://github.com/athanclark/freebsd-cvc4/blob/master/config.log) files. Thank you so much, you guys are life savers. The configure file is almost a megabyte, so I really suggest you just clone the repo at `https://github.com/athanclark/freebsd-cvc4`. Thank you!!! – Athan Clark Sep 11 '14 at 02:56
  • 1
    `configure:16729: checking for __gmpz_init in -lgmp [...] yes` that's not the same error... Now you are missing gmpxx, which you can likely get somehow through freebsd, or by compiling GMP yourself with --enable-cxx passed to configure. – Marc Glisse Sep 11 '14 at 11:11

1 Answers1

0

While cvc4 isn't in the FreeBSD ports tree, cvc3 is. Looking at that port's Makefile, you need to call configure with some arguments. I would suggest you try that with cvc4 as well.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94