LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-17-2018, 01:31 AM   #1
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Rep: Reputation: Disabled
Why is the "--with-mpfr-include" flag used in CLFS necessary?


Hello,
I've read both of the LFS and CLFS books and I have a question regarding the different procedures used in the two books when building the GCC compiler.

In the both the LFS & CLFS books, the "mpfr", "gmp", and "mpc" packages are extracted into the GCC source directory. However, the CLFS book specifies the "--with-mpfr-include=$(pwd)/../gcc-x.y.z/mpfr/src" option when configuring GCC, while the LFS book didn't use this option at all. Why is this option necessary? I thought that the GCC build system will automatically build gmp, mpfr, and mpc if they are present inside the source directory. And, if for some reason the location of mpfr needs to be specified manually in CLFS, why is there no need to specify the location of mpc and gmp?

Thanks!
 
Old 12-18-2018, 06:41 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,281

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
They put a lot of work into CLFS to get it going and have the procedure down fairly well. The book usually explains the options in detail. What does the explanation say?

CLFS is radically different because LFS can rely on your local stuff in /usr/include, /usr/lib, etc. CLFS is different because /usr/include and /usr/lib are hostile territory, and you have to exclude them at any cost. Think of the situation where you're using an (x86-64) gcc-arm and compiling for arm64. Very different machines that have to be totally separate. They've probably learned the hard way. Disobey them, and you can learn the hard way too
 
Old 12-18-2018, 11:27 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
The last gcc requiring "--with-mpfr-include" was gcc-4.8.4
... Your question doesn't specify gcc version.

gcc configure, overview https://drive.google.com/drive/folde...nO?usp=sharing
 
Old 12-18-2018, 10:13 PM   #4
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Original Poster
Rep: Reputation: Disabled
Hello,
Regarding the "--with-mpfr-include" option, the CLFS book just said that it "Tells configure how to find the mpfr headers". I'm using the CLFS book from here. In the book they are using GCC-6.2.0
I mean, if the mpfr paths were explicitly specified to avoid contamination from the host, then shouldn't the paths to mpc and gmp be specified as well?

Thanks for the help!
 
Old 12-19-2018, 04:44 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,281

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
That is a generic book. You no doubt have seen the abbreviation FBBG. It means "Follow Book, Book Good." Your build is raising questions in your head. That's good. The time to post here is when you follow the book and it doesn't work. It prtobably hasd to do with what they're installing, as the source will get deleted later.
 
Old 12-19-2018, 08:11 AM   #6
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Original Poster
Rep: Reputation: Disabled
Ok thanks. I have a few other questions related to the general build process of LFS. Should I post them in this forum? They aren't related to any specific problems that I encountered while following the book, just about how the build process works.
 
Old 12-19-2018, 08:17 AM   #7
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Original Poster
Rep: Reputation: Disabled
Ok thanks. I have a few other questions related to the general build process of LFS. Should I post them in this forum? They aren't related to any specific problems that I encountered while following the book, just about how the build process works.
 
Old 12-19-2018, 11:29 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Quote:
Originally Posted by Unturned3 View Post
Ok thanks. I have a few other questions related to the general build process of LFS. Should I post them in this forum? They aren't related to any specific problems that I encountered while following the book, just about how the build process works.
Fire away.
 
Old 12-19-2018, 07:01 PM   #9
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Original Poster
Rep: Reputation: Disabled
@hazel Thanks!
I found some information from https://gcc.gnu.org/install/configure.html and here's what it says:
Quote:
--with-gmp=pathname
--with-gmp-include=pathname
--with-gmp-lib=pathname
--with-mpfr=pathname
--with-mpfr-include=pathname
--with-mpfr-lib=pathname
--with-mpc=pathname
--with-mpc-include=pathname
--with-mpc-lib=pathname

If you want to build GCC but do not have the GMP library, the MPFR library and/or the MPC library installed in a standard location and do not have their sources present in the GCC source tree then you can explicitly specify the directory where they are installed (‘--with-gmp=gmpinstalldir’, ‘--with-mpfr=mpfrinstalldir’, ‘--with-mpc=mpcinstalldir’). The --with-gmp=gmpinstalldir option is shorthand for --with-gmp-lib=gmpinstalldir/lib and --with-gmp-include=gmpinstalldir/include. Likewise the --with-mpfr=mpfrinstalldir option is shorthand for --with-mpfr-lib=mpfrinstalldir/lib and --with-mpfr-include=mpfrinstalldir/include, also the --with-mpc=mpcinstalldir option is shorthand for --with-mpc-lib=mpcinstalldir/lib and --with-mpc-include=mpcinstalldir/include. If these shorthand assumptions are not correct, you can use the explicit include and lib options directly. You might also need to ensure the shared libraries can be found by the dynamic linker when building and using GCC, for example by setting the runtime shared library path variable (LD_LIBRARY_PATH on GNU/Linux and Solaris systems).

These flags are applicable to the host platform only. When building a cross compiler, they will not be used to configure target libraries.
Since the CLFS/LFS books unpacked the mpfr/mpc/gmp packages into GCC's source tree, I guess that we can say the "--with-mpfr-include" flags used in the CLFS book isn't strictly needed? What's your view on this?
 
  


Reply

Tags
clfs, gcc, lfs



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
what is the use of mpfr and gmp is they are not used ? Manual error ? centguy Linux From Scratch 8 01-25-2010 05:57 AM
[SOLVED] gcc in CLFS section 5.8.1 does not compile without the omitted mpfr and gmp Openumerix Linux From Scratch 4 11-20-2009 01:35 PM
WTF??? MPFR asks for MPFR, nfsmw222 Linux - Newbie 2 04-06-2009 07:08 AM
chown clfs:clfs mishap Louis_Carole Linux From Scratch 4 03-21-2007 07:40 PM
Why not include all necessary libraries in a release? chingasman Linux - General 3 02-03-2003 05:35 PM

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

All times are GMT -5. The time now is 10:03 AM.

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