LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 01-08-2011, 08:23 PM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Question Problem building GCC and GMP


I'm stuck here:

http://www.linuxfromscratch.org/lfs/...gcc-pass1.html

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.
Old 01-08-2011, 08:59 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

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:
Code:
make[1]: Leaving directory `/mnt/sources/gcc-4.5.1'
Finally, which host are you using?
 
Old 01-09-2011, 03:05 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.


(( $(pwd) is actually "gcc-build/" ! ))

..

Last edited by knudfl; 01-10-2011 at 02:30 AM.
 
Old 01-09-2011, 03:38 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
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?
 
Old 01-09-2011, 08:22 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
What is the gcc-build 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.
 
Old 01-09-2011, 08:56 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You really should follow the book

Quote:
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.

Hope this helps.
 
Old 01-09-2011, 11:27 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I'm redoing it from scratch, and I have a problem: wget fails to download shadow-4.1.4.2.

When it reaches 6%, it just stops working.

Is there any mirror from which I can download it?
 
Old 01-09-2011, 11:37 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You might consider to download the LFS 6.7 tarbal instead of individual packages. All packages and patches should be present.

The individual shadow package is also available here: Index of /sources/BLFS/svn/s

Hope this helps.
 
Old 01-09-2011, 11:46 AM   #9
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by druuna View Post
You might consider to download the LFS 6.7 tarbal instead of individual packages. All packages and patches should be present.
Good, I didn't know about that. I'll try it.
 
Old 01-09-2011, 12:56 PM   #10
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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.

http://www.linuxfromscratch.org/lfs/...ils-pass1.html

It says to run these commands:

Code:
mkdir -v ../binutils-build
cd ../binutils-build
But in what directory?!?
 
Old 01-09-2011, 01:14 PM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

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.

Hope this helps.
 
Old 01-09-2011, 01:28 PM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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.

Is that correct?
 
Old 01-09-2011, 01:31 PM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
That is correct
 
Old 01-09-2011, 01:55 PM   #14
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
http://www.linuxfromscratch.org/lfs/...x-headers.html

Am I supposed to extract the Linux package here? I can't find anything called "linux-headers" in the LFS 6.7 tarball.
 
Old 01-09-2011, 02:02 PM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I have to agree that this one isn't too clear, although there is a hint in the chapter title.

They are talking about the linux kernel package (this one: linux-2.6.35.4.tar.bz2).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i have an error Building GCC: requires GMP 4.1+ and MPFR 2.3.0+. robineecc1 Linux From Scratch 17 03-05-2018 05:57 AM
[SOLVED] GCC - Won't find GMP IlyaZ Programming 15 12-29-2010 01:44 PM
Why install MPFR and GMP in GCC as opposed to separately? GuyWhoKilledBear Linux - Software 1 08-12-2009 12:46 PM
GCC make error 2; stage 1 gmp (Book 6.4) agrestic Linux From Scratch 0 01-25-2009 03:28 PM
Can't Compile GMP with gcc mac 10.4.11 phy1729 Programming 1 04-16-2008 03:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration