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
+18-34
Original file line number
Diff line number
Diff line change
@@ -202,39 +202,34 @@ If, for some reason, you're unable to get a working installation of numpy on you
202
202
you can define the macro `WITHOUT_NUMPY` before including the header file to erase this
203
203
dependency.
204
204
205
-
The C++-part of the library consists of the single header file `matplotlibcpp.h` which can be placed
206
-
anywhere.
205
+
The C++-part of the library consists of the single header file `matplotlibcpp.h` which
206
+
can be placed anywhere.
207
207
208
-
Since a python interpreter is opened internally, it is necessary to link against `libpython` in order
209
-
to user matplotlib-cpp. Most versions should work, although `libpython2.7` and `libpython3.6` are
210
-
probably the most regularly testedr.
208
+
Since a python interpreter is opened internally, it is necessary to link
209
+
against `libpython` in order to user matplotlib-cpp. Most versions should
210
+
work, although python likes to randomly break compatibility from time to time
211
+
so some caution is advised when using the bleeding edge.
211
212
212
213
213
214
# CMake
214
215
215
-
If you prefer to use CMake as build system, you will want to add something like this to your
216
-
CMakeLists.txt:
216
+
The C++ code is compatible to both python2 and python3. However, the `CMakeLists.txt`
217
+
file is currently set up to use python3 by default, so if python2 is required this
218
+
has to be changed manually. (a PR that adds a cmake option for this would be highly
219
+
welcomed)
217
220
218
-
**Recommended way (since CMake 3.12):**
221
+
**NOTE**: By design (of python), only a single python interpreter can be created per
222
+
process. When using this library, *no other* library that is spawning a python
223
+
interpreter internally can be used.
219
224
220
-
It's easy to use cmake official [docs](https://cmake.org/cmake/help/git-stage/module/FindPython2.html#module:FindPython2) to find Python 2(or 3) interpreter, compiler and development environment (include directories and libraries).
225
+
To compile the code without using cmake, the compiler invocation should look like
226
+
this:
221
227
222
-
NumPy is optional here, delete it from cmake script, if you don't need it.
0 commit comments