-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spack
: Add ${PUGIXML_INCLUDE_DIR}
to target_include_directories
#3
base: master
Are you sure you want to change the base?
Conversation
…ed for spack) When `pugixml` is not installed in a standard location (e.g. use pugixml build by spack), the include directory needs to be added to the target's include dirs.
@prudhomm: FYI, this blocks adding a generally working feelpp to spack. |
thanks I believe that it is best to push that to upstream. We do not want to diverge |
@prudhomm wrote:
Maybe there is some misunderstanding (or maybe not), I don't yet know for sure, or in which direction. To clarify and restart, I try to re-phrase what I tried to say: In these changes in the upstream merge of NTNU-IHB#139, upstream improved the way(s) that upstream can find the path to the These changes set or provide PUGIXML_INCLUDE_DIR and try to export it as an interface to downstream packages like If For this reason, I tried to export it using this minimal patch here. This may be used as mitigation (using a patch) in But as you say correctly, it's better not to diverge from the upstream https://github.com/NTNU-IHB/FMI4cpp. I haven't tested the upstream change in spack, but it looks like the most modern way to fix this issue using the modern CMake way using cmake target-specific interfaces for downstream packages like feelpp. Such modern CMake methods may not work in very old CMake versions, so you may need to raise the minimum CMake version requirement along with it if you update your fork of https://github.com/NTNU-IHB/FMI4cpp. I just wanted to point out what I understood what I saw while triaging this build issue. The minimal one-line patch that I posted with this PR is only to provide a working fix for the current code base that I've tested to work in in the spack environment that reproduced the build issue. If the cmake improvement in https://github.com/NTNU-IHB/FMI4cpp/pull/139/files#diff-2bd3d1ab5072e7e84c9bdea1f59038fda719facac5721f1ba2ee9a39eb139bfeL8-R28 works for a spack build, then you could use this instead, only if their https://github.com/NTNU-IHB/FMI4cpp/pull/139/files#diff-2bd3d1ab5072e7e84c9bdea1f59038fda719facac5721f1ba2ee9a39eb139bfeL8-R28 is not enough to fix a failing spack build on a freshly installed VM or host, then pushing that change to upstream would be needed. The smallest change to fix the spack build would be to add this minimal change here as a local patch to the spack recipe that builds this fork. I hope I could do it, but there are so many But, it would be good to know if you would approve of this one-line fixup patch (like spack carries such small fixups to fix builds in general) to be added to the spack build for fixing the build of spack/spack#46396 (review) that failed while reviewing the PR for feelpp in spack. |
I just saw: spack/spack#46396 (comment)
Great, I'll wait for your updates to be pushed! |
@bernhardkaindl I believe we can simplify the CMake configuration by removing the explicit PUGIXML_INCLUDE_DIR from target_include_directories. Since we’re linking to pugixml::pugixml in target_link_libraries, CMake automatically handles the include directories associated with pugixml. This way, we rely on CMake’s target properties to manage dependencies, reducing redundancy and potential errors. |
I just checked the pugixml installed by spack and that's what it does. |
@bernhardkaindl I just checked fmi4cpp and indeed libzip and pugixml are added privately via target_link_libraries |
@bernhardkaindl I created a package for fmi4cpp waiting for review here : spack/spack#47240 |
I also made a PR for fmi4cpp regarding the MPI addon to avoid unzipping possibly thousands of FMU in parallel |
@prudhomm
When
pugixml
is not installed in a standard location (e.g. usepugixml
build byspack
),the
include
directory needs to be added to the target'sinclude
directoriesSee the PR for adding a
feelpp
recipe intospack
at spack/spack#46396 (review) for more info.A different way to do this would be like upstream does meanwhile:
https://github.com/NTNU-IHB/FMI4cpp/blob/71d30042e4044bdd12ccf9fa756046b801e46502/cmake/FindPugiXML.cmake#L26
See this for the diff:
master...NTNU-IHB:FMI4cpp:master#diff-2bd3d1ab5072e7e84c9bdea1f59038fda719facac5721f1ba2ee9a39eb139bfeR24-R28
Maybe it's better so sync / merge with the upstream?