People new to linux find it often difficult to install programs from source. However, if the first hurdle is overcome, people appreciate that the fact that most programs are open-source gives you great freedom of choice. Miss a function? Maybe you find it in a nightly-build. Find a bug? Maybe you find the bug-fix already in the new source.
If you want to install a program by compiling from source, this usually begins by downloading a tarball and extracting it using the tar utility. If the file extension is tar use tar -xvvf file.tar, if it is gz use tar -xzvf file.tar.gz, for bz2 use tar -jxvf file.tar.bz2.
The GNU Compiler Collection (GCC), which includes compilers for C, C++, Fortran and other programming languages. In order to be able to compile programs you need to have GCC and some libraries installed. In ubuntu, you'll install it typing:
>> sudo apt-get install build-essential
Usually, to compile a C program to binary myprogram you type:
>> gcc -o myprogram myprogram.c
or, for C++
>> g++ -o myprogram myprogram.cpp
However, most programs that you would download need more than that. They need some configuration, detect dependencies, among other things. Usually you'll find a readme file that carries you through the steps of installation. Typical these would be configure; make; sudo make install.
What happens often is that you get back some error that you miss some library that you've never heard of. In some cases you would spend hours searching forums in order to find out in which package the library is located. A simpler way to find out you in which package your library is located is:
>> apt-file search package
If you use the rpm package manager, similarly you can use:
>> rpm -q package
If you use information from this article on your site, then please provide a backlink to it. You can use the following markup:


0 comments:
What do you think?
Post a Comment