netgen
netgen copied to clipboard
Some dependencies not reflected by cmake options
This issue is about version 6.2.2204, but should still apply to current HEAD.
I noticed, that the cmake options USE_JPEG, USE_MPEG and USE_PYTHON seem to need to depend on USE_GUI. If USE_GUI=OFF you will have two different outcomes:
- in the case of
USE_JPEGandUSE_MPEGthe user probably has libraries installed, not actually needed by netgen, the ffmpeg and / or jpeg libraries. Both are only linked to the resultingnetgenbinary, but not to either oflibngcore.soorlibnglib.so - for
USE_PYTHONthe case is more severe, as thepython/gui.pyfile importslibngguipymodule without checking whetherUSE_GUIis set, thus it will likely result in a runtime error, as thelibngguipy.sois only built and installed whenUSE_GUI=ON.
Currently the package can successfully be built and installed with only one of these three options set. I've tested this with
cmake -DUSE_CCACHE=OFF -DUSE_CGNS=OFF -DUSE_GUI=no -DUSE_INTERNAL_TCL=OFF -DUSE_JPEG=yes -DUSE_MPEG=no -DUSE_NATIVE_ARCH=OFF -DUSE_MPI=no -DUSE_OCC=no -DUSE_PYTHON=no -DUSE_SUPERBUILD=OFF -DUSE_MPI4PY=OFF
respectively with enabling only USE_MPEG or USE_PYTHON.
I suppose, simply using cmake_dependent_option depending on USE_GUI for the three cases would be enough. I haven't checked, if the code in gui.py could be adapted.