You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 03_building_and_packaging/cmake_exercise.md
+12-26Lines changed: 12 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -4,54 +4,40 @@ In this exercise, we need to fight. Not everything always works smoothly. This i
4
4
5
5
To get an independent and reproducible environment as common ground, we use and, thus repeat, Docker.
6
6
7
-
Deadline: **Thursday, December 1st, 2022, 9:00**
7
+
Deadline: **Thursday, November 27th, 2024, 9:00**
8
8
9
9
## Overview
10
10
11
-
- The goal of the exercise is to open a pull request from a fork of [the CMake exercise repository](https://github.com/Simulation-Software-Engineering/cmake-exercise-wt2223). Please name your pull request `Add building and container recipes` and assign yourself. In the pull request description, please explain what we need to do to test your code.
12
-
- Your should add a `Dockerfile` and a `CMakeLists.txt`, besides some minor changes in `main.cpp` like commenting in some code parts. It should be possible to create an executable container from your pull request. Inside the container, one should be able to directly build the C++ code (`main.cpp`) using CMake. Use as many of the currently commented-out additional files, which induce additional dependencies.
11
+
- The goal of the exercise is to open a pull request from a fork of [the CMake exercise repository](https://github.com/Simulation-Software-Engineering/cmake-exercise-wt2425). Please name your pull request `Add building and container recipes` and assign yourself.
12
+
- Your pull request should add a `Dockerfile` and a `CMakeLists.txt`, besides some minor changes in `main.cpp`, such as commenting in some code parts.
13
+
- From your pull request, it should be possible to create an executable container. After running the container, it should be possible to `cd` into `cmake-exercise` and then run the `build_and_run.sh` script.
14
+
- Use as many of the currently commented-out additional files, which induce additional dependencies.
13
15
14
16
## First Steps
15
17
16
18
1. Fork and clone the repository, have a look at the `main.cpp` and the `README.md`.
17
19
2. Build `main.cpp` manually (e.g. `g++ main.cpp -o main`) and run the executable (`./main`).
18
20
3. Build a Docker image, run a container (in interactive mode), and repeat steps 1 and 2 within the container.
21
+
4. Look into and use the `build_and_run.sh` script.
19
22
20
23
## Repository Structure
21
24
22
25
The bare `main.cpp` uses several additions, which are located in the following subdirectories, each containing a `cpp` and a `hpp` file with the same name.
23
26
24
-
-`flatset` adds a function to create and modify a flat set using [Boost Container](https://www.boost.org/doc/libs/1_80_0/doc/html/container.html) and outputs the set. This example is adapted from a [cppsecrets blog post](http://cppsecrets.com/article.php?id=2834).
25
-
-`filesystem` adds a function to inspect and output the current directory using [Boost Filesystem](https://www.boost.org/doc/libs/1_75_0/libs/filesystem/doc/index.htm). This example is adapted from [tutorial 4](https://www.boost.org/doc/libs/1_80_0/libs/filesystem/example/tut4.cpp) of Boost Filesystem.
27
+
-`flatset` adds a function to create and modify a flat set using [Boost Container](https://www.boost.org/doc/libs/1_86_0/doc/html/container.html) and outputs the set. This example is adapted from a [cppsecrets blog post](http://cppsecrets.com/article.php?id=2834).
28
+
-`filesystem` adds a function to inspect and output the current directory using [Boost Filesystem](https://www.boost.org/doc/libs/1_86_0/libs/filesystem/doc/index.htm). This example is adapted from [tutorial 4](https://www.boost.org/doc/libs/1_86_0/libs/filesystem/example/tut4.cpp) of Boost Filesystem.
26
29
-`fem` defines a class to solve the Poisson problem with the finite-element method (FEM) using [deal.II](https://www.dealii.org/). Output is written to a file `solution.vtk`, which can be visualized with, for example, [Paraview](https://www.paraview.org/). This example is adapted from the [tutorial step 3](https://dealii.org/current/doxygen/deal.II/step_3.html) of deal.II.
27
30
-`yamlParser` adds a function to parse a simple yaml file using [yaml-cpp](https://github.com/jbeder/yaml-cpp) and to output the value of the key `version`. The folder also contains an example file `config.yml`.
28
31
29
-
Further resources:
30
-
31
-
-`inittimezone`: A bash script that comes handy when inheriting from Ubuntu Docker images. More information on what to do with it below.
32
-
33
-
## CMake
34
-
35
-
Please choose a meaningful project name. As target name, use `main`. We recommend to follow best practice and create a `build` directory at the root level from which `cmake ..` is called.
36
-
37
32
## Docker Setup
38
33
39
-
The code and all dependencies should run in a Docker container based on the `ubuntu:22.04` image. As by now, you already know how to set up a basic Docker container, we do no longer provide detailed instructions. We recommend to build the Dockerfile incrementally. Start with a rather empty one and install dependencies manually in the interactive mode. Take notes of the commands you use, so you can integrate them into the Dockerfile afterwards and rebuild your image.
40
-
41
-
To prevent the image from asking the timezone in some dialog, use ...
42
-
43
-
```docker
44
-
COPY inittimezone /usr/local/bin/inittimezone
45
-
RUN inittimezone
46
-
```
47
-
48
-
... **before** you install new packages. Otherwise the Docker image creation will be stuck at a point that requires user interaction while it is not possible to interact with the process. You might need make `inittimezone` executable first: `chmod +x inittimezone`.
34
+
The code and all dependencies should run in a Docker container based on the `ubuntu:24.04` image. As by now, you already know how to set up a basic Docker container, we do no longer provide detailed instructions. We recommend building the Dockerfile incrementally. Start with a rather empty one and install dependencies manually in the interactive mode. Take notes of the commands you use, so you can integrate them into the Dockerfile afterwards and rebuild your image.
49
35
50
36
Some standard packages available on Aptitude might come handy:
51
37
52
38
-`build-essential`
53
39
-`cmake`
54
-
-`git`
40
+
-`unzip`
55
41
-`wget`
56
42
-`vim`
57
43
@@ -60,5 +46,5 @@ Some standard packages available on Aptitude might come handy:
60
46
Add dependencies one by one: Comment in the parts of `main.cpp` that are connected to a specific dependency. Then, install the dependency and extend the `CMakeLists.txt`. Verify that you can build and run the executable. If everything works, go on and include the next dependency.
61
47
62
48
- Maybe start with the boost dependencies. Boost Container is a header-only dependency, Boost Filesystem needs to be linked. Both are available in `libboost-all-dev`. There is a CMake module to [find boost libraries](https://cmake.org/cmake/help/latest/module/FindBoost.html).
63
-
- deal.II is available in `libdeal.ii-dev`. deal.II uses some fancy[CMake macros](https://www.dealii.org/current/users/cmake_user.html).
64
-
- yaml-cpp is an optional bonus task. For some arbitrary reason, we are not happy with the latest release of the software (which would be available through Aptitude), but we want to use the current `master` branch [directly from GitHub](https://github.com/jbeder/yaml-cpp). Get it via `git clone`, and build and install (`make install`) it yourself. Do not forget to add the necessary instructions to the Dockerfile. Sometimes containers behave weirdly: If libraries in `/usr/local/lib` are not found by CMake, please add the path to the environment variable `LD_LIBRARY_PATH`.
49
+
- deal.II is available in `libdeal.ii-dev`. deal.II uses some specific[CMake macros](https://www.dealii.org/current/users/cmake_user.html).
50
+
- yaml-cpp is an optional bonus task. For some arbitrary reason, we are not happy with the latest release of the software (which would be available through Aptitude), but we want to use exactly version `v0.6.3`[directly from GitHub](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.6.3). Get the sources with [wget](https://linuxize.com/post/wget-command-examples/) and build and install (`make install`) it yourself. Do not forget to add the necessary instructions to the Dockerfile. If libraries in `/usr/local/lib` are not found by CMake, please add the path to the environment variable `LD_LIBRARY_PATH`.
Copy file name to clipboardExpand all lines: 03_building_and_packaging/make_slides.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ slideOptions:
33
33
34
34
## Learning Goals of This Unit
35
35
36
-
-Understand the basic functionality of makefiles (timestamps, dependencies, update rules).
36
+
-Explain the basic functionality of makefiles (timestamps, dependencies, update rules).
37
37
- Read simple makefiles and know where to look for additional material for complex makefiles.
38
38
- Write simple makefiles for small projects.
39
39
@@ -50,7 +50,7 @@ Introduce `Hello-World` example
50
50
- A build system
51
51
- The / a go-to solution for small (research) projects (e.g., latex document, processing data, ...), though also used in big projects ([Linux kernel](https://github.com/torvalds/linux))
52
52
- A building block for CMake
53
-
- Nice non-expert introduction in [py-RSE book, chapter 9](https://merely-useful.tech/py-rse/automate.html)
53
+
- Nice non-expert introduction in [py-RSE book, chapter 9](https://third-bit.com/py-rse/automate.html)
54
54
-[GNU Make](https://www.gnu.org/software/make/): standard implementation of Make for Linux and macOS
55
55
56
56
---
@@ -82,7 +82,7 @@ Introduce `Hello-World` example
82
82
- Wildcards
83
83
- ... but becomes quickly [very hard to read](https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html).
84
84
- Not covered because CMake does this for us.
85
-
- But nicely documented in [py-RSE chapter 9](https://merely-useful.tech/py-rse/automate.html).
85
+
- But nicely documented in [py-RSE chapter 9](https://third-bit.com/py-rse/automate.html).
0 commit comments