1. Hey Guest Did you know you can win an Honor 10 phone worth ₹33,000 and an additional ₹70,000 in paytm vouchers, just by replying to some threads and taking part in the discussions happening in the Honor Hub?

    What are you waiting for? Start commenting and start winning! Remember to read the instructions posted here.

    Dismiss Notice

[WIP] Compiling and Installing from Sources [A Guide]

Discussion in 'Open Source' started by naveenchandran, Apr 14, 2006.

Thread Status:
Not open for further replies.
  1. naveenchandran

    naveenchandran New Member

    Joined:
    May 16, 2004
    Messages:
    451
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    ** Hosur ** Operating System:GNU
    [WIP] Compiling Sources [A Complete Guide] :D

    Usually for any linux applciations there are sources.
    You can normally compile these souces and install on any distribution.

    Most of the Applications Sources are provided as tarball's

    So after getting the tarball you need to extract it...

    If the tarball ends with .tar.gz then you have to extract it with command something like

    Code:
    tar xvzf some_application-0.1.3.tar.gz
    If the tarball ends with .tar.bz2 then you have to extract it with command something like

    Code:
    tar xvjf some_application-0.1.3.tar.bz2

    Now "some_application" will be extracted into a directory some_application-0.1.3

    Now go into that directory [cd some_application-0.1.3]

    Code:
    ./configure
    This builds a new Makefile. The only generic options you are likely to use are the `--prefix' and `--exec-prefix' options. These options are used to specify the installation directory.

    The default for `--prefix' is `/usr/local'. The default for `--exec-prefix' is the value used for `--prefix'.

    Code:
    ./configure --prefix=/path
    you should substitute /path with the prefix into which you want to install
    the application.

    After running `configure', you can build the tools by running `make'.
    Code:
    make
    To install the tools, run `make install'.
    Code:
    make install
    Installing the tools will copy the programs and any required support files to the installation directory. The location of the installation directory is controlled by `configure' options


    To Summarize...

    a) Extract the tarball
    b) ./configure --prefix=/path
    c) make
    d) su
    e) make install



    Usually there will be a file named "INSTALL" in the directory. Read that first.

    This should install the required application...



    Some things to know...

    Environment Variables

    To list the current values of all environment variables, issue the command

    Code:
    env

    PKG_CONFIG_PATH

    A colon-separated (on Windows, semicolon-separated) list of directories to search for .pc files. The default directory will always be searched after searching the path; the default is libdir/pkgconfig:datadir/pkgconfig where libdir is the libdir where pkg-config and datadir is the datadir where pkg-config was installed.


    LD_LIBRARY_PATH

    The LD_LIBRARY_PATH environment variable contains a colon-separated list of directories in which the linker will search for library (.a) files.


    [WIP] :arrow:

    Plz do comment on this for any changes and additions to make this a better guide.
    TO DO: Common errors while Compiling and Installing..
    -- NC -- :D

    Edited: Should be SU while installing | Thanks to desertwind
     
  2. desertwind

    desertwind New Member

    Joined:
    Nov 2, 2004
    Messages:
    1,096
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    Hyderabad
    Naveen, good guide for newbies. One correction.

    You need to root before installation of package, so the procedure is as follows.

    a) Extract the tarball
    b) ./configure --prefix=/path
    c) make
    d) su
    give root password
    d) make install

    Also I suggest to use sourceinstall for installing from source for newbies. It is a GTK2 tool which provides a better way to manage configure options, directories and environment variables. Using it you can install, upgrade or remove a package.

    Two screeshots attached.

    [​IMG]

    [​IMG]
     
  3. praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    hmm...desertwind..there already is Checkinstall which will make .rpm .deb or any such for easy install.
     
Thread Status:
Not open for further replies.

Share This Page