-
Notifications
You must be signed in to change notification settings - Fork 32
Installation
How to get and compile hi_class, and how to install the Python wrapper.
- A C compiler (
gccby default;iccandpgccare supported via the Makefile). - For the Python wrapper: Python 3 with
numpy,cython,setuptoolsandwheel(they are declared as build requirements and pulled in automatically when installing with pip).
git clone https://github.com/hiclass-code/hi_class_public.git
cd hi_class_publicor download the zip of the latest release.
make classproduces the class executable. Compiler, optimization flags (OPTFLAG = -O3 by default) and OpenMP are set at the top of the Makefile — uncomment -fopenmp in OMPFLAG to enable parallel execution.
Test the build:
./class gravity_models/brans_dicke.iniThe wrapper is the CLASS classy module renamed to hiclassy, extended with hi_class functionality (see Python wrapper). Build the C library and install the module in one step:
PYTHON=python3 make all(make all builds class, libclass.a and then runs pip install . for the wrapper; the PYTHON= prefix is only needed if plain python is not your Python 3.) Equivalently, run pip install . directly from the repository root — its build step compiles libclass.a for you. Installing into a virtual environment is recommended. Then:
from hiclassy import HiClassAlternatively, a prebuilt wrapper is published on PyPI as hiclassy:
pip install hiclassywhich provides from hiclassy import HiClass. PyPI carries a source distribution rather than a wheel, so pip still compiles the C code locally (gcc and make required, a few minutes); what you save is managing the repository. For hands-on work with the source tree, the locally built classy is preferred.
- Running hi_class — input files, the Ω_smg budget convention, the shipped examples.
- Python wrapper — usage and the hi_class-specific methods.
Getting started
Models
Reference
Development
Background
External