Installation¶
kronrod can be installed from PyPI, GitHub, or built from source.
Prerequisites¶
- Python 3.10+
- NumPy (installed automatically as a dependency)
For source builds you additionally need:
- A C compiler (
gccorclang) mesonandmeson-pythonbuild systemnumpy(forf2pycompilation)
PyPI¶
For using the PyPI package in your project, add the following to your configuration file:
[project]
dependencies = [
"kronrod"
]
kronrod
pip¶
pip install --upgrade kronrod
uv¶
# Add to a uv project
uv add kronrod
# Or install into the current environment
uv pip install kronrod
pipenv¶
pipenv install kronrod
poetry¶
poetry add kronrod
pdm¶
pdm add kronrod
hatch¶
hatch add kronrod
git¶
Install the latest development version directly from the repository:
pip install --upgrade "git+https://github.com/eggzec/kronrod.git#egg=kronrod"
Building locally¶
Clone and build from source to modify the C code or test local changes:
git clone https://github.com/eggzec/kronrod.git
cd kronrod
uv pip install .
This invokes the meson build system to compile the C sources via f2py
and install the resulting extension module.
C compiler required
Source builds require a working C compiler. On most Linux distributions,
install gcc:
Verifying the installation¶
After installation, verify that the package loads correctly:
import kronrod
x, w1, w2 = kronrod.kronrod(3)
print(x) # [0.96049127 0.77459667 0.43424375 0. ]
print(w1) # [0.10465623 0.26848809 0.40139741 0.45091654]
print("kronrod is working!")
Dependencies¶
- Python >=3.10
- numpy