Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I extracted the gcc, gmp, mpc, and mpfr archives, and moved the gmp, mpc, and mpfr directories into the gcc directory. ./configure is successful, but make fails:
Code:
<snip>
checking for math/round... yes
checking for math/trunc... yes
checking for math/floor... yes
checking for math/ceil... yes
checking for math/rint... yes
checking for long double... yes
checking format of `long double' floating point... IEEE extended, little endian
checking for gmp.h... no
configure: error: gmp.h can't be found, or is unusable.
make[1]: *** [configure-mpfr] Error 1
make[1]: Leaving directory `/mnt/sources/gcc-4.5.1'
make: *** [all] Error 2
What should I do?
Last edited by MTK358; 01-08-2011 at 08:24 PM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
can you paste the exact mpfr-3.0.0commands that you issued? I mean what you actually typed in the CLI, don't just copy+paste from the book and assume that you didn't make a typo. It happens faster than you think.
After you extracted mpfr-3.0.0 etc. did you also rename them properly to just mpfr in side the gcc directory?
And did you switch to the build directory and issued configure and make from inside there?
I am not exactly sure what to make of this line:
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Quote:
./configure is successful
Looks suspicious. There is no ./configure.
When your location is "gcc-build/" , then it's '../gcc-4.5.1/configure \ '
Other errors, I have seen :
In '--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs' :
Replacing $(pwd) with a wrong absolute path. Please don't.
I extracted the gcc, gmp, mpc, and mpfr archives, and moved the gmp, mpc, and mpfr directories into the gcc directory.
That doesn't look correct.
You need to unpack gcc, enter the gcc-4.5.1 directory and unpack gmp, mpc, and mpfr from within the gcc directory. After unpacking those three you need to rename them.
crts also mentions a valid point: Did you create and cd into the gcc-build directory and execute the commands from that directory?
It was mentioned in the LFS book, but I didn't understand it and binutils compiled fine without it (just extracted the archive, ran ./configure (options); make; make install).
Anyway, what I did is this (with the gcc, gmp, mpc, and mpfr archives in the sources dir:
Code:
tar xf gcc-XXX.tar.*
tar xf mpc-XXX.tar.*
tar xf mpfr-XXX.tar.*
tar xf mpc-XXX.tar.*
cd gcc-XXX
mv ../mpfr-XXX ./mpfr
mv ../mpc-XXX ./mpc
mv ./gmp-XXX ./gmp
./configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs --without-ppl --without-cloog
make
The host is an Ubuntu "Lucid Lynx" live CD (because I already had the image in my downloads folder). I shut down for the night, and didn't think that the lfs user account will be gone. At least the source archives got downloaded to the mounted hard drive. Maybe I should download the LFS live CD and use that instead.
cd $LFS/sources
tar jxf gcc-4.5.1.tar.bz2
cd gcc-4.5.1
tar -jxf ../mpfr-3.0.0.tar.bz2
mv -v mpfr-3.0.0 mpfr
tar -jxf ../gmp-5.0.1.tar.bz2
mv -v gmp-5.0.1 gmp
tar -zxf ../mpc-0.8.2.tar.gz
mv -v mpc-0.8.2 mpc
Might look the same as your approach, but I'm not sure if anything inside the gcc-4.5.1 directory is overwritten by the untarring of the other three. Never checked to see if this is true, but why change the way the book suggests it to do?
You are still inside the gcc-4.5.1 directory (as assumed by the book) when they tell you to create the gcc-build directory. After that step you should have the following 2 directories inside $LFS/sources: gcc-4.5.1 and gcc-build
You then enter the gcc-build directory and start executing the commands in the rest of the chapter.
If you use anything else then the LFS liveCD as host: Make sure that you make that host compliant (vii. Host System Requirements)! Not doing this will cause problems later on.
OK, I downloaded the packages and set up the environment. Now I want to understand this building outside of the source directory instead of avoiding it.
All build chapters assume that you have untarred the package and are standing inside the newly created directory (mentioned right here: 5.3. General Compilation Instructions (see grey block at the bottom of the page)
As far as the binutils package is concerned: You are in $LFS/sources and unpack binutils-2.20.1.tar then enter the newly created binutils-2.20.1 directory. You are now in $LFS/sources/binutils-2.20.1 at this point you start with the commands in the chapter.
Same thing for gcc: From $LFS/sources you unpack gcc, enter directory and start with the related chapter.
So I should be in $LFS/sources, extract the binutils package, and go into the newly created binutils directory.
Then, from the binutils directory, I run "mkdir ../binutils-build", which creates a directory called binutils-build in $LFS/sources. Next I enter the directory I created.
Then I run ../binutils-XXX/configure from the build directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.