Compile the codeĭoc path: /usr /local /share /doc /angband / In this case, though, Angband is very flexible and compiles with or without these optional dependencies, so for now, you can pretend that there are no additional dependencies.
You get comfortable with the idea that most software needs other software libraries because they build upon other technologies. Whether or not you understand what X11 or SDL2 is, they're both requirements that you see pretty often after regularly compiling code over a few months. The site says, "There are several different front ends that you can optionally build (GCU, SDL, SDL2, and X11) using arguments to configure such as -enable-sdl, -disable-x11, etc." This may mean something to you or look like a foreign language, but this is the kind of stuff you get used to after compiling code frequently. This document also describes what other software you need to have installed, although it doesn't exactly spell it out.
Regardless of how experienced they are, everyone is new to source code they've never seen before, and documentation is important!Īngband's maintainers link to online instructions to describe how to compile the code. You're not the only one who needs an introduction to source code. If the README file doesn't contain that information, consider filing a bug report with the developer. Occasionally, they include this information within a dedicated file intuitively entitled INSTALL. Instructions: The literal steps you need to take to build the software.Dependencies: What other software you need to have installed on your system for this application to build and run.Language: What language the code is in (for instance, C, C++, Rust, Python).The README often contains information on these important aspects of the code: This file, ideally, contains guidance on what you need to do to compile the code. There's usually a README file at the top level of the directory. Once you've unarchived it, change the directory into the extracted directory and have a look around. $ tar -extract -file Angband-x.y.z.tar.gz You have to extract it before interacting with it, whether it's a tarball, a zip file, a 7z file, or something else entirely.
Source code is often delivered as an archive because source code usually consists of multiple files. It's a simple application with just enough complications to demonstrate what you need to consider when compiling software for yourself.ĭownload the source code from the website. tar archive, give it an official number and sometimes a release name, and offer it for download to the general non-programmer public.įor this exercise, I'm using Angband, an open source (GPLv2) ASCII dungeon crawler. The term stable suggests the code got tested and that the programmers of the application feel confident enough in the code to package it into a. Use the stable version when possible unless you have reason to believe otherwise or are good enough with code to fix things when they break. You go to a website or a code management site like GitLab, SourceForge, or GitHub. Typically, open source software is available in both a work-in-progress ("current" or "nightly") form as well as a packaged "stable" release version.
Obtaining source code for an application is much like getting any downloadable software. You have all the commands you need, so now you need some software to compile. With your system set up, there are a few tasks that you'll repeat each time you want to compile your software:
On Debian, Elementary, Mint, and similar distributions: $ sudo apt install build-essential clang You can get the GNU C compiler (GCC) and the LLVM compiler, along with other essential commands for compiling on Fedora, CentOS, Mageia, and similar distributions, using your package manager: $ sudo dnf install clang You can look at machine code, but it wouldn't make any sense to you (unless you're a CPU.) Into machine language, the instructions that a CPU uses to process information.