Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Troubles in installing from source code

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
hqking
Posts: 5
Joined: 2005-04-27 15:19
Location: China

Troubles in installing from source code

#1 Post by hqking »

debian: sarge; kernel: 2.6.8-2

Commonly, the process of installing from source code is "./configure - make - make install".
"./configure" will check compatibility, for instance, if my computer support -lpng, -ljpeg and something else. and I always find that some results are "no".

so I want to know that how could I enable these "no"s to "yes"s, and How could I find these lost library files?

I install sarge using netinst.iso, so everything I need is downloaded using aptitude. When I want to install mplayer from source code, above half of options return "no". I want to know exactly which package should be installed or which configure file in my system should be modified to meet the demands.

I guess it may be very complicated. There is no need to know details in following steps. You just could tell me something in general to solve this porblem, for example, "you have to know how configure script file works", "You must be an expert in something", "This book/manul/howto/guide can help you", etc.

I am a newbie. Thank you. :)

(English is not my first langurage. I hope you can understand what I said)

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#2 Post by lacek »

Usually, having just the libraries is nto enough. You need the header files as well in order to be able to compile a program which uses these libraries.
Contrary to what you think, it is usually not too complicated to find the missing libs (mark that I said 'usually' :-P ). You need to understand a few things, though.
Libraries are named lib<something>.so. These are usually symlinks to a file with longer name, which name contains the version of the lib, but that doesn't matter for now. What configure searches for -l<something>, it practically checks the avaibility of lib<something>.so. So, for -lpng, you need to have libpng.so.
However, it is not enough. There is two stages of compilation: compiling and linking. A source gets compiled into object code and later is linked to be an executable. The .so files are needed for linking and later for running the program. However, to make the program compile, you need header files which are contain information about the methods and resources in a .so file.
In Debian, these are always separated as "library" and "development" packages. Libraries are easy to recognize: they are named lib<something>. Somethimes there is a number in the name, I'll mention below how to handle them. Development packages are named exactly like libraries, but their names end with "-dev".

So, how to locate those packages? Remaining at your examples, let's say that the configure script misses -lpng. You can use this command to look for 'libpng' packages:

Code: Select all

apt-cache search libpng
It will display this list:

Code: Select all

gdk-imlib1 - imaging library for use with gtk (using libpng2)
gdk-imlib1-dev - Header files needed for Gdk-Imlib development (using libpng2)
imlib1 - imaging library for X and X11 (using libpng2)
imlib1-dev - Header files needed for Imlib development (using libpng2)
libpng-sixlegs-java - Java package to read and display PNG images
libpng10-0 - PNG library, older version - runtime
libpng10-dev - PNG library, older version - development
libpng12-0 - PNG library - runtime
libpng12-dev - PNG library - development
libpng2 - PNG library, older version - runtime
libpng2-dev - PNG library, older version - development
libpng3 - PNG library - runtime
libpng3-dev - PNG library - development, compatibility package
libpngwriter0 - easy to use graphics library (runtime)
libpngwriter0-dev - easy to use graphics library (development)
pngcheck - PNG file format checker
There is some 'noise' in this list, because the apt-cache command listed every package, which name or description contains 'libpng'. However, there are a number of 'libpng' packages, unfortunately, you can't guess which is to install. You can askthe full definition of a package using the

Code: Select all

apt-cache search --full
command, but, again, it will list every package which has the word you were searching for. So you can check the packagesusing commands like this:

Code: Select all

apt-cache search --full libpng2
In the package description, you can spot this line:
"This is a dummy package; it is superseded by libpng10-dev.". So, installing libpng2 will only install libpng10. Seeing the description of the 'libpng3' package, it reveals a similar thing, only referring to libpng12. Now you have an option to install libpng10-0 or libpng12-0, or both. I prefer to install the newer one in situations like this, but it is not always the gratest idea as programs may use the old one instead. You can install both in this case, they can be installed simultaneously. Later, when one of them becomes obsolete, the packaging system will take care of it. Be sure to install the correcponding devel packages, so you need to install (if you want to install both libpng10 and libpng12):
libpng12-0
libpng12-dev
libpng10-0
libpng10-dev

Usually, the -dev packages automatically install their lib, so it would be enough to install these:
libpng12-dev
libpng10-dev


For -ljpeg, the situation is much more straightforward. Upon searching for 'libjpeg' give the following list:

Code: Select all

imgsizer - Adds WIDTH and HEIGHT attributes to IMG tags in HTML files
libjpeg-mmx-dev - Development files for the IJG JPEG library with mmx optimization
libjpeg-mmx-progs - Programs for manipulating jpeg files using mmx optimization
libjpeg-progs - Programs for manipulating JPEG files
libjpeg62 - The Independent JPEG Group's JPEG runtime library
libjpeg62-dev - Development files for the IJG JPEG library
Clearly, libjpeg62 (and its -dev pair) is your friend here.

Hope this helps...

hqking
Posts: 5
Joined: 2005-04-27 15:19
Location: China

#3 Post by hqking »

Hi, lacek. Thank you very much! It helps me a lot.

These days, I have noticed the differences between two kinds of libraries, one is for using, the other is for developing, And your explaination gives me a very clear answer to what I want to know.

I am now running three terminals simultaneously. The first one displays configure.log to check which header files are lost. The second one runs apt-file to find package which cantains these header files. The last one is aptitude for installing.

I understand why it's usually not too complicated. I have to learn more.

Thank you again. This is the most patient reply I'v ever seen. I like debian and her great package system, and the most important, a Warm-hearted community.

Post Reply