@@ -20,3 +20,36 @@ np.array([1,2,3], dtype=QuadPrecDType("sleef"))
20
20
# using longdouble backend
21
21
np.array([1 ,2 ,3 ], dtype = QuadPrecDType(" longdouble" ))
22
22
```
23
+
24
+ ## Install from source
25
+
26
+ The code needs the quad precision pieces of the sleef library, which
27
+ is not available on most systems by default, so we have to generate
28
+ that first. The below assumes one has the required pieces to build
29
+ sleef (cmake and libmpft-dev), and that one is in the package
30
+ directory locally.
31
+
32
+ ```
33
+ git clone https://github.com/shibatch/sleef.git
34
+ cd sleef
35
+ cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
36
+ cmake --build build/ --clean-first -j
37
+ cd ..
38
+ ```
39
+
40
+ In principle, one can now install this system-wide, but easier would
41
+ seem to use the version that was just created, as follows:
42
+ ```
43
+ export SLEEF_DIR=$PWD/sleef/build
44
+ python3 -m venv temp
45
+ source temp/bin/activate
46
+ pip install meson-python numpy pytest
47
+ DFLAGS="-Wl,-rpath,$SLEEFDIR/lib -I$SLEEF_DIR/include" python -m pip install -e . -v --no-build-isolation
48
+ export LD_LIBRARY_PATH=SLEEF_DIR/lib
49
+ ```
50
+
51
+ Here, we created an editable install on purpose, so one can just work
52
+ from the package directory if needed, e.g., to run the tests with,
53
+ ```
54
+ python -m pytest
55
+ ```
0 commit comments