1
1
# Numpy-QuadDType
2
2
3
+ A cross-platform Quad (128-bit) float Data-Type for NumPy.
4
+
3
5
## Installation
4
6
5
- ```
6
- pip install numpy==2.1.0
7
- pip install -i https://test.pypi.org/simple/ quaddtype
7
+ ``` bash
8
+ pip install numpy
9
+ pip install numpy- quaddtype
8
10
```
9
11
10
12
## Usage
@@ -21,38 +23,32 @@ np.array([1,2,3], dtype=QuadPrecDType("sleef"))
21
23
np.array([1 ,2 ,3 ], dtype = QuadPrecDType(" longdouble" ))
22
24
```
23
25
24
- ## Install from source
26
+ ## Installation from source
25
27
26
28
The code needs the quad precision pieces of the sleef library, which
27
29
is not available on most systems by default, so we have to generate
28
30
that first. The below assumes one has the required pieces to build
29
31
sleef (cmake and libmpfr-dev), and that one is in the package
30
32
directory locally.
31
33
32
- ```
33
- git clone https://github.com/shibatch/sleef.git
34
+ ``` bash
35
+ git clone --branch 3.8 https://github.com/shibatch/sleef.git
34
36
cd sleef
35
37
cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
36
38
cmake --build build/ --clean-first -j
37
39
cd ..
38
40
```
39
41
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
- ```
42
+ Building the ` numpy-quaddtype ` package from locally installed sleef:
43
+ ``` bash
43
44
export SLEEF_DIR=$PWD /sleef/build
44
45
export LIBRARY_PATH=$SLEEF_DIR /lib
45
46
export C_INCLUDE_PATH=$SLEEF_DIR /include
46
47
export CPLUS_INCLUDE_PATH=$SLEEF_DIR /include
47
- python3 -m venv temp
48
- source temp/bin/activate
48
+
49
+ # Install the package
49
50
pip install meson-python numpy pytest
50
51
pip install -e . -v --no-build-isolation
51
52
export LD_LIBRARY_PATH=$SLEEF_DIR /lib
52
53
```
53
54
54
- Here, we created an editable install on purpose, so one can just work
55
- from the package directory if needed, e.g., to run the tests with,
56
- ```
57
- python -m pytest
58
- ```
0 commit comments