Friday, June 5, 2015

Tagged Under: ,

Compile and install from source code using make in Linux (ubuntu)

By: sachin On: 10:12 PM
  • Share The Gag
  • Build from source code using make file

    Installing Packages / Softwares from the source code is pretty easy task. We make use of "gnu make -j" to aid us in the installation of the package from the source code.The gnu make file which is provided with the source code is used and the gives code is compiled automatically. The gnu make scripts are pretty different from the native UNIX shell scripts .
    Now the question is why we do not have one single double click install feature, It exists for Debian and Red hat .deb and .rpm respectively, but for providing the multi architecture portability we have to build them in the machine where you are using it itself.
     

    Steps in building from make file from source code sample

    Here to build from the source we are making use of  utility source for the demonstration purpose.
    Step 1 : To build software's we need some building tools like compilers , linker etc. So we have a tool / software called " build-essentials "  before starting the installation you need to install this package into your computer, Sometimes it is provided Built In.
    sudo apt-get install build-essential


    Step 2 : So in this Article we consider Pidgin Chat tool for the demonstration Download Pidgin source file from here ( To demonstrate the installation only )
    Step 3 : The Source you have downloaded will be by defatult in the /Downloads Directory in your home, So just move to your Downloads Directory and Decompress the files. Use either of them based on the compression extension
    tar -xzvf file.tar.gz
    tar -xjvf file.tar.bz2  
    Step 4 : Once you have decompressed the files, You can find the folder with same name, just move into that folder using the cd command , Here in this example we move to  cd  /Downloads/Pidgin*/. Now you need to run the configuration file from the extracted folder, The configuration file will check weather all the softwares that are required in building exists in your system, If they exists then it will execute normally else it eill list out the required Dependencies which you need to manually install using the sudo apt-get install PACKAGE_NAME.
     ./configure
    Step 5 : Now if all the dependencies are available , then you can execure the "make" command to install / build your source code.Execure these commands within install will be done with execution of the installation command bellow, if you keep all these files , You can uninstall during the time of uninstallation with the second Command
    For Installation  :  sudo make install 
    For uinstallation  :  sudo make uninstall 

    0 comments:

    Post a Comment