LinuxQuestions.org
Help answer threads with 0 replies.
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 05-20-2015, 04:09 PM   #1
GameCodingNinja
Member
 
Registered: Jul 2014
Posts: 100

Rep: Reputation: Disabled
Compiling and linking question


To my understanding, when you compile a package, it may link to other packages already installed. I'm not sure what this linking means other then the package being compiled knows this other package is there and now expects it to be there when it runs.

The main question is, say I compile packageB. PackageB sees packageA that's already installed. Now I need to recompile packageA. Do I also need to recompile pacageB because packageA has changed?

Thanks!
 
Old 05-20-2015, 05:11 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 3,137

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
it depends on the changes to the package you are linked against, usually a minor revision change will not cause a problem, if there is a major version change then you may have to recompile packages that are linked against the one you are updating, if you need to do this it will be in the README or CHANGELOG files, you may be lucky that the part of the library you need to use has not changed or if it has changed too much or gone away altogether the app linked sgainst the library may just segfault with no warning.

The moral of this is read the documentation and if in doubt 'suck it and see'.
 
Old 05-21-2015, 01:47 AM   #3
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
Quote:
Originally Posted by GameCodingNinja View Post
The main question is, say I compile packageB. PackageB sees packageA that's already installed. Now I need to recompile packageA. Do I also need to recompile pacageB because packageA has changed?

Thanks!
In that case it is best to first upgrade A before recompiling/upgrading package B.
 
Old 05-21-2015, 02:12 PM   #4
GameCodingNinja
Member
 
Registered: Jul 2014
Posts: 100

Original Poster
Rep: Reputation: Disabled
Is there a simple way to know what packages are linked to the package you want to replace with a newer version? I can see how this can get out of hand quickly because these other packages may be linked into other packages as well.
 
Old 05-21-2015, 02:37 PM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 3,137

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
Quote:
Originally Posted by GameCodingNinja View Post
Is there a simple way to know what packages are linked to the package you want to replace with a newer version? I can see how this can get out of hand quickly because these other packages may be linked into other packages as well.
If you want simple and for the OS to do it all for you use ubuntu

Seriously one of the main drawbacks of LFS is no dependency checking, but then again the system can't update anything by itself ( unlike the aforementioned 'Linux for dummies' distro ), so if you are going to update a library etc its up to you to make sure it doesn't break anything and to update anything that you need to, with (B)LFS you are the boss!
 
Old 05-21-2015, 04:22 PM   #6
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
What you could do is use a dependency tree.
Check for each package what it requires according to the book and what you installed of the recommended stuff.
A lot of work and sometimes some packages get new dependencies or new packages arise.
 
Old 05-22-2015, 04:06 PM   #7
GameCodingNinja
Member
 
Registered: Jul 2014
Posts: 100

Original Poster
Rep: Reputation: Disabled
Thanks for all the info guys! I really appreciate it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] gfortran linking/compiling with -I and -J flags januka Linux - Newbie 1 09-26-2013 10:56 AM
linking and compiling multiple c++ files into one skazhy Programming 4 12-18-2009 03:43 AM
compiling and linking C programs node047 Linux - General 2 04-20-2005 11:47 AM
compiling linking help blackzone Programming 1 02-13-2005 10:40 PM
compiling and linking boku Programming 5 12-25-2002 09:23 AM

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

All times are GMT -5. The time now is 08:37 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