-
Notifications
You must be signed in to change notification settings - Fork 12
Integrate libmfile directly into HDTV #69
Description
Currently non-ROOT file formats are loaded via libmfile (src/hdtv/rootext/mfile-root/mfile).
This library is written in C without dependencies beside the C standard library.
It is compiled together with the mfile-root wrapper and loaded via ROOT.gSystem.Load(...).
But this hasn't to be this way.
To reduce the build-time-compilation of HDTV, libmfile could be precompiled, shipped with the Python package, and loaded via dlopen from Python.
The mfile-root wrapper can be translated to Python (PyROOT).
- Overhaul the libmfile C source
- Modernize the header file (defines -> enums, C generics)
- Unify the Implementation (make the behavior of all file formats the same)
- Implement better error handling (rootext: Reimplement MatOp in pure C++ #53 (comment))
- Align used types (mget* / mput* returns the elements read / written, or -1 on a failure; returning 0 on error would also work and would reduce type casting.
- Build libmfile as part of the Python wheel
- Make sure the wheel is compatible with x86_64 and arm64 manylinux
- Create C bindings for libmfile (with tests)
- Migrate mfile-root (MatOp, MFileHist, VMatrix) from C++ to Python (PyROOT where needed)
- (optional) Migrate libmfile from C to Python
Doing the tasks in this way, the work can be done incrementally.
Task 1 and 2 can be done in parallel. Cleaning up the old code should be done before creating new one.
Loading libmfile via dlopen and creating the the Python interface for it has no influence on the existing program behavior.
Tests can be implemented for the python interface with the existing C library and then be reimplemented under test coverage.