wiki:make:introdution
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| wiki:make:introdution [2014/08/10 18:34] – created: intro to make jensv | wiki:make:introdution [2022/07/21 06:59] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===Make=== | ||
| + | |||
| + | A common way to work with research codes is the following: | ||
| + | - Fix a bug or add a feature by editing source files. | ||
| + | - Recompile the source files into executable form | ||
| + | - Run the executable | ||
| + | |||
| + | |||
| + | MHD codes are made up of many files of Fortran and / or C++. If we want to fix a bug or add a feature to one of the files we have to recompile the program. However, the files contain subroutines, | ||
| + | |||
| + | |||
| + | This is where tools like Make come in. One of the fundamental rules of computing is that anything worth repeating is worth automating. If we need to do the same tasks over and over again, we should use a build manager to handle the details. We can use make for any repetitive build: compiling several source files, generating a paper from latex with several figures, etc. | ||
| + | |||
| + | |||
| + | We describe dependencies in a build file, which is usually just a plain text file in some specialized format. We also describe how to update things, i.e., what commands to run when something' | ||
| + | |||
| + | |||
| + | The most widely used build manager on Unix and its derivatives is called Make. And note that we said “most widely used”, not “most popular”. Make was invented by a summer intern at Bell Labs in 1976. ([[https:// | ||
| + | |||
| + | |||
| + | The good news is, GNU Make (the de facto standard version of Make) is fast, free, and well-documented. And many other tools know how to work with Make. In particular, many integrated development environments can manage Make's build files more or less automatically, | ||
| + | |||
| + | |||
| + | In this chapter, we'll look at Make's basic features, and a few of its advanced facilities as well. | ||