@@ -7,18 +7,56 @@ My experiments with C++ extensions for python using pybind11.
77
88** ⚠️This code is very WIP and will change frequently and in unpredictable ways⚠️**
99
10- # Notes:
11- To build the cpp package execute the following:
12- - ` mkdir build `
13- - ` cd build `
14- - ` cmake .. -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -DCMAKE_INSTALL_PREFIX:PATH=.. `
15- - ` make install `
16-
17- To build the project using [ scikit-build-core] ( https://github.com/scikit-build/scikit-build-core ) simply do ` pip install -e . `
18-
19- Notes:
20- - -DCMAKE_INSTALL_PREFIX: PATH is set to .. to make the path in the install command in
21- the CMakeLists.txt file relative to the location of the file.
10+ # Prerequisites
11+
12+ - ** Python 3.8–3.10** with ` pip ` (version 22+ recommended for editable installs)
13+ - ** CMake** (>= 3.16)
14+ - ** Armadillo** C++ linear algebra library — install via your package manager:
15+ - macOS: ` brew install armadillo `
16+ - Ubuntu/Debian: ` sudo apt install libarmadillo-dev `
17+ - ** A C++17 compiler** (e.g. AppleClang, GCC, MSVC)
18+
19+ # Build
20+
21+ ## Option 1: scikit-build-core (recommended)
22+
23+ 1 . Initialize git submodules (required for carma):
24+
25+ ``` bash
26+ git submodule update --init --recursive
27+ ```
28+
29+ 2 . Install the project in editable mode:
30+
31+ ``` bash
32+ pip install -e " .[dev]"
33+ ```
34+
35+ ## Option 2: Manual cmake build
36+
37+ 1 . Initialize git submodules (required for carma):
38+
39+ ``` bash
40+ git submodule update --init --recursive
41+ ```
42+
43+ 2 . Install Python build dependencies:
44+
45+ ``` bash
46+ pip install " pybind11[global]>=2.6.0" " numpy>=1.14"
47+ ```
48+
49+ 3 . Build with cmake:
50+
51+ ``` bash
52+ mkdir build
53+ cd build
54+ cmake .. -DPYTHON_EXECUTABLE=$( python3 -c " import sys; print(sys.executable)" ) -DCMAKE_INSTALL_PREFIX:PATH=..
55+ make install
56+ ```
57+
58+ > ** Note:** ` -DCMAKE_INSTALL_PREFIX:PATH ` is set to ` .. ` to make the path in the install
59+ > command in the CMakeLists.txt file relative to the location of the file.
2260
2361# TODOs:
2462- [X] use scikit-build-core to compile the C++ modules
0 commit comments