Cross-Compiler Problem - GMP and MPFR

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

I made a change to the article which removes some irrelevant information, do you agree with how it is now AJ?

My reason for this was, none of the environment variables set in the cross-compiler article are required for the installation of GMP or MPFR.

It may also be a possibility to recommend using the host OS's package management functionality, ports/packages for OpenBSD, pkgsrc for NetBSD, RPM/DEB's for Linux, etc.

They'll just need to ensure --with-gmp/mpfr are pointing to the correct location..
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

I'm torn, jnc100's method removes the requirement of building GMP/MPFR separately (and/or installing them system wide..).

Personally, it's not a big deal.. they're fairly small packages, in the end, the decision is up to you guys.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Brynet-Inc wrote:I made a change to the article which removes some irrelevant information, do you agree with how it is now AJ?
Yes - I just made a small change to the numbering now one of the points has been removed, but otherwise, it looks good.
I'm torn, jnc100's method removes the requirement of building GMP/MPFR separately (and/or installing them system wide..).
Hmm...I suppose one disadvantage of this method is that GMP/MPFR have to be added to the GCC path each time you do this, whereas the first method makes them immediately available for when GCC 4.3.1+ is released (assuming that it doesn't require a later version of the other libraries, which IMHO is unlikely).

Perhaps an additional section could be added just before the links. Something like 'Alternative Method' (unless you feel this is promoting the first method and sidelining jnc100's way too much :wink: )

Cheers,
Adam
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

AJ wrote:Something like 'Alternative Method'
I completely agree. The additional disadvantage with my method is that we cannot guarantee that the gcc build system will always support such a method. The compile-each-package-separately method is a much more standard way of doing things.

Regards,
John.
mastermemorex
Posts: 1
Joined: Sat Mar 21, 2009 9:22 am

Re: Cross-Compiler Problem - GMP and MPFR

Post by mastermemorex »

Your solution almost work, but It seems that gcc is looking for the gmp headers at ../../gcc.4.3.3/gmp So I wrote

Code: Select all

cd /usr/src
tar zxf gcc-4.3.3.tar.gz
tar zxf mpfr-2.3.1.tar.gz
tar zxf gmp-4.2.2.tar.gz
cd gcc-4.3.0
ln -s ../mpfr-2.3.1 ./mpfr
ln -s ../gmp-4.2.2 ./gmp
cd ..

# the following as per cross compiler article
[color=#FF0000]mkdir build
cd build
mkdir gcc
cd gcc[/color]
export PATH=$PATH:$PREFIX/bin
../gcc-4.3.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c,c++ --without-headers --with-newlib
make all-gcc
make install-gcc
And it works! You have saved me the afternoon. Thanks a lot. =D>
and... remember to install g++ before... :wink:
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Cross-Compiler Problem - GMP and MPFR

Post by pcmattman »

Wouldn't it have been easier to use --with-gmp and --with-mpfr rather than creating the symlinks?
Post Reply