otilib Setup#
JetGP uses otilib as its OTI (Order Truncated Imaginary)
arithmetic backend. A small set of patches are required before building the library. The
setup_otilib utility automates this entire process.
Prerequisites#
The
jetgpconda environment must be active (see installation).A local clone of otilib:
$ git clone https://github.com/mauriaristi/otilib.git otilib-master
What the setup does#
The setup script always performs steps 1–2, then optionally step 3:
Copies patched source files from
otilib_mods/into otilib-master. The patches add:OpenMP support and
-O1optimization for the static module compile flags (src/CMakeLists.txt)python3Cython build command (src/python/pyoti/CMakeLists.txt)oti.empty()uninitialized array allocator (creators.pxi)OpenMP thread query imports (
include.pxi){arr_get_all_derivs}expansion to the array base template (array_base.pxi)JetGP’s
cmod_writer.pyto both otilib locations (build/pyoti/andsrc/python/pyoti/python/)The
regenerate_all_c.pyandbuild_static.pybuild scripts (build/), with static Cython extension builds using-O1
Rewrites hardcoded absolute paths in the otilib build scripts (
regenerate_all_c.py,build_static.py,rebuild_all_static.py,rebuild_all_static.sh) to match your machine’s otilib location and active Python executable. It also patches otilib’s top-level release C flags and Cythonsetup.py.intemplate from-O3to-O1and saves the otilib path to~/.config/jetgp/otilib_pathfor runtime auto-detection.Full build (only when
--buildis passed):Regenerates all C/Cython sources from templates
Runs
cmake ..,make -j<workers>, andmake gendataWrites a
.pthfile into site-packages so thatpyotiis importable directly fromotilib-master/build/(equivalent toconda develop .)Compiles all Cython static modules in parallel —
.sofiles land inotilib-master/build/pyoti/static/and are immediately importable
Usage#
With the jetgp environment active and from the jetgp directory, run:
$ python -m jetgp.setup_otilib --otilib ../otilib-master --build --workers 8
This patches otilib with JetGP’s required modifications and runs the full build.
To patch without building, omit --build.
File map#
The following files are copied from otilib_mods/ during setup:
File in |
Destination in otilib-master |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|