Configuration problem: not recognizing MPFR

View: New views
12 Messages — Rating Filter:   Alert me  

Configuration problem: not recognizing MPFR

by Damian Rouson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am attempting to configure gcc-4.5-20090507 on Mac OS 10.4 using the command
----------
$ ../gcc-4.5-20090507/configure --with-languages=c,c++,fortran
--with-mpfr=/usr/local/lib --with-gmp=/usr/local/lib
----------
issued from inside a directory at the same level in the directory tree
as the source directory.  The configure output includes the following:
----------
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
----------

My MPFR version is 2.4.1 and when I run "make check" inside the
mpfr-2.4.1 directory, I get the response
-----------
All 148 tests passed
----------

Inside /usr/local/lib, I have the files

$ls libmpfr.*
libmpfr.1.dylib libmpfr.a       libmpfr.dylib   libmpfr.la

Can someone advice me as to how to get gcc to recognize my mpfr libraries?

Damian

Re: Configuration problem: not recognizing MPFR

by Kai Ruottu-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damian Rouson wrote:

> I am attempting to configure gcc-4.5-20090507 on Mac OS 10.4 using the command
> ----------
> $ ../gcc-4.5-20090507/configure --with-languages=c,c++,fortran
> --with-mpfr=/usr/local/lib --with-gmp=/usr/local/lib
> ----------
> issued from inside a directory at the same level in the directory tree
> as the source directory.  The configure output includes the following:
> ----------
> checking for correct version of gmp.h... yes
> checking for correct version of mpfr.h... no

It checks the header version, not the library version !

> configure: error: Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
> ----------
>
> My MPFR version is 2.4.1 and when I run "make check" inside the
> mpfr-2.4.1 directory, I get the response
> -----------
> All 148 tests passed
> ----------

Have you installed this ?  Where the 'mpfr.h' went?

> Inside /usr/local/lib, I have the files
>
> $ls libmpfr.*
> libmpfr.1.dylib libmpfr.a       libmpfr.dylib   libmpfr.la

Where is the 'mpfr.h' giving the error message?

> Can someone advice me as to how to get gcc to recognize my mpfr libraries?

Again, the question wasn't about the mpfr library but about the mpfr
header!  Some older 'mpfr.h' header probably found earlier...


Re: Configuration problem: not recognizing MPFR

by Damian Rouson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks.  Apparently the mpfr.h header file is in /usr/local/include.
How do I point gcc to this location?  I've tried each of the following
flags on the configure command:

--with-mpfr=/usr/local
--with-mpfr=/usr/local/include
--with-mpfr=/usr/local/lib
--with-mpfr=<path-to-mpfr-source>/mpfr-2.4.1

I get the same error with each of these.

Damian


On Fri, May 15, 2009 at 3:20 AM, Kai Ruottu <kai.ruottu@...> wrote:

> Damian Rouson wrote:
>
>> I am attempting to configure gcc-4.5-20090507 on Mac OS 10.4 using the
>> command
>> ----------
>> $ ../gcc-4.5-20090507/configure --with-languages=c,c++,fortran
>> --with-mpfr=/usr/local/lib --with-gmp=/usr/local/lib
>> ----------
>> issued from inside a directory at the same level in the directory tree
>> as the source directory.  The configure output includes the following:
>> ----------
>> checking for correct version of gmp.h... yes
>> checking for correct version of mpfr.h... no
>
> It checks the header version, not the library version !
>
>> configure: error: Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
>> ----------
>>
>> My MPFR version is 2.4.1 and when I run "make check" inside the
>> mpfr-2.4.1 directory, I get the response
>> -----------
>> All 148 tests passed
>> ----------
>
> Have you installed this ?  Where the 'mpfr.h' went?
>
>> Inside /usr/local/lib, I have the files
>>
>> $ls libmpfr.*
>> libmpfr.1.dylib libmpfr.a       libmpfr.dylib   libmpfr.la
>
> Where is the 'mpfr.h' giving the error message?
>
>> Can someone advice me as to how to get gcc to recognize my mpfr libraries?
>
> Again, the question wasn't about the mpfr library but about the mpfr
> header!  Some older 'mpfr.h' header probably found earlier...
>
>

Parent Message unknown Re: Configuration problem: not recognizing MPFR

by Kai Ruottu-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damian Rouson wrote:

 > Thanks.  Apparently the mpfr.h header file is in /usr/local/include.
 > How do I point gcc to this location?  I've tried each of the following
 > flags on the configure command:
 >
 > --with-mpfr=/usr/local

By the :

http://gcc.gnu.org/install/configure.html

this should be the right one, to point to where the 'include' and 'lib'
with the gmp and mpfr headers and libraries are... I haven't ever tried
or required these options, after installation they should be found
automatically, ie the installed GCC trying to compile the new sources
should find them...

At least the '/usr/local/include' should be searched before the
'/usr/include' in every GCC, this being the LOCAL_INCLUDE_DIR.

But the GCC_INCLUDE_DIR may become before this and in it being
some old "fixed" 'mpfr.h':(  The :

   $prefix/lib/gcc/$target/$gcc-version/include-fixed

is the current install place for the fixed headers, the :

   $prefix/lib/gcc/$target/$gcc-version/include

being the old combined place for GCC's own and fixed target headers. The
GCC in Fedora8 searches the LOCAL_INCLUDE_DIR earlier, it's 'cpp -v'
gives :

----- clip -----
gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
  /usr/libexec/gcc/i386-redhat-linux/4.1.2/cc1 -E -quiet -v - -mtune=generic
#include "..." search starts here:
#include <...> search starts here:
  /usr/local/include
  /usr/lib/gcc/i386-redhat-linux/4.1.2/include
  /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/include
  /usr/include
End of search list.
^C
----- clip -----

but all kind of local/custom orders may exist, it isn't any rocket
science to tinker with the 'gcc/cppdefault.*' files... Whether MacOS
has some "custom" GCC with a tinkered search order, for that I have no
clue. In any case the options in 'configure' should cause the pointed
'<value>/include' being searched before the built-in ones...

Of course you should use the same value for the 'gmp' too... It is weird
that its right header was found despite of the wrong value in configure.



Re: Configuration problem: not recognizing MPFR

by Ian Lance Taylor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damian Rouson <damian@...> writes:

> Thanks.  Apparently the mpfr.h header file is in /usr/local/include.
> How do I point gcc to this location?  I've tried each of the following
> flags on the configure command:
>
> --with-mpfr=/usr/local
> --with-mpfr=/usr/local/include
> --with-mpfr=/usr/local/lib
> --with-mpfr=<path-to-mpfr-source>/mpfr-2.4.1
>
> I get the same error with each of these.

--with-mfpr-include=/usr/local/include
--with-mpfr-lib=/where/libmpfr/lives

Ian

Re: Configuration problem: not recognizing MPFR

by Damian Rouson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I get the same error with that approach.  I can't figure out how it
could find the wrong mpfr.h when I'm pointing it to the directory that
contains the file (and I know the file there is the right version
since I just installed it).

Damian

On Fri, May 15, 2009 at 7:41 AM, Ian Lance Taylor <iant@...> wrote:

> Damian Rouson <damian@...> writes:
>
>> Thanks.  Apparently the mpfr.h header file is in /usr/local/include.
>> How do I point gcc to this location?  I've tried each of the following
>> flags on the configure command:
>>
>> --with-mpfr=/usr/local
>> --with-mpfr=/usr/local/include
>> --with-mpfr=/usr/local/lib
>> --with-mpfr=<path-to-mpfr-source>/mpfr-2.4.1
>>
>> I get the same error with each of these.
>
> --with-mfpr-include=/usr/local/include
> --with-mpfr-lib=/where/libmpfr/lives
>
> Ian
>

Re: Configuration problem: not recognizing MPFR

by Tim Prince-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damian Rouson wrote:
> I get the same error with that approach.  I can't figure out how it
> could find the wrong mpfr.h when I'm pointing it to the directory that
> contains the file (and I know the file there is the right version
> since I just installed it).
>
>  
As a last resort, you could install mpfr in /usr so as to over-write the
obsolete version.

Re: Configuration problem: not recognizing MPFR

by Damian Rouson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks. Before I try this, I'm going to try Mac Ports, which was just
suggested to me.  I think it offers a 4.5.0 prerelease beta from
4/2/2009, which is actually a tad older than I need, but at least it
will handle all the dependencies and therefore hopefully set
everything up so that when I build manually in the future, things will
be ok.

Damian

On Fri, May 15, 2009 at 9:47 AM, Tim Prince <TimothyPrince@...> wrote:

> Damian Rouson wrote:
>>
>> I get the same error with that approach.  I can't figure out how it
>> could find the wrong mpfr.h when I'm pointing it to the directory that
>> contains the file (and I know the file there is the right version
>> since I just installed it).
>>
>>
>
> As a last resort, you could install mpfr in /usr so as to over-write the
> obsolete version.
>

Re: Configuration problem: not recognizing MPFR

by Philip Herron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey

I got this working now i had the same problem! I posted another topic
on the mailing list. But i got it going now.

What i had to use was i compiling and installed my own libgmp because
that worked but i had to use the macports version of mpfr

$ sudo port install mpfr

but use this configure:

$ ./configure --with-mfpr-include=/opt/local/include
- --with-mpfr-lib=/opt/local/lib

This should work.. well it worked for me :)

- --Phil
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoN1oQACgkQAhcOgIaQQ2FgIgCfVe3Yoo94jpYMW+ppaQp22rXj
b4wAoIuf/QfpM2feLCAEMgGWyTfID4Z/
=qNC8
-----END PGP SIGNATURE-----


Re: Configuration problem: not recognizing MPFR

by Damian Rouson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nice!!!  That did it.

Damian

On Fri, May 15, 2009 at 1:54 PM, Philip Herron
<herron.philip@...> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hey
>
> I got this working now i had the same problem! I posted another topic
> on the mailing list. But i got it going now.
>
> What i had to use was i compiling and installed my own libgmp because
> that worked but i had to use the macports version of mpfr
>
> $ sudo port install mpfr
>
> but use this configure:
>
> $ ./configure --with-mfpr-include=/opt/local/include
> - --with-mpfr-lib=/opt/local/lib
>
> This should work.. well it worked for me :)
>
> - --Phil
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.11 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkoN1oQACgkQAhcOgIaQQ2FgIgCfVe3Yoo94jpYMW+ppaQp22rXj
> b4wAoIuf/QfpM2feLCAEMgGWyTfID4Z/
> =qNC8
> -----END PGP SIGNATURE-----
>
>

Re: Configuration problem: not recognizing MPFR

by Vincent Lefevre-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-05-15 08:02:01 -0700, Damian Rouson wrote:
> I get the same error with that approach.  I can't figure out how it
> could find the wrong mpfr.h when I'm pointing it to the directory that
> contains the file (and I know the file there is the right version
> since I just installed it).

I wonder how --with-mpfr is implemented. If it adds a -I option
in $CFLAGS, then the include directory will be ignored in your
case because /usr/local/include is a system directory.

--
Vincent Lefèvre <vincent@...> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

Re: Configuration problem: not recognizing MPFR

by Pier Philipsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had exactly the same message that mpfr.h was not found, but it turned out to be misleading. The real problem was that the mpfr library was compiled for 64 bits. The latest gcc configure script (4.5) does a better job. It approves the header file, and complains later about the library. However if you install the 32 bit version of the gmp and mpfr libraries, the configure script (gcc 4.4) works well, and also the --with-gmp and --with-mpfr options work.

Damian Rouson wrote:
Hi,

I am attempting to configure gcc-4.5-20090507 on Mac OS 10.4 using the command
----------
$ ../gcc-4.5-20090507/configure --with-languages=c,c++,fortran
--with-mpfr=/usr/local/lib --with-gmp=/usr/local/lib
----------
issued from inside a directory at the same level in the directory tree
as the source directory.  The configure output includes the following:
----------
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
----------

My MPFR version is 2.4.1 and when I run "make check" inside the
mpfr-2.4.1 directory, I get the response
-----------
All 148 tests passed
----------

Inside /usr/local/lib, I have the files

$ls libmpfr.*
libmpfr.1.dylib libmpfr.a       libmpfr.dylib   libmpfr.la

Can someone advice me as to how to get gcc to recognize my mpfr libraries?

Damian