Question

I spent the whole day setting up GCC as per

http://cygwin.wikia.com/wiki/How_to_install_GCC_4.3.0

On the gcc make step, it told me it needed a c++ compiler to continue for whatever reason, So I updated Cygwin in the usual fashion and got gcc-c++.

After that, cgywin did me the courtesy of deleting the 3 prereq libraries that I had installed previously,

So I went about remaking them. GMP worked fine, and then I got to MPFR. For whatever reason MPFR is throwing this error:

configure: error: libgmp not found or uses a different ABI.

The resources mention this error here.

I’m pretty sure its finding GMP alright as cygcheck shows it up no problem, and the config even mentions it finds it.

When I try:

./configure --with-gmp-build=/gmp/,

it throws:

error: header files gmp-impl.h and longlong.h not found

So far I have not been able to get MPFR working, despite googling and trying for hours.

MPC also fails to find GMP in the usual manner.

I've also tried just handing the libraries to GCC in a subdirectory and letting it compile them.

When I try that, it gets to the make step, then throws a stage1-bubble error and fails. No description of the error or anything.

I have no idea what else to try.

Was it helpful?

Solution

I know this post is a bit dated, but I was looking for an answer or results to a similar situation but with much more current versions of the same libraries. While reading this post as for some suggestions as well as other online material I was able to piece everything together. So for anyone who may be working with the newest releases here it goes:


First you will probably want to configure, make and install GMP first for both C and C++ as static libs; also make note of the architecture x86 or x64. Once you run make, make check, make install; and you are confidant that you have no errors, then when you go to configure MPFR you will want to run it as such:

./configure --with-gmp-build=/path/to/gmp --enable-static --disable-shared

and if the paths are set properly this should give you the needed generated make file.


I'm brand new to Unix-Posix environments and commands and new to Cygwin. I've mostly used Windows platforms and very few Macs or Apples. Matter of fact I've only been working at this for a little less than a week as I'm trying to do the same thing. So now I'm venturing into a whole new world of Unix... but it's sort of simulated through Cygwin as I'm still running windows.

I'm trying to build GMP, MPIR, MPFR & MPFRC++ all from the latest original distributions and eventually will try to integrate them into Visual Studio 2017.

I had actually found this post because I was able to build MPIR through visual studio with the help of python and vyasm, but as for GMP I needed Cygwin with GCC. It took me a little while to figure out how to get GMP to build properly but once I did and ran the tests I was able to have all pass with 0 failures. I then started to work with MPFR the same as you.

My similar issue was after I ran ./configure as default, it was giving me the message that the libgmp wasn't found. Also if I tried to call make, it would do nothing as the make file didn't exist. This led me back to doing google searches... While searching for tips, suggestions etc. I came across this Q/A. While I was reading this Q/A, the install files, some other FAQ and even another website, I was kind of able to piece everything together and what I have found that works is what I suggested above.

Not only do you need to set the flag --with-gmp-build but you also need to set the appropriate library types that gmp was built as and you need to make sure that the architecture types match too. They need to have the same matching ABIs.


Ah, just as I was about to finish up typing this answer, make check just finished running through Cygwin and I have a result of:

Testsuite summary for MPFR 4.0.1
============================================================================
# TOTAL: 180
# PASS:  180
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

I hope this helps you out. The only thing is for myself; I'll have to go back and probably run all of this again from the beginning including GMP only because I believe I only did GCC and not G++ and my next step is to try and build MPFRC++.

Then I might try to do some related libraries from here afterwards. My first phase is to try to build them all through Cygwin and GCC/G++. The next step will be to try and port them over to Visual Studio 2017.

OTHER TIPS

After compiling and installing gmp, I had the same problem building mpfr until I set correctly the library search path:

export LD_LIBRARY_PATH=/usr/local/lib
export LIBRARY_PATH=/usr/local/lib
export CPATH=/usr/local/include

as it is explained in the http://cygwin.wikia.com/wiki/How_to_install_GCC_4.3.0

Instead of this:

./configure --with-gmp-build=/gmp/

USE THIS:

./configure --with-gmp-build=/gmp

It doesn't like having the "/" at the end.

You might want to use --with-gmp-lib=/path/to/gmp/lib/dir

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top