Skip to content

Commit 1f2294d

Browse files
committed
Instructions for contributors
1 parent 302f113 commit 1f2294d

File tree

3 files changed

+68
-2300
lines changed

3 files changed

+68
-2300
lines changed

README.md

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,15 +1617,17 @@ tiledlayout(rows, cols);
16171617
nexttile();
16181618
```
16191619

1620-
Our tiling functions are convenience shortcuts for the subplot functions. If there is no room for the next tile, we automatically rearrange the axes and increase the number of subplot rows or columns to fit the next tile. Use subplots for more control over the subplots.
1620+
<details>
1621+
<summary>See result</summary>
16211622

16221623
[![example_tiledlayout_1](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_1.svg)](examples/appearance/multiplot/tiledlayout/tiledlayout_1.cpp)
1623-
1624-
<details>
1625-
<summary>More examples</summary>
1624+
1625+
More examples:
16261626

16271627
[![example_tiledlayout_2](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_2_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_2.cpp) [![example_tiledlayout_3](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_3_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_3.cpp) [![example_tiledlayout_4](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_4_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_4.cpp) [![example_tiledlayout_5](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_5_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_5.cpp) [![example_tiledlayout_6](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_6_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_6.cpp) [![example_tiledlayout_7](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_7_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_7.cpp) [![example_tiledlayout_8](documentation/examples/appearance/multiplot/tiledlayout/tiledlayout_8_thumb.png)](examples/appearance/multiplot/tiledlayout/tiledlayout_8.cpp)
16281628
</details>
1629+
1630+
Our tiling functions are convenience shortcuts for the subplot functions. If there is no room for the next tile, we automatically rearrange the axes and increase the number of subplot rows or columns to fit the next tile. Use subplots for more control over the subplots.
16291631

16301632
#### Colormaps
16311633

@@ -2026,7 +2028,7 @@ Get the binary package from the [release section](https://github.com/alandefreit
20262028

20272029
If you need a more recent version of Matplot++, you can download the [binary packages from the CI artifacts](https://github.com/alandefreitas/matplotplusplus/actions?query=workflow%3AMatplotplusplus+event%3Apush) or build the library [from the source files](#build-from-source).
20282030

2029-
Once the package is installed, you can link your C++ program to the library and include the directories where you installed Matplot++. Unless you changed the default options, the library is likely to be in `/usr/local/` (Linux / Mac OS) or `C:/Program Files/` (Windows).
2031+
Once the package is installed, you can link your C++ program to the library and include the directories where you installed Matplot++. Unless you changed the default options, the library is likely to be in `/usr/local/` (Linux / Mac OS) or `C:/Program Files/` (Windows). The installer will try to find the directory where you usually keep your libraries but that's not always perfect.
20302032

20312033
If you are using CMake, you can then find Matplot++ with the usual `find_package` command:
20322034

@@ -2036,6 +2038,15 @@ find_package(Matplot++ REQUIRED)
20362038
target_link_libraries(my_target PUBLIC matplot)
20372039
```
20382040

2041+
CMake should be able to locate the `matplot++-config.cmake` script automatically if you installed the library under `/usr/local/` (Linux / Mac OS) or `C:/Program Files/` (Windows). Otherwise, you need to include your installation directory in `CMAKE_MODULE_PATH` first:
2042+
2043+
```cmake
2044+
list(APPEND CMAKE_MODULE_PATH put/your/installation/directory/here)
2045+
find_package(Matplot++ REQUIRED)
2046+
# ...
2047+
target_link_libraries(my_target PUBLIC matplot)
2048+
```
2049+
20392050
### Build from Source
20402051

20412052
#### Dependencies
@@ -2148,7 +2159,7 @@ Check your CMake version:
21482159
cmake --version
21492160
```
21502161

2151-
If it's older than CMake 3.14, update it
2162+
If it's older than CMake 3.14, update it with
21522163

21532164
```bash
21542165
sudo brew upgrade cmake
@@ -2186,7 +2197,7 @@ If you're using the Gnuplot installer, make sure you mark the option "Add applic
21862197

21872198
</details>
21882199

2189-
It will also look for these *optional* dependencies for manipulating images:
2200+
The build script will also look for these *optional* dependencies for manipulating images:
21902201

21912202
* JPEG
21922203
* TIFF
@@ -2204,51 +2215,78 @@ There are two dependencies in [`source/3rd_party`](source/3rd_party). These depe
22042215

22052216
You can define `WITH_SYSTEM_NODESOUP=ON` or `WITH_SYSTEM_CIMG=ON` in the cmake command line to use a system-provided version of these dependencies.
22062217

2207-
There's an extra target `matplot_opengl` with the experimental OpenGL backend. You need to define `BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON` in the CMake command line to build that target. In that case, the build script will also look for these extra dependencies:
2218+
There's an extra target `matplot_opengl` with the experimental [OpenGL backend](#backends). You need to define `BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON` in the CMake command line to build that target. In that case, the build script will also look for these extra dependencies:
22082219

22092220
* OpenGL
22102221
* GLAD
22112222
* GLFW3
22122223

2224+
<details>
2225+
<summary>Instructions: Linux/Ubuntu/GCC</summary>
2226+
2227+
```bash
2228+
sudo apt-get install libglfw3-dev
2229+
```
2230+
2231+
</details>
2232+
2233+
<details>
2234+
<summary>Instructions: Mac Os/Clang</summary>
2235+
2236+
Download GLFW3 from https://www.glfw.org
2237+
2238+
</details>
2239+
2240+
<details>
2241+
<summary>Instructions: Windows/MSVC</summary>
2242+
2243+
Download GLFW3 from https://www.glfw.org
2244+
2245+
</details>
2246+
22132247
You can see all dependencies in [`source/3rd_party/CMakeLists.txt`](source/3rd_party/CMakeLists.txt).
22142248

22152249
#### Build the Examples
22162250

2251+
This will build the examples in the `build/examples` directory:
2252+
22172253
```bash
22182254
mkdir build
22192255
cmake -version
2220-
cmake .. -DCMAKE_BUILD_TYPE=Release
2256+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2"
22212257
cmake --build . -j 2 --config Release
22222258
```
22232259

2260+
On windows, replace `-O2` with `/O2`.
2261+
22242262
#### Installing Matplot++ from Source
22252263

22262264
This will install Matplot++ on your system:
22272265

22282266
```bash
22292267
mkdir build
22302268
cmake -version
2231-
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
2269+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2" -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
22322270
cmake --build . -j 2 --config Release
22332271
cmake --install .
22342272
```
22352273

2236-
You might need `sudo` for this last command.
2274+
On windows, replace `-O2` with `/O2`. You might need `sudo` for this last command.
22372275

22382276
#### Building the packages
22392277

2240-
This will create packages you can use to install Matplot++ on your system:
2278+
This will create the binary packages you can use to install Matplot++ on your system:
22412279

22422280
```bash
22432281
mkdir build
22442282
cmake -version
2245-
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
2283+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2" -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
22462284
cmake --build . -j 2 --config Release
22472285
cmake --install .
22482286
cpack .
22492287
```
22502288

2251-
You might need `sudo` for this last command.
2289+
On windows, replace `-O2` with `/O2`. You might need `sudo` for this last command.
22522290

22532291
### CMake targets
22542292

@@ -2388,6 +2426,15 @@ There are many ways in which you can contribute to this library:
23882426
* Finding bugs in general <sup>see [1](https://github.com/alandefreitas/matplotplusplus/issues?q=is%3Aopen+is%3Aissue+label%3A%22bug+-+compilation+error%22), [2](https://github.com/alandefreitas/matplotplusplus/issues?q=is%3Aopen+is%3Aissue+label%3A%22bug+-+compilation+warning%22), [3](https://github.com/alandefreitas/matplotplusplus/issues?q=is%3Aopen+is%3Aissue+label%3A%22bug+-+runtime+error%22), [4](https://github.com/alandefreitas/matplotplusplus/issues?q=is%3Aopen+is%3Aissue+label%3A%22bug+-+runtime+warning%22) </sup>
23892427
* Whatever idea seems interesting to you
23902428

2429+
If contributing with code, please leave the OpenGL backend and pedantic mode ON (`-DBUILD_EXPERIMENTAL_OPENGL_BACKEND=ON -DBUILD_WITH_PEDANTIC_WARNINGS=ON`).
2430+
2431+
<details>
2432+
<summary>Example: CLion</summary>
2433+
2434+
![CLion Settings with Pedantic Mode](./documentation/img/pedantic_clion.png)
2435+
2436+
</details>
2437+
23912438
### Contributors
23922439

23932440
<!-- readme: collaborators,contributors -start -->

0 commit comments

Comments
 (0)