Handle optional dependency SuiteSparse by directly passing HAVE_xxx flags
Summary
This MR tries to solve an issue with localized config.h files as introduces in !1262 (merged) in the handling of optional dependencies. For a package that is found in an upstream module, like dune-common, but that is used for the first time in a downstream module, we cannot fix the flags HAVE_SUITESPARSE
already in upstream. It might be that a user installs SuiteSparse later. This was no problem in the old handling of config.h files when everything is regenerated downstreams, but we want to generate local config.h files in the modules that provide the flags. For purely optional packages, the solution is to introduce the HAVE_SUITESPARSE
flag directly downstream and not with the indirection of an ENABLE_SUITESPARSE
flag.
Necessary changes for module authors
Nothing! everything is changed in the add_dune_suitesparse_flags
macro and the dune_register_package_flags
call. Those are executed in downstream modules as before.
This MR acts as a preprint for changes in other modules that also want to provide purely optional packages that are not used by the module itself, but only by downstream modules. Note that protected headers that are not compiled in a library are still fine to be provided in the upstream module.
Closes #252 (closed)
Merge request reports
Activity
added buildsystem label
- Resolved by Simon Praetorius
18 18 set(HAVE_SUITESPARSE ${SuiteSparse_FOUND}) 19 19 set(HAVE_UMFPACK ${SuiteSparse_UMFPACK_FOUND}) 20 20 21 # collect all components that are found 22 set(SuiteSparse_FOUND_COMPONENTS) 23 foreach(_component ${SUITESPARSE_COMPONENTS}) 24 if(SuiteSparse_${_component}_FOUND) 25 list(APPEND SuiteSparse_FOUND_COMPONENTS ${_component}) 26 endif() 27 endforeach(_component) 28 29 21 30 # register all SuiteSparse related flags 22 31 if(SuiteSparse_FOUND) 32 # set(HAVE_SUITESPARSE_FLAGS "HAVE_SUITESPARSE=1") I checked a lot of modules, but none uses directly
HAVE_SUITESPARSE
. It cannot guarantee that, e.g., the umfpack component is found that is used in a specific code. Thus, one need to checkHAVE_SUITESPARSE_<component>
instead. I would suggest to drop this global variable from the compiler flags.changed this line in version 3 of the diff
mentioned in merge request !1262 (merged)
- Resolved by Simon Praetorius
- Resolved by Simon Praetorius
mentioned in merge request !1298 (merged)
added 20 commits
-
cd26adc1...6b70be95 - 18 commits from branch
master
- 70048909 - Hanel optional dependency SuiteSparse by directly passing HAVE_xxx flags
- 6f80815d - Cleanup the implementation based on review comments
-
cd26adc1...6b70be95 - 18 commits from branch
added 1 commit
- 49f4f384 - Hanel optional dependency SuiteSparse by directly passing HAVE_xxx flags
enabled an automatic merge when the pipeline for 49f4f384 succeeds
mentioned in commit 3846e46a
mentioned in merge request !1308 (merged)
mentioned in merge request !1309 (merged)
mentioned in merge request !1310 (merged)
mentioned in merge request !1268 (closed)
mentioned in merge request !1252 (closed)
mentioned in merge request copasi/dune-copasi!144 (merged)
mentioned in issue #379 (closed)
mentioned in merge request !1434 (merged)