User Tools

Site Tools


linux:compiling

Compiling programs

Compiling is the process of translating the source code into the native language of the computer's processor using a compiler.

Compiler

Depending on the language used to write the program, different compiler are necessary:

  • for C program use gcc;
  • for FORTRAN program use gfortran.

They have to be installed through Synaptic.

Source code

The source code is usually supplied in the form of a .tar file, also called tarball.

Building & Installing the program

Use the following commands in this order.

  1. Analyse the build environment:
    ./configure

    If there are error messages, the configuration failed and the program will not build until the errors are corrected.

    If everything is ok will be created the Makefile file.

  2. Build the program:
    make
  3. Install the program:
    sudo make install

    Since it will be installed in /usr/local/bin, which is not normally writeable, it's necessary to become the superuser.

The above procedure doesn't give the possibility to uninstall the software.

In this case, to create a .deb file that can be handled through Synaptic, install the checkinstall package, then run the command within the source folder:

sudo checkinstall
linux/compiling.txt · Last modified: 2020/04/03 09:34 (external edit)