This uses meson-python to build orbit package.
There is no setup.py file, instead we have meson.build. pyproject.toml is changed to use meson.
This is experimental setup that is work in progress. The pure python part is built with hierarchical meson.build files in py/. The C++ setup is combined in one file src/meson.build.
- src/libmain/ is not used, still there for reference but will be gone soon.
- src/core/ contains one C++ file per module inside orbit.core
- The files wrap_XXXX.cc were modified to correctly reference modules
// line
PyObject* mod = PyImport_ImportModule("_bunch");
// replaced with
PyObject* mod = PyImport_ImportModule("orbit.core.bunch");
One needs compilers, python and libfftw (and potentially mpi). See PyORBIT3 for external requirements.
First step is to clone the source code from meson branch:
git clone -b meson https://github.com/azukov/PyORBIT3.git
Initialize new virtual environment and install packages
python -m venv .mes
source .mes/bin/activate
pip install -U pip
pip install -r requirements
Edit meson.build and set correct paths/flags for python/fftw3 headers and libraries
To install orbit package in development mode run following:
pip install --no-build-isolation --editable .
No rebuild is necessary, just edit py/ or src/ and meson will rebuild as needed when import happens.
Special examples used for meson testing
cd examples/meson
python imports_test.py
python uspas_test.py
SNS linac example
cd examples/SNS_Linac/pyorbit3_linac_model/
python pyorbit3_sns_linac_mebt_hebt2.py