User Tools

Site Tools


software_building

This is an old revision of the document!


Building Software from Source Code

Abstract

How to use commonly accepted methods for building software from source code. This software may be from a developer's tar.gz (tarball) download, from github.com or other git repositories such as SourceForge or Gitlab. Other source code repository types also exist but are largely no longer used in favor of git.

The process is largely the same for an organized system of building. This discussion will focus on Linux as the operating system since developers of Windows programs commonly provide installer packages for the pre-compiled binaries.

Kickin' it old school. The TARBALL (is that the proper British spelling?)

Background

Before git was a thing, developers who shared code commonly used the “tar” utility to create a package of the source code necesary to build a project. It was also commonly compressed to save transmission time over the internet when downloaded. So the typical “tarball” package is named by the project name or executable name with the extension “tar.gz”.

Unrolling the tarball

Download the tarball to the folder in which you wish to place the repository. Commonly, we create a folder named “src” or “source” in our home folder for this use.

Now that the tarball is in the “src” folder, use the tar command to extract the source code files and other resources.

tar xvzf MyProgram.tar.gz

This will create the folder structure contained inside the tarball under the “src” folder, so what is created will looks like

./src/MyProgram/<source code files>

Now the source “tree” is ready to be configured and built.

Giddyap with git

Background

Now that git IS a thing, most projects are offered to end users via Github, Gitlab and other online git repositories.

Each project commonly has a home page accessible via web browser. This page gives information about the project including it's license class and other requirements for building the project. The README.md file is typically displayed on this web page so the prospective user may decide if the project is interesting. Usually, this web page also displays a link to use in order to clone the repository.

Cloning from a git repository

Copy the link provided by the web page or other source and use it to clone the repository. The example below is for using a github.com repository

cd ~/src

''git clone https://github.com/guitarpicva/RPiKeyerTerm.git''

software_building.1684689663.txt.gz · Last modified: 2023/05/21 17:21 by ab4mw