@@ -41,7 +41,6 @@ Data visualization can help programmers and scientists identify trends in their
41
41
- [ Contributing] ( #contributing )
42
42
- [ Contributors :sparkles : ] ( #contributors-sparkles )
43
43
- [ References] ( #references )
44
- - [ Contributors :sparkles : ] ( #contributors-sparkles-1 )
45
44
46
45
</details >
47
46
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -2026,12 +2025,132 @@ If you are interested in understanding how the library works, you can read the d
2026
2025
2027
2026
### Dependencies
2028
2027
2029
- The build script will try to find all these dependencies for you:
2028
+ This section lists the dependencies you need before installing Matplot++ from source. The build script will try to find all these dependencies for you:
2030
2029
2031
2030
* C++17
2032
2031
* CMake 3.14+
2033
- * Required at runtime
2034
- * Gnuplot 5.2.6+
2032
+ * Gnuplot 5.2.6+ (Required at runtime)
2033
+
2034
+ <details >
2035
+ <summary>Linux/Ubuntu/GCC:</summary>
2036
+
2037
+ Check your GCC version:
2038
+
2039
+ ``` bash
2040
+ g++ --version
2041
+ ```
2042
+
2043
+ The output should be something like:
2044
+
2045
+ ``` console
2046
+ g++-8 (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
2047
+ ```
2048
+
2049
+ If you see a version before GCC-8, update it with
2050
+
2051
+ ``` bash
2052
+ sudo apt update
2053
+ sudo apt install gcc-8
2054
+ sudo apt install g++-8
2055
+ ```
2056
+
2057
+ To update to any other version, like GCC-9 or GCC-10:
2058
+
2059
+ ``` bash
2060
+ sudo apt install build-essential
2061
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
2062
+ sudo apt-get update
2063
+ sudo apt install g++-10
2064
+ ```
2065
+
2066
+ Once you installed a newer version of GCC, you can link it to ` update-alternatives ` . For instance, if you have GCC-7 and GCC-10, you can link them with:
2067
+
2068
+ ``` bash
2069
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
2070
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
2071
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
2072
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
2073
+ ```
2074
+
2075
+ You can now use ` update-alternatives ` to set you default ` gcc ` and ` g++ ` :
2076
+
2077
+ ``` bash
2078
+ update-alternatives --config g++
2079
+ update-alternatives --config gcc
2080
+ ```
2081
+
2082
+ Check your CMake version:
2083
+
2084
+ ``` bash
2085
+ cmake --version
2086
+ ```
2087
+
2088
+ If it's older than CMake 3.14, update it with
2089
+
2090
+ ``` bash
2091
+ sudo apt upgrade cmake
2092
+ ```
2093
+
2094
+ or download the most recent version from [ cmake.org] ( https://cmake.org/ ) .
2095
+
2096
+ Later when running CMake, make sure you are using GCC-8 or higher.
2097
+
2098
+ ``` bash
2099
+ -DCMAKE_C_COMPILER=/usr/bin/gcc-8 -DCMAKE_CXX_COMPILER=/usr/bin/g++-8
2100
+ ```
2101
+
2102
+ Install Gnuplot: www.gnuplot.info
2103
+
2104
+ Make sure you mark the option "Add application directory to your PATH environment variable".
2105
+
2106
+ </details >
2107
+
2108
+ <details >
2109
+ <summary>Mac Os/Clang</summary>
2110
+
2111
+ Check your Clang version:
2112
+
2113
+ ``` bash
2114
+ clang --version
2115
+ ```
2116
+
2117
+ The output should have something like
2118
+
2119
+ ``` console
2120
+ Apple clang version 11.0.0 (clang-1100.0.33.8)
2121
+ ```
2122
+
2123
+ If you see a version before Clang 11, update XCode in the App Store or update clang with homebrew.
2124
+
2125
+ Check your CMake version:
2126
+
2127
+ ``` bash
2128
+ cmake --version
2129
+ ```
2130
+
2131
+ If it's older than CMake 3.14, update it
2132
+
2133
+ ``` bash
2134
+ sudo brew upgrade cmake
2135
+ ```
2136
+
2137
+ or download the most recent version from [ cmake.org] ( https://cmake.org/ ) .
2138
+ If building the Python bindings, check your Python version:
2139
+ Install Gnuplot: www.gnuplot.info
2140
+
2141
+ Make sure you mark the option "Add application directory to your PATH environment variable".
2142
+
2143
+ </details >
2144
+
2145
+ <details >
2146
+ <summary>Instructions: Windows/MSVC</summary>
2147
+
2148
+ * Make sure you have a recent version of Visual Studio.
2149
+ * Download and install Git.
2150
+ * Install CMake from https://cmake.org/download/
2151
+ * Install Gnuplot: www.gnuplot.info
2152
+
2153
+ </details >
2035
2154
2036
2155
It will also look for these * optional* dependencies for manipulating images:
2037
2156
@@ -2059,7 +2178,7 @@ There's an extra target `matplot_opengl` with the experimental OpenGL backend. Y
2059
2178
2060
2179
You can see all dependencies in [ ` source/3rd_party/CMakeLists.txt ` ] ( source/3rd_party/CMakeLists.txt ) .
2061
2180
2062
- ### Build the examples
2181
+ ### Build the Examples
2063
2182
2064
2183
``` bash
2065
2184
mkdir build
@@ -2068,25 +2187,46 @@ cmake .. -DCMAKE_BUILD_TYPE=Release
2068
2187
cmake --build . -j 2 --config Release
2069
2188
```
2070
2189
2071
- ### Installing
2190
+ ### Installing Matplot++ from Source
2191
+
2192
+ This will install Matplot++ on your system:
2193
+
2194
+ ``` bash
2195
+ mkdir build
2196
+ cmake -version
2197
+ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
2198
+ cmake --build . -j 2 --config Release
2199
+ cmake --install .
2200
+ ```
2201
+
2202
+ You might need ` sudo ` for this last command.
2203
+
2204
+ ### Building the packages
2205
+
2206
+ This will create packages you can use to install Matplot++ on your system:
2072
2207
2073
2208
``` bash
2074
2209
mkdir build
2075
2210
cmake -version
2076
2211
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
2077
2212
cmake --build . -j 2 --config Release
2078
2213
cmake --install .
2214
+ cpack .
2079
2215
```
2080
2216
2081
- ### As a CMake package
2217
+ You might need ` sudo ` for this last command.
2218
+
2219
+ ### Find it as a CMake Package
2082
2220
2083
- If you have library installed, you can call
2221
+ If you have the library installed, you can call
2084
2222
2085
2223
``` cmake
2086
2224
find_package(Matplot++)
2087
2225
```
2088
2226
2089
- from your CMake build script. When creating your executable, link the library to the targets you want:
2227
+ from your CMake build script.
2228
+
2229
+ When creating your executable, link the library to the targets you want:
2090
2230
2091
2231
```
2092
2232
add_executable(my_target main.cpp)
@@ -2099,15 +2239,21 @@ Add this header to your source files:
2099
2239
#include < matplot/matplot.h>
2100
2240
```
2101
2241
2102
- ### As a CMake subdirectory
2242
+ ### Use it as a CMake subdirectory
2103
2243
2104
- Check if you have [ Cmake] ( http://cmake.org ) 3.14+ installed:
2244
+ You can use Matplot++ directly in CMake projects without installing it. Check if you have [ Cmake] ( http://cmake.org ) 3.14+ installed:
2105
2245
2106
2246
``` bash
2107
2247
cmake -version
2108
2248
```
2109
2249
2110
- Download the whole project and add the subdirectory to your CMake project:
2250
+ Clone the whole project
2251
+
2252
+ ``` bash
2253
+ git clone https://github.com/alandefreitas/matplotplusplus/
2254
+ ```
2255
+
2256
+ and add the subdirectory to your CMake project:
2111
2257
2112
2258
``` cmake
2113
2259
add_subdirectory(matplotplusplus)
@@ -2124,7 +2270,7 @@ Add this header to your source files:
2124
2270
2125
2271
``` cpp
2126
2272
#include < matplot/matplot.h>
2127
- ```
2273
+ ```
2128
2274
2129
2275
### CMake with Automatic Download
2130
2276
@@ -2196,47 +2342,10 @@ There are many ways in which you can contribute to this library:
2196
2342
* 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 >
2197
2343
* Whatever idea seems interesting to you
2198
2344
2199
- ## Contributors :sparkles :
2200
- <table >
2201
- <tr >
2202
- <td align="center">
2203
- <a href="https://github.com/alandefreitas">
2204
- <img src="https://avatars0.githubusercontent.com/u/5369819?v=4" width="100;" alt="alandefreitas"/>
2205
- <br />
2206
- <sub><b>Alan De Freitas</b></sub>
2207
- </a>
2208
- </td>
2209
- <td align="center">
2210
- <a href="https://github.com/mrexodia">
2211
- <img src="https://avatars2.githubusercontent.com/u/2458265?v=4" width="100;" alt="mrexodia"/>
2212
- <br />
2213
- <sub><b>Duncan Ogilvie</b></sub>
2214
- </a>
2215
- </td>
2216
- <td align="center">
2217
- <a href="https://github.com/lacc97">
2218
- <img src="https://avatars1.githubusercontent.com/u/23489037?v=4" width="100;" alt="lacc97"/>
2219
- <br />
2220
- <sub><b>Luis CC!ceres</b></sub>
2221
- </a>
2222
- </td>
2223
- <td align="center">
2224
- <a href="https://github.com/sammi">
2225
- <img src="https://avatars0.githubusercontent.com/u/189128?v=4" width="100;" alt="sammi"/>
2226
- <br />
2227
- <sub><b>Sammi</b></sub>
2228
- </a>
2229
- </td>
2230
- <td align="center">
2231
- <a href="https://github.com/dimztimz">
2232
- <img src="https://avatars0.githubusercontent.com/u/6236568?v=4" width="100;" alt="dimztimz"/>
2233
- <br />
2234
- <sub><b>Dimitrij Mijoski</b></sub>
2235
- </a>
2236
- </td></tr>
2237
- </table >
2238
-
2345
+ ### Contributors
2239
2346
2347
+ <!-- readme: collaborators,contributors -start -->
2348
+ <!-- readme: collaborators,contributors -end -->
2240
2349
2241
2350
## References
2242
2351
@@ -2349,43 +2458,3 @@ There are many ways in which you can contribute to this library:
2349
2458
* Zaitsev S (2020). Webview. URL: [ https://github.com/zserge/webview ] ( https://github.com/zserge/webview ) .
2350
2459
2351
2460
* Zakai A (2011). "Emscripten: an LLVM-to-JavaScript compiler." In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, pp. 301-312.
2352
- ## Contributors :sparkles :
2353
- <table >
2354
- <tr >
2355
- <td align="center">
2356
- <a href="https://github.com/alandefreitas">
2357
- <img src="https://avatars0.githubusercontent.com/u/5369819?v=4" width="100;" alt="alandefreitas"/>
2358
- <br />
2359
- <sub><b>Alan De Freitas</b></sub>
2360
- </a>
2361
- </td>
2362
- <td align="center">
2363
- <a href="https://github.com/mrexodia">
2364
- <img src="https://avatars2.githubusercontent.com/u/2458265?v=4" width="100;" alt="mrexodia"/>
2365
- <br />
2366
- <sub><b>Duncan Ogilvie</b></sub>
2367
- </a>
2368
- </td>
2369
- <td align="center">
2370
- <a href="https://github.com/lacc97">
2371
- <img src="https://avatars1.githubusercontent.com/u/23489037?v=4" width="100;" alt="lacc97"/>
2372
- <br />
2373
- <sub><b>Luis Cáceres</b></sub>
2374
- </a>
2375
- </td>
2376
- <td align="center">
2377
- <a href="https://github.com/sammi">
2378
- <img src="https://avatars0.githubusercontent.com/u/189128?v=4" width="100;" alt="sammi"/>
2379
- <br />
2380
- <sub><b>Sammi</b></sub>
2381
- </a>
2382
- </td>
2383
- <td align="center">
2384
- <a href="https://github.com/dimztimz">
2385
- <img src="https://avatars0.githubusercontent.com/u/6236568?v=4" width="100;" alt="dimztimz"/>
2386
- <br />
2387
- <sub><b>Dimitrij Mijoski</b></sub>
2388
- </a>
2389
- </td></tr>
2390
- </table >
2391
-
0 commit comments