[feature][PythonCompiler] Compile Pythton modules without cmake.
The use of cmake for every single Python module requires frequent running of cmake and locking of the dune-py directory. This has also prevented parallel compilation. This MR solves this problem by compiling the Python modules in dune-py directly using the compiler/linker command provided by cmake.
Idea: we use cmake to build dune-py
and have one target extractCompiler
in python/dune/generated
. This target is build and the files/output from cmake is used to extract compiler/linker commands. These are added into a script buildScript.sh
. Finally the -M*
switches of the compilers are used to generate dependency files for new targets which are added into a standard makefile per new module.
To build a new module we only need to run make
and not cmake anymore. This avoids any need to lock the module.
In addition to the reduced locking the whole process (especially of loading existing modules) seems more snappy than before.
Main addition:
a new builder class in python/dune/generated/cmakebuilder.py
called MakefileBuilder
. This is the default used in python/dune/generated/__init__.py
but one can use an environment variable to switch back to the old builder.