The flagship of the Open Source movement, which is gaining momentum, is undoubtedly the Linux operating system. Recently, Linux has left the category of predominantly server-class operating systems, firmly settling on desktops and significantly squeezing Windows. Modern Linux distributions "out of the box" practically do not require specific skills from the user, allowing you to start working immediately after installation. However, knowing how to compile linux programs will still come in handy.
Necessary
- - account data for authorization in linux;
- - password from the root account (if you need to install additional packages);
- - possibly an internet connection.
Instructions
Step 1
Before compiling programs on linux, read all possible documentation and instructions for building and installing specific software. Typically, files named README, readme.txt, or readme.html are located in the root directory of the source code. These files provide the necessary instructions and often provide links to more detailed instructions, if any. Such documentation often contains requirements for the compiler, kernel, and library versions.
Step 2
Install additional components required for the build (for example, you may need the autotools package or gcc of a particular version). Install the required software from the binary distribution using the package manager available on the system (such as rmp or apt). If necessary, download the source codes of additional components from the Internet, compile them and install them.
Step 3
Configure before compiling. A description of the configuration process is usually contained in the accompanying documentation. Often there are configuration scripts (such as configure) as part of the source tree. If so, run the script. If you have a configure script, just open a console, cd into the project directory, type "./configure" at the command line and press Enter. In rare cases, it may be necessary to manually edit configuration files.
Step 4
Compile. Typically, on Linux, the compilation process is controlled by a build manager. In the vast majority of cases, this should be make, although recently some projects are adapting to cmake. More specific assembly instructions are usually found in the documentation. But often it is enough to execute just one command to put together a project. If you have make installed, after configuring the project, enter "make" in the line, press Enter and wait until the compilation is complete. In the case of cmake, enter the commands "cmake./" and "make" in sequence.