Skip to content

Commit b547ec5

Browse files
hugtalbotepernod
andauthored
Update build doc using html within the details scope (#223)
* Update build doc using html within the details scope * Apply suggestions from code review Co-authored-by: erik pernod <erik.pernod@gmail.com> --------- Co-authored-by: erik pernod <erik.pernod@gmail.com>
1 parent b16ca4b commit b547ec5

3 files changed

Lines changed: 40 additions & 42 deletions

File tree

10_Getting_Started/20_Build/10_Linux.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ You can download and build SOFA in only three steps without any environment inst
2828

2929
<summary>This installation method is advised for developers. It is STRONGLY advised to read through this entire doc page before getting started.</summary>
3030

31-
### Build tools
31+
<h3>Build tools</h3>
3232

33-
#### Compiler
33+
<h4>Compiler</h4>
3434

3535
SOFA requires a [C++17 compatible compiler](https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features).
3636
On Linux, we officially support **GCC >= 7** and **Clang >= 5**.
@@ -41,7 +41,7 @@ First, install the standard compilation toolkit with this command:
4141
sudo apt install build-essential software-properties-common
4242
```
4343

44-
##### GCC
44+
<h5>GCC</h5>
4545

4646
To know which GCC versions are available for your distribution, run this command:
4747
```bash
@@ -53,7 +53,7 @@ Then, install the latest one with the usual command (example with gcc-11):
5353
sudo apt install gcc-11
5454
```
5555

56-
##### Clang
56+
<h5>Clang</h5>
5757
Clang is an **alternative to GCC**. It compiles approximately two times faster!
5858
We recommend to install **Clang 5 or newer**.
5959

@@ -68,14 +68,14 @@ sudo apt install clang-12
6868
```
6969

7070

71-
#### CMake: Makefile generator
71+
<h4>CMake: Makefile generator</h4>
7272

7373
CMake will be required to configure the SOFA project before compiling it. Note that SOFA requires at least **CMake 3.22**.
7474
```bash
7575
sudo apt install cmake cmake-gui
7676
```
7777

78-
#### [optional] Ninja: build system
78+
<h4>[optional] Ninja: build system</h4>
7979

8080
Ninja is an alternative to Make. It has a better handling of incremental builds.
8181

@@ -84,7 +84,7 @@ sudo apt install ninja-build
8484
```
8585

8686

87-
#### [optional] CCache: caching system
87+
<h4>[optional] CCache: caching system</h4>
8888

8989
We advise you to use [ccache](https://ccache.dev/). It is by no means
9090
mandatory, but it will dramatically improve the compilation time if you
@@ -95,9 +95,9 @@ sudo apt install ccache
9595
```
9696

9797

98-
### Dependencies
98+
<h3>Dependencies</h3>
9999

100-
#### Core (required)
100+
<h4>Core (required)</h4>
101101

102102
SOFA requires some libraries:
103103

@@ -137,14 +137,14 @@ SOFA requires some libraries:
137137
sudo apt install libeigen3-dev
138138
```
139139
140-
#### Graphical User Interface
140+
<h4>Graphical User Interface</h4>
141141
142142
The [SOFAGLFW](https://github.com/sofa-framework/SofaGLFW) project is based on both **GLFW** and **ImGui** libraries. It required the following dependencies to be installed:
143143
``` {.bash .optional}
144144
sudo apt install xorg-dev libgtk-3-dev
145145
```
146146

147-
#### Plugins (optional)
147+
<h4>Plugins (optional)</h4>
148148

149149
SOFA **plugins** depend on libraries that are available in the official repositories.
150150
You probably don't need them all, but you might find it convenient to
@@ -162,10 +162,10 @@ This list does not cover all available SOFA plugins, only the ones that are buil
162162
```
163163

164164

165-
### Build SOFA
165+
<h3>Build SOFA</h3>
166166

167167

168-
#### Setup your source and build directories
168+
<h4>Setup your source and build directories</h4>
169169

170170
To set up clean repositories, we recommend to arrange the SOFA directories
171171
as follows:
@@ -192,7 +192,7 @@ git clone -b master https://github.com/sofa-framework/sofa.git sofa/src
192192
```
193193

194194

195-
#### Generate a Makefile with CMake
195+
<h4>Generate a Makefile with CMake</h4>
196196

197197
0. Activate your venv `source /path/to/sofa-venv/bin/activate` and tell CMake to look there to find pybind11 `export CMAKE_PREFIX_PATH=/path/to/sofa-venv/lib/python3.12/site-packages`
198198

@@ -229,7 +229,7 @@ git clone -b master https://github.com/sofa-framework/sofa.git sofa/src
229229

230230

231231

232-
#### Compile
232+
<h4>Compile</h4>
233233

234234
To compile, open a terminal in your build directory and run `make` or `ninja` depending on the generator you chose during CMake configuration.
235235
If you chose "Unix Makefile" as generator, you can enable parallel compilation by specifying the number of parallel build you want by adding the `-j n` option with `n` being the number of desired parallel jobs.

10_Getting_Started/20_Build/20_MacOS.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ You can download and build SOFA in only three steps without any environment inst
2424
<details>
2525

2626
<summary>This installation method is advised for developers. It is STRONGLY advised to read through this entire doc page before getting started.</summary>
27-
## Build tools
2827

29-
## Build tools
28+
<h2>Build tools</h2>
3029

31-
### Compiler
30+
<h3>Compiler</h3>
3231

3332
SOFA requires a [C++17 compatible compiler](https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features).
3433
On MacOS, we officially support **MacOS >= 10.13.2 (High Sierra)** and **AppleClang >= 9.1.0**.
@@ -64,7 +63,7 @@ If your AppleClang version is too low:
6463
5. Reboot
6564

6665

67-
### CMake: Makefile generator
66+
<h3>CMake: Makefile generator</h3>
6867

6968
SOFA requires at least **CMake 3.22**.
7069

@@ -73,7 +72,7 @@ brew install --cask cmake
7372
```
7473

7574

76-
### [optional] Ninja: build system
75+
<h3>[optional] Ninja: build system</h3>
7776

7877
Ninja is an alternative to Make. It has a better handling of incremental builds.
7978

@@ -82,7 +81,7 @@ brew install ninja
8281
```
8382

8483

85-
### [optional] CCache: caching system
84+
<h3>[optional] CCache: caching system</h3>
8685

8786
We advise you to use [ccache](https://ccache.dev/). It is by no means
8887
mandatory, but it will dramatically improve the compilation time if you
@@ -93,9 +92,9 @@ brew install ccache
9392
```
9493

9594

96-
## Dependencies
95+
<h2>Dependencies</h2>
9796

98-
### Core (required)
97+
<h3>Core (required)</h3>
9998

10099
SOFA requires some libraries:
101100
- **tinyXML2**
@@ -133,7 +132,7 @@ SOFA requires some libraries:
133132
```
134133

135134

136-
### Plugins (optional)
135+
<h3>Plugins (optional)</h3>
137136

138137
SOFA **plugins** depend on libraries that are available in the official repositories.
139138
You probably don't need them all, but you might find it convenient to
@@ -150,10 +149,10 @@ This list does not cover all available SOFA plugins, only the ones that are buil
150149
```
151150
152151
153-
## Build SOFA
152+
<h2>Build SOFA</h2>
154153
155154
156-
### Setup your source and build directories
155+
<h3>Setup your source and build directories</h3>
157156
158157
To set up clean repositories, we recommend to arrange the SOFA directories
159158
as follows:
@@ -180,7 +179,7 @@ git clone -b master https://github.com/sofa-framework/sofa.git sofa/src
180179
```
181180
182181
183-
### Generate a Makefile with CMake
182+
<h3>Generate a Makefile with CMake</h3>
184183
185184
0. Activate your venv `source /path/to/sofa-venv/bin/activate` and tell CMake to look there to find pybind11 `export CMAKE_PREFIX_PATH=/path/to/sofa-venv/lib/python3.12/site-packages`
186185
@@ -209,7 +208,7 @@ git clone -b master https://github.com/sofa-framework/sofa.git sofa/src
209208
7. When you are ready, run **Generate**.
210209
211210
212-
### Compile
211+
<h3>Compile</h3>
213212
214213
To compile, open a terminal in your build directory and run `make` or `ninja` depending on the generator you chose during CMake configuration.
215214
Do not forget the `-j` option to use all your CPU cores.

10_Getting_Started/20_Build/30_Windows.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ You can download and build SOFA in only three steps without any environment inst
2424
<details>
2525

2626
<summary>This installation method is advised for developers. It is STRONGLY advised to read through this entire doc page before getting started.</summary>
27-
## Build tools
2827

29-
## Build tools
28+
<h2>Build tools</h2>
3029

31-
### Compiler
30+
<h3>Compiler</h3>
3231

3332
SOFA requires a [C++17 compatible compiler](https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features).
3433
On Windows, we officially support **Microsoft Visual Studio >= 2017** (version 15.7).
@@ -48,7 +47,7 @@ In the installer, you must enable:
4847

4948
![](https://www.sofa-framework.org/wp-content/uploads/2020/03/install_vs_ide.png)
5049

51-
### CMake: Makefile generator
50+
<h3>CMake: Makefile generator</h3>
5251

5352
SOFA requires at least **CMake 3.22.1**.
5453
Install CMake with [the latest official installer](https://github.com/Kitware/CMake/releases/latest).
@@ -58,7 +57,7 @@ Install CMake with [the latest official installer](https://github.com/Kitware/CM
5857
![](https://www.sofa-framework.org/wp-content/uploads/2019/03/install-cmake.png)
5958

6059

61-
### [optional] Ninja: build system
60+
<h3>[optional] Ninja: build system</h3>
6261

6362
We strongly advise you to use Ninja if you chose to install the Build Tools only (no IDE).
6463

@@ -67,9 +66,9 @@ You can download the latest release from [their GitHub repository](https://githu
6766

6867
**IMPORTANT**: do not forget to **add ninja to your system PATH**.
6968

70-
## Dependencies
69+
<h2>Dependencies</h2>
7170

72-
### Core (required)
71+
<h3>Core (required)</h3>
7372

7473
SOFA requires some libraries:
7574

@@ -97,16 +96,16 @@ SOFA requires some libraries:
9796
Download and extract the [latest Eigen sources](https://gitlab.com/libeigen/eigen/-/releases).
9897
9998
100-
#### [optional] PATH modification
99+
<h4>[optional] PATH modification</h4>
101100
102101
You can add Boost to your PATH to ease their detection by CMake.
103102
**Boost**: add `your/Boost/path` and `your/Boost/path/libXX-msvc-XX`
104103
105104
106-
## Build SOFA
105+
<h2>Build SOFA</h2>
107106
108107
109-
### Setup your source and build directories
108+
<h3>Setup your source and build directories</h3>
110109
111110
To set up clean repositories, we recommend to arrange the SOFA directories
112111
as follows:
@@ -132,7 +131,7 @@ git clone -b v25.12 https://github.com/sofa-framework/sofa.git sofa/src
132131
git clone -b master https://github.com/sofa-framework/sofa.git sofa/src
133132
```
134133

135-
### Generate a VS project (.sln) or a Makefile with CMake
134+
<h3>Generate a VS project (.sln) or a Makefile with CMake</h3>
136135

137136
1. Create build directories respecting the arrangement above.
138137

@@ -170,7 +169,7 @@ git clone -b master https://github.com/sofa-framework/sofa.git sofa/src
170169
10. When you are ready, run **Generate**. In the build directory, this will create a Visual Studio project (.sln) or a Makefile depending on the generator you chose at step 4.
171170

172171

173-
### Compile
172+
<h3>Compile</h3>
174173

175174
To build SOFA in Visual Studio, simply **open the generated Sofa.sln**. Finally, **build the solution** using the Visual Studio interface as shown in the image below:
176175

@@ -188,7 +187,7 @@ Time for a coffee!
188187

189188

190189

191-
### Setup script
190+
<h3>Setup script</h3>
192191

193192
To simplify the configuration of our continuous integration machines, we created a complete set of setup scripts.
194193

@@ -203,7 +202,7 @@ The two scripts `setup-windows_1.bat` and `setup-windows_2.bat` install the mini
203202

204203

205204

206-
### Compilation tutorial
205+
<h3>Compilation tutorial</h3>
207206

208207
See our page presenting [video tutorial for compilation on Windows](../../video-tutorials/how-to-compile-sofa/#windows).
209208

0 commit comments

Comments
 (0)