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: README.md
+63-73
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,29 @@ Should work.
29
29
Code is written and tested a few times.
30
30
There are no known bugs, but there might be bugs.
31
31
32
-
### How to Build Trust in the Computed Result
32
+
## Quick Get Started
33
+
Fetch And Run The Development Image:
34
+
```
35
+
$ ./docker-shell.sh
36
+
```
37
+
38
+
Compile The Binary:
39
+
```
40
+
# cd /line-collision-detector/linc
41
+
# faster
42
+
# b
43
+
```
44
+
45
+
Run The Binary:
46
+
```
47
+
# run
48
+
```
49
+
50
+
It will tell you how it wants to be used.
51
+
52
+
If something didn't work, see [troubleshooting](#troubleshooting):
53
+
54
+
## How to Build Trust in the Computed Result
33
55
34
56
If you get collision detected:
35
57
Use the -o flag and generate a debug model.
@@ -41,70 +63,25 @@ Scale up your model gradually until you get collision detected.
41
63
Inspect the collision with -o.
42
64
Convince yourself that any smaller version would avoid collision.
43
65
44
-
## Toolchain
45
-
46
-
This project compiles in Docker
66
+
## More In Depth Info For Developers
47
67
48
-
Everything inside `.` will be available from Docker at compile time.
49
-
This means you can edit the source files from your own OS, using any IDE or text editor you'd like.
68
+
### Structure
50
69
51
-
Generally, everything one might need from the OS in order to compile and work on this project
52
-
should be available in this directory.
70
+
This project has a Docker environment in which it compiles and runs.
71
+
The Docker project lives in this (`line-collision-detector`) directory.
53
72
54
-
One level deeper, that is inside `./linc`, we have a build2 project defined.
73
+
One level deeper, that is inside `line-collision-detector/linc`, we have a build2 project defined.
55
74
The build2 build tool, and its norms, dictates the structure and contents of that folder.
56
75
See [Canonical Project Structure](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml#structure-canonical)
57
76
in the build2 introduction.
58
77
59
-
Yet another level deeper, inside `./linc/linc`, is the actual source.
78
+
Yet another level deeper, inside `line-collision-detector/linc/linc`, is the actual source.
60
79
61
-
## Compiling
62
-
Starting from a Debian/Ubuntu OS:
63
-
```
64
-
$ sudo apt install docker docker.io
65
-
$ sudo usermod -a -G docker $USER
66
-
$ sudo reboot
67
-
... <lots of time>
68
-
$ docker pull gcc
69
-
$ ./build-docker.sh
70
-
... <lots of time>
71
-
$ ./docker-shell.sh
72
-
#
73
-
```
74
-
... and from there on you have access to one bash shell within the compile-container.
75
-
This is the suggested way to compile in that terminal
76
-
```
77
-
# cd /line-collision-detector/linc
78
-
# faster
79
-
# b
80
-
```
81
-
If it complains that buildfile doesn't exist, then the linc submodule hasn't been updated.
82
-
On the host system, do this:
83
-
```
84
-
$ git submodule update --init --recursive
85
-
```
86
-
... and try again to build like described above.
87
-
88
-
89
-
After a successful build, execute with:
90
-
```
91
-
# /line-collision-detector/linc-gcc/linc/linc
92
-
```
93
-
Or simply
94
-
```
95
-
# run
96
-
```
97
-
98
-
It will tell you how it wants to be used.
99
-
Be aware that it will create a file called `linc.log`.
100
-
It may also create a debug model, if you asked for it.
101
-
This model is meant to be inspected visually in another program.
102
-
103
-
## Compilation database
80
+
### Compilation database
104
81
If you need the compilation database (`compile_commands.json`), this can
105
82
be generated within the Docker container with the following command:
106
83
```
107
-
# make-compilation-database.sh
84
+
# make-compilation-database
108
85
```
109
86
It actually creates two versions:
110
87
```
@@ -121,46 +98,59 @@ $ cd linc
121
98
$ rdm &
122
99
$ rc -J .
123
100
```
124
-
## Indent your code
101
+
###Indent your code
125
102
In a docker shell, from anywhere, do
126
103
```
127
-
# indent.sh
104
+
# indent
128
105
```
129
106
This will indent both c++ code and Bash code in this repo.
130
107
131
-
## Tidy your code
108
+
###Tidy your code
132
109
In a docker shell, from anywhere, do
133
110
```
134
-
# tidy.sh
111
+
# tidy
135
112
```
136
113
If you only want to tidy one file, give the filename as an argument
137
114
138
115
This will check the c++ code and complain about places where we break our tidy-rules.
139
116
It will also apply fixes automatically where it can.
140
117
141
-
## Build and run all tests
118
+
###Build and run all tests
142
119
In the Docker shell, do
143
120
```
144
-
# cd /line-collision-detector/linc/
145
-
# b test
121
+
# t
146
122
```
147
-
There's an abbreviation for that, so you can just do
123
+
124
+
### Build Docker Image Locally
125
+
The `docker-shell.sh` script uses an "official" Docker image that it fetches from [here](https://gitlab.com/hangprinter/line-collision-detector/container_registry).
126
+
You might want to build the Docker Image yourself, for example if
127
+
128
+
- The official image is outdated.
129
+
- You have local changes in the Dockerfile.
130
+
- You don't trust the official image.
131
+
132
+
You build your own with:
133
+
148
134
```
149
-
# t
135
+
$ ./build-docker.sh
150
136
```
151
137
152
-
## Compile faster
153
-
Some of our header-only dependencies can be built into static library files instead.
154
-
This is useful during development since it gives faster compile times.
155
-
To enable this, do
138
+
### Troubleshooting
139
+
#### Docker not installed
140
+
Starting from a Debian/Ubuntu OS:
156
141
```
157
-
# faster.sh
142
+
$ sudo apt install docker docker.io
143
+
$ sudo usermod -a -G docker $USER
144
+
$ sudo reboot
158
145
```
159
146
147
+
Starting from other OSes, check [Docker's official documentation](https://docs.docker.com/get-docker/).
160
148
161
-
## Update gcc
162
-
If a new version of gcc/g++ comes out, and you want to use it, do
0 commit comments