Page 1 of 1

[SOLVED] Understanding CentOS/RHEL shared library conventions

Posted: 2011/04/30 14:28:25
by arturos
Hello CentOS community,

I was interested in learning more about the convention behind the layout of shared libraries and headers in CentOS or more specifically the proper way to compile against them, specifically why the headers are laid out the way they are.

I am asking this because recently I was trying to compile a piece of software on a CentOS machine and in order to get the software to compile against libraries available on the system, I had to create elaborate -I arguments to the compiler. For example, the software used the gtk library and many files referenced the header gtk/gtk.h. This file was available on my system in /usr/incude/gtk-2.0/gtk/gtk.h. I had to add the -I /usr/lib/gtk-2.0/gtk/gtk.h preprocessor argument or I believe I could've changed the header file to reference #include , but I didn't try this. This software referenced many headers that were subject to installation by a similar convention including gdk/gdk.h, headers in atk, pango, and others.

I am new to software programmng and don't have a lot of experience with different kinds of include and library installation conventions. I have looked on the CentOS and Redhat and even Fedora pages for documentation about this situation but was unable to find anything specific. I have found documentation about compiling software on RHEL6 but I haven't found anything that discusses this subject specifically, (or I missed it sifting through all of the other information in the Developer Guide http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Developer_Guide/)

It seems that I must be doing something wrong to have to specify these elaborate arguments, or am I? I just haven't been able to find any specific documentation for this. This seems like an important subject so there must be documentation somewhere, unless I just don't 'get it'.

Thank you for your time and advice,
Arturo Salazar

[SOLVED] Understanding CentOS/RHEL shared library convention

Posted: 2011/04/30 19:26:24
by pschaff
Welcome to the CentOS fora. Reading [url=https://www.centos.org/modules/newbb/viewforum.php?forum=47]FAQ & Readme First[/url] is recommended for new users.

RHEL, and consequently its derivative CentOS, is a package-based system. Source packages typically contain all the BuildRequires and commands to build the software and produce binary packages. You don't say what application you are trying to build, but the usual approach I employ for software not already available from a compatible repository is to search for a Fedora or other SRPM as a starting point, and modify it if necessary to adapt for a later or earlier version as required. See [url=http://wiki.centos.org/HowTos/RebuildSRPM]How to Rebuild a Source RPM[/url]. I don't know of a good general tutorial on RHEL library and header structure. The following links may be helpful:

http://www.rpm.org/max-rpm/
http://fedoraproject.org/wiki/PackageMaintainers/CreatingPackageHowTo

For more specific help, please provide more specifics.

Re: Understanding CentOS/RHEL shared library conventions

Posted: 2011/05/08 14:00:45
by arturos
Greetings,

Thank you for the reply Phil. Your links and comment regarding CentOS being a package-based system gives me a better understanding of the larger philosophy of CentOS and similar distributions, which is helpful to me at this time.

Sincerely,
Arturo Salazar

Re: Understanding CentOS/RHEL shared library conventions

Posted: 2011/05/08 17:01:02
by pschaff
You are welcome [b]Arturo[/b]. Please let us (moderators) know if you consider that this thread can be marked solved for posterity by replying with [SOLVED] in the subject.

[SOLVED] Re: Understanding CentOS/RHEL shared library conventions

Posted: 2011/06/24 17:08:47
by arturos
Hello,

Thank you for your assistance regarding my question. I better understand the nature of software on CentOS and similar systems.
I apologize for the delay in closing this topic.

Sincerely,
Arturo Salazar

Re: [SOLVED] Understanding CentOS/RHEL shared library conventions

Posted: 2011/06/24 17:25:06
by pschaff
Thanks for reporting back. Marking this thread [SOLVED] for posterity.