0

The problem I am having is installing NTL with GMP on my mac (Sierra).

These are the steps I have taken following this tutorial

1) I downloaded Unix: ntl-10.3.0.tar.gz

2) double clicked file to create the ntl-10.3.0.tar.gz folder in my downloads

3)

cd ~/Downloads/ntl-10.3.0/src
./configure
make

This gives me an error, because I guess I didn’t have GMP installed yet:

gen_gmp_aux.cpp:26:10: fatal error: 'gmp.h' file not found
#include <gmp.h>

4) There are instructions on this page that describe how to install GMP

5) I download gmp-6.1.2.tar.lz from here. (Not that it matters but notice the extension is different in the instructions … I’m mentioning everything just in case)

6) I find out that .lz extensions need the lzip command:

7)

brew install lzip
cd ~/Downloads
lzip -d gmp-6.1.2.tar.lz 
tar -xf gmp-6.1.2.tar
cd gmp-6.1.2

8)

Note: Reading the instructions, I don’t configure with —prefix=$HOME/sw because I want it installed in the /usr/local directory, not my home directory

./configure
make
make check

No errors come up, every thing is green and says ‘passed’

9)

make install

10)

Back to NTL

cd ~/Downloads/ntl-10.3.0/src/
make

I get the same error as before:

gen_gmp_aux.cpp:26:10: fatal error: 'gmp.h' file not found
#include <gmp.h>

11)

I look in my directory

ls -la /usr/local/include/

and found gmp.h there where it should be

12)

I create a simple .cpp file to test it (basically just main with the associated include)

g++ someFile.cpp -lgmp

with this at the top

#include <gmp.h> 

and it doesn’t seem to find it, same fatal error message.

Other people seem to have run into this issue also (all I could find was years ago) one of the guys did this:

brew uninstall gmp
brew install gmp

Following suit, I also did, then tried making the NTL again and it still doesn’t work…

I know I can put a flag in to not use GMP in the build:

You can also supply the option --disable-shared to the configure script, if you only want static libraries. However, if you ultimately want to build NTL as a shared library, then you must also buld GMP as a shared library.

but I would really like to.

What am I doing wrong? any suggestions?

I thought about sending a bug report, but I don't think it's a bug, it's with my configuration.

Community
  • 1
  • 1
brw59
  • 502
  • 4
  • 19
  • 10 days later with zero ideas for a solution, I figure this is a good time to take it directly to GMP. I very thoroughly filled out all of the things they requested on the link I provided above, and they responded by letting me know I sent it to the wrong group of people in their company (ok, I understand), then putting me on a spam list so I couldn't send it to the place they instructed, which was also the email that they replied from, different than the one I originally sent it to ... um ... was there something else I supposed to do? that was rude of GMP, Don't look for a solution there! – brw59 Mar 16 '17 at 21:46

1 Answers1

0

Maybe the problem with installing NTL can be solved by editing the file.txt in /src directory. You may try to replace @{GMP_XXX} with an appropriate directory (e.g. /usr/local/, /usr/local/include/, /usr/local/lib/) in following strings:

GMP_PREFIX=@{GMP_PREFIX}

GMP_INCDIR=@{GMP_INCDIR}
\#directory containing gmp.h if using GMP 

GMP_LIBDIR=@{GMP_LIBDIR}
\#directory containing libgmp.a if using GMP 

Moreover, this tutorial could be quite useful.

David Berry
  • 40,941
  • 12
  • 84
  • 95
  • I do appreciate the post ... I hard coded the directory paths, I also tried following instructions on the link you provided, but unfortunately the error he was getting is different than my own, so it didn't solve my problem ... I do not understand why when I hard code the path to the gmp.h file that it does not recognize the #include ... so many hours spent on this, and there ought to be a very simple solution – brw59 May 16 '17 at 02:32