LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I compile? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-compile-322693/)

EliasAlucard 05-12-2005 07:14 AM

How do I compile?
 
I'm new to Linux, and I don't know how to compile software. I want to compile the latest VLC source code so that I can have a kick ass media player for Linux. I run Mandrake 2005 LE. Do I need certain software, or just commandlines? Thanks.

Boby 05-12-2005 07:26 AM

Hello!

Usually you unpack the arhive and switch to this one in the console/terminal, there:
Code:

./configure
make
su
Password:
make install

After unpacking the arhive there must be an INSTALL or README file where you get all installation steps.

Read: Compiling Programs from Source by Jeremy

Good luck!
Boby

Simon Bridge 05-12-2005 07:36 AM

EliasAlucard:
Boby has a really good set of links you should really check out.

When you download the source tarball (*.tar.gz) you can usually find a file inside it called "readme" or something. Provided you have a complete distribution, you should be able to just follow the instructions.

You need the terminal (command line) and the make utility with an up to date version of gcc. So, update gcc and make as soon as you can. Then try compiling your first software.

However, I'd suggest you practise on something quite simple first. Try downloading and installing the latest version of xmms or similar.

EliasAlucard 05-12-2005 07:39 AM

All right, I'll try that when I have more time. One question though: what's gcc? And where can I find the source code for xmms? Thanks for all the help guys, really appreciate this.

Simon Bridge 05-12-2005 10:05 AM

Oh dear ... linux comes with a really neet thing called a "man" page. type "man gcc" at a terminal prompt and read away :)

It's the same with any of the linux commands.

Another good one to know as a newbie is "apropos". If you want to know about something but don't know what to ask, try "apropos thingy" for eg.

apropos kernel

will produce a long list - all with the word "kernel" in each line. The first word is the command referred to. For eg. near the bottom I see "tux" starting a line. If I type man tux, I get a description of what the command does and how to use it.

Another neet thing is the world wide web :) google "xmms source" and follow your nose.

__J 05-12-2005 02:24 PM

check out the vlc man page and see if you can get a package for it. as mentioned above, you probably don't want to start of with compiling vlc, it's not ./configure, make, make install and done. check out the vlc website, see how many of the dependencies you already have installed ( vlc has alot of dependencies).

EliasAlucard 05-12-2005 07:28 PM

Quote:

Originally posted by __J
check out the vlc man page and see if you can get a package for it. as mentioned above, you probably don't want to start of with compiling vlc, it's not ./configure, make, make install and done. check out the vlc website, see how many of the dependencies you already have installed ( vlc has alot of dependencies).
The VLC Mandrake page says something about urpmi and I have no idea what the hell that is :/

finklewicz 05-12-2005 07:52 PM

http://urpmi.notix.net/

Follow the very easy instructions, and it will give you easy access to tons of software programs packaged just for Mandriva, thru it's package installer.

EliasAlucard 05-14-2005 06:17 AM

Quote:

Originally posted by finklewicz
http://urpmi.notix.net/

Follow the very easy instructions, and it will give you easy access to tons of software programs packaged just for Mandriva, thru it's package installer.

Ain't working. Not sure if I'm doing it right.

Simon Bridge 05-15-2005 08:55 PM

EliasAlucard: http://www.urpmi.org/

That tells you about urpmi. Basically, it's the mandrake/ivia version of rpm for red hat. With this installed, you will minimise your need to compile things directly - yourself.

In general, whenever you get stuck on something in a message from your computer/OS - try googling the confused thing first. The site above was second from the top in the google search, the top one was a site handling downloads.

I thought that this came with the default installations - try: man urpmi for details.

EliasAlucard 06-03-2005 03:55 AM

So far, I've had no success with compiling from source. I always get some kind of error.

Simon Bridge 06-03-2005 06:40 PM

OK - have you got urpmi yet? (What is the output of "man urpmi"?)

Give me an example of you compiling something from source.

Show me:
1. gcc version, make version
2. tarball name
3. describe unpacking the tarball
4. summarise the readme and install notes from the tarball
5. ./configure results (if appropriate)
6. make results (only post errors or the last 5 lines if no errors)
7. make install results (only post errors or last five lines if no errors)

(5-7 will vary according to the instructions in the readme and install notes)

If you want to figure it out yourself - google the first error in the output, along with the name of the program you are trying to compile. In general, compiling from source is the most reliable way of getting programs working on your computer - binary rpms often have odd dependancies or rely on a small quirk of architecture. However, you must have all the libraries installed and have up to date versions of make and gcc.

EliasAlucard 06-03-2005 07:56 PM

So I tried the latest xmms (xmms-1.2.10) as someone here suggested. I did exactly like Boby said. It's not always the same error message, but it's always something similar; if it's not this, then it's that, you know? I don't know, could it be that i've installed Linux in a poor way? Anyway, here goes:

Quote:

[root@cxx-xxx-xx-xxx ~]$ tar -xvf xmms-1.2.10.tar.gz
xmms-1.2.10/
xmms-1.2.10/intl/
xmms-1.2.10/intl/ChangeLog
xmms-1.2.10/intl/Makefile.in

[root@cxx-xxx-xx-xxx ~]$ cd xmms-1.2.10
[root@cxx-xxx-xx-xxx xmms-1.2.10]$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes

checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for glib-config... no
checking for GLIB - version >= 1.2.2... no
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.
configure: error: *** GLIB >= 1.2.2 not installed - please install first ***
[root@cxx-xxx-xx-xxx xmms-1.2.10]$ make
make: *** No targets specified and no makefile found. Stop.
[root@cxx-xxx-xx-xxx xmms-1.2.10]$ su
Password:
[root@cxx-xxx-xx-xxx xmms-1.2.10]# make install
make: *** No rule to make target `install'. Stop.
[root@cxx-xxx-xx-xxx xmms-1.2.10]#

Simon Bridge 06-04-2005 12:15 AM

Ack Ack Ack ... pfft. Last five lines or the error please :)
<Simon climbs out from under a mountain of printout ...>
Here's the error:
Code:

checking for GLIB - version >= 1.2.2... no
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.

You need to make sure that glib-config is installed. Look for the file using your favorite search tool and note where it is.

If it is not there, then you need to install glib before you can install xmms. Usually best to get libraries as rpm's or similar if you can.

If it is there, but it is somewhere like /usr/glib instead of /sbin or similar then you need to check that the location is in your path (echo $GLIB_CONFIG).

It probably isn't there. You have two options...
1. create a symbolic link called glib.conf somewhere in your path, and point it at the real glib.conf.
2. append the path to glib.conf to your path evironment variable like this:
export GLIB_CONFIG=$GLIB_CONFIG:/usr/glib/bin (provided /usr/glib is is where glib.conf is found.)

(I am assuming that GLIB_CONFIG is a global environment variable - it could be a variable in the config script ... in which case you'll have to use a text editor to edit the script itself!)

In general: This kind of error means that you do not have all the required libraries installed. In order to install from source you must have all the libraries.

To get the libraries, just google the library name. You are using Mandrake, if I remember right, mandrake can use rpm's ... so www.rpmfind.net is a good place to search. You distribution boards will also help you there.

Dosn't mandrake also have apt-get?

The first thing you upgrade is probably going to have to be gcc and its libraries. After that, other upgrades should be smooth sailing. As you encounter these errors and install the required components, these errors will be fewer, and farther between.

BTW: you missed out steps 1,3 and 4 from my post. :(


All times are GMT -5. The time now is 12:05 AM.