I have another repository oriented-particles
which is in C++. Here I generate Python bindings for a subset of the C++ code. The goal is to learn making Python bindings. It is also helpful to have the core libraries in fast C++ and to write drivers in Python using h5py
, pandas
etc. for managing input/output of the program.
- Install MSYS2 and then using the MSYS2 shell install the following packages:
- mingw-w64-x86_64-toolchain
- mingw-w64-x86_64-vtk
- mingw-w64-x86_64-cgal
- mingw-w64-x86_64-eigen3
- If you have installed MSYS2 as per defaults then your
MSYS2_ROOT=C:\msys64
. You need to fix the hardcoded file paths in the following files:${MSYS2_ROOT}/mingw64/lib/cmake/Qt5Gui/Qt5GuiConfixExtras.cmake
: Look for line starting with_qt5gui_find_extra_libs
.${MSYS2_ROOT}/mingw64/lib/cmake/CGAL/CGALExports.cmake
: Look for line starting withset_target_properties
.
- You will also need to use the CMake initial cache file provided in the root directory of this project
InitCacheMSYS2.cmake
by passing it to CMake e.g.cmake -c InitCacheMSYS2.cmake /path/to/ops-python
.
- You will have to build CGAL from source as the release in the repository is 4.11 and we need 4.14.
- You will have to pass a flag to CMake to be able to link the static Fortran solver library built in this project with the final dynamic Python module library. You should invoke CMake as
cmake -DCMAKE_Fortran_FLAGS="-fPIC" /path/to/ops-python
.
- It should be relatively straightforward if the latest version of CGAL is installed.