Project

General

Profile

Issue #398

configure: error: GNU Multiprecision Library GMP not found

Added by Bruno Jagic almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
configuration
Affected version:
5.1.0
Resolution:
Fixed

Description

Hello,

I have problems with StrongSwan installation. I downloaded gmp-5.1.2, installed it (using ./configure, make and make install). After that I tried to installed StrongSwan (v. 5.1.0) but when I type ./configure --enable-kernel-pfkey --enable-kernel-pfroute --disable-kernel-netlink --disable-tools --disable-scripts --with-group=wheel I get error from the title (configure: error: GNU Multiprecision Library GMP not found). I don't know why it does not work, but it did work a few days ago. The only thing I've been doing is: downloading perl, m4, automake, autoconf and autogen.sh. Also, I am working on FreeBSD.

I am trying to fix this for a few days now, I deleted all of the files I downloaded, rebuilt kernel, downloaded new GMP....Have no idea what else to do. Please..

Thank you,

Bruno

History

#1 Updated by Tobias Brunner almost 5 years ago

  • Description updated (diff)
  • Status changed from New to Feedback
  • Assignee set to Tobias Brunner
  • Priority changed from Urgent to Normal

As written on the FreeBSD wiki page it's recommended to use the security/strongswan port.

If you need a different release and want to build strongSwan from sources you should at least install the external dependencies from the port collection or as binary package. So instead of compiling libgmp from sources you should install the math/gmp port instead.

Still, installing libgmp as port or from sources most likely installs them in the same location (/usr/local). That is, strongSwan's configure script should be able to find it either way.

If that isn't the case, which I can't reproduce on FreeBSD 8.x or 9.x, you could try the --with-lib-prefix=/path/to/libgmp/prefix strongSwan configure option (the prefix is whatever was used when libgmp was built, for instance, /usr/local).

#2 Updated by Bruno Jagic almost 5 years ago

Hi,

problem is solved! :) I just deleted strongswan installation, unziped it again, configured certificates and configured installation.

Now it works, so problem was probably in content of configuration file because there installation was stopped. Thank you for your help and your time.

Bruno

#3 Updated by Tobias Brunner almost 5 years ago

  • Category set to configuration
  • Status changed from Feedback to Closed
  • Resolution set to Fixed

#4 Updated by c b over 4 years ago

hi.. I'm not sure why this topic is limited to FreeBSD. Every time I create a new Ubuntu 12 LTS instance on Amazon, I come up with this issue. I don't remember how I solved it last but I think it had to do with finding the file and downloading it.

Since I need to use the latest version, no distribution-managed strongSWAN instances is OK.
The StrongSWAN dev installation instructions page does not help with this, can they be updated?

I am following the instructions, with no extra stuff. Of course one thing the instructions do not mention, is that you also need to run:
apt-get install gcc

http://wiki.strongswan.org/projects/strongswan/wiki/InstallationDocumentation

Adding note that I'm running 64bit Ubuntu, if that helps.

#5 Updated by c b over 4 years ago

Just for reference, THIS seems to be the list of commands that are needed to build StrongSWAN on a new Ubuntu instance:

     http://wiki.strongswan.org/projects/strongswan/wiki/InstallationDocumentation

     Required dependencies:
     apt-get -y install gcc    # installs the C++ compiler.
     apt-get -y install make   # installs the make program to build code.
     apt-get -y install m4     # 

     mkdir gmp_src
     pushd gmp_src
     wget ftp://ftp.gmplib.org/pub/gmp-5.1.3/gmp-5.1.3.tar.lz
     apt-get -y install lzip
     lzip --decompress *.lz
     tar xf *.tar
     pushd gmp-5.1.3
     ./configure               # this checks for dependencies and other things.
                               # Pay attention to error output that shows up at the end of ./configure.
     make                      # build. If errors, try running 2nd time. I've seen this happen.
     make check                # some other extra check.
     make install              # installs the library.
     popd; popd

     mkdir strongswan_src
     pushd strongswan_src
     wget http://download.strongswan.org/strongswan-x.x.x.tar.bz2
     tar xjf *.bz2             # j option allows to work with BZip2 files.
     pushd strongswan-5.1.0
     ./configure --prefix=/usr --sysconfdir=/etc
     make                      # build.
     make install              # installs everything.
     popd; popd

#6 Updated by Tobias Brunner over 4 years ago

There is no need to build GMP from sources. What you have to do is installing the dev packages of any dependencies, only those include the header files required by the respective plugins. So for GMP that would be libgmp3-dev on Debian/Ubuntu.

That a C compiler and make are required kind of goes without saying when building from sources.

#7 Updated by c b over 4 years ago

Thanks for the libgmp3-dev tip. It worked from a fresh Ubuntu instance. Would it be too much trouble to add such a vital and hard to find tidbit on the installation page? Just that 1 line referencing that package to install would have saved me bunch of time. From random posts on the internet, I'm not the only one.

     http://wiki.strongswan.org/projects/strongswan/wiki/InstallationDocumentation

     Required dependencies:
     apt-get -y install gcc
     apt-get -y install make
     apt-get -y install libgmp3-dev

     wget http://download.strongswan.org/strongswan-x.x.x.tar.bz2
     tar xjf *.bz2             # j option allows to work with BZip2 files.

     ./configure --prefix=/usr --sysconfdir=/etc
     make                      # build.
     make install              # installs everything.

#8 Updated by Tobias Brunner over 4 years ago

I added a note on InstallationDocumentation about the possible requirement for header files/development packages of third-party libraries. Since that depends on the enabled plugins there is no definite list of required packages.

#9 Updated by c b over 4 years ago

Thanks, but this is running the build WITHOUT any options. I ran exactly what I posted.
On a fresh Ubuntu image from Amazon. I imagine it's a very high percentage of hits. And based on the note, how in the world would one find that it is the libgmp3-dev package that needs to be installed?

#10 Updated by Tobias Brunner over 4 years ago

Thanks, but this is running the build WITHOUT any options. I ran exactly what I posted.

Sure, but running without any options still enables a whole bunch of default plugins (all those that have a --disable option listed on Autoconf rather than an --enable option). I added another note about that on InstallationDocumentation.

And based on the note, how in the world would one find that it is the libgmp3-dev package that needs to be installed?

Well, the Autoconf page mentions that the gmp plugin requires libgmp so the corresponding -dev package is required. Which can be found with e.g. apt-cache search libgmp. There is actually a package called libgmp-dev since Ubuntu 12.04 (the one mentioned above seems to be a transition package), so it is even easier to find. If the package is not installed you'll get

checking for main in -lgmp... no
configure: error: GNU Multi Precision library gmp not found

which the note addresses in its last sentence. The error might be a bit unclear here as it occurs when ./configure tries to link with -lgmp and not when it specifically searches for gmp.h, and it happens even if the libgmp10 package is already installed. The problem is that the libgmp10 package only comes with a versioned libgmp.so.10.* file, the symlink libgmp.so required to compile with -lgmp is only provided by the libgmp-dev package (this might be the case for other third-party library packages on Debian/Ubuntu too).

Listing the packages and instructions you mentioned above on the generic installation page does not seem appropriate as for one thing they are Debian/Ubuntu specific and for another thing they depend on the enabled/disabled plugins. But feel free to add a subpage to InstallationDocumentation that explains how to build strongSwan with the default plugins on a fresh Debian/Ubuntu machine.

Also available in: Atom PDF