[added to !932] WIP: set correct cmake dir in module.py for installed dune modules
Merge request reports
Activity
mentioned in merge request infrastructure/dune-nightly-test!1 (closed)
The assumption is that "installed modules can be found via pkg-config" (see also
dunemodules.lib
). Why should this be the case?pkg-config
searches in default locations, but if the module is installed in a non-default location, how should pkg-config find the .pc file?The
dunecontrol
script sets the environmental variablePKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PREFIX_DIR/lib/pkgconfig"
withPREFIX_DIR="$(canonicalpath "$0")/.."
, i.e., one directory above thedunecontrol
script.So, this is different from the
module.py
file. Neither thePREFIX_PATH
nor thePKG_CONFIG_PATH
are set. What should be the appropriate values for these?I remember that we had the same problem with the pip installed module in the virtual env which of course were not found without the PKG_CONFIG_PATH. I remembered that we modified the path in
setup-dunepy.py
in exactly the way you describe i.e., somehow relavtive to the setup-dunepy.py location. But we removed that again and replaced it withos.path.join(get_local(),'lib','dunecontrol']
whereget_local
is the path to the virtual env or ~/.local.One idea could be to add a hint for pkg-config (a path that is added to the PKG_CONFIG_PATH variable in the call to pkg-config). This hint could be filled with a path computed from the location of the dune.module file. If it is an installed module, it is located in something like
<prefix>/lib/dunecontrol/<module>
and the .pc file is located in<prefix>/lib/pkgconfig
. A module in the source dir does not have such a directory structure. So one could distinguish between these two installation types. Or (for the ci-test) I simply set thePKG_CONFIG_PATH
to the location where to find the .pc files, manually.Edited by Simon PraetoriusFor the tutorial I am just working on using the
setup-dunepy
script to build the dune-py module before running the tests - there I can pass the config opts file as a parameter similar to dunecontrol and the problem doesn't come up. But it definitely would be good to get the 'create dune-py on first import of a dune package' approach to work without having to define a lot of environment variables. I was always hoping one could add a 'cmakeflags.py.in' file to the 'dune-common/python/dune/common' folder with a '@DUNECMAKEFLAGS@ entry that is replace during the configure step of dune-common - but cmake doesn't seem to export that variable. Of course we could replace individual variables there, i.e., CXX and CXXFLAGS for example (at least I hope that is possible?)
mentioned in merge request !928 (closed)
This is included in !928 (closed)
mentioned in merge request !932 (merged)
added in !932 (merged)