-
Notifications
You must be signed in to change notification settings - Fork 29
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
Use proper include path for cholmod.h. #364
base: develop
Are you sure you want to change the base?
Use proper include path for cholmod.h. #364
Conversation
…n BUILD_WITH_SPARSE flag (ROCm#354) Conditionally include sparse source files based on BUILD_WITH_SPARSE flag (ROCm#353) Refactor CMakeLists.txt to conditionally include sparse source files based on BUILD_WITH_SPARSE flag Co-authored-by: Huanran Wang <[email protected]>
It appears that the `SuiteSparse::CHOLMOD` CMake library advertises its include directory as `$PREFIX/include/suitesparse`, making the proper way to include it `#include <cholmod.h>`. When installed in the system `/usr` prefix, the `suitesparse/cholmod.h` path works by accident. When using a custom built suitesparse at a custom location, this is not so. I believe that this change is the correct way to do it for all configurations, based on how the SuiteSparse library is set up.
Hi @stellaraccident, thanks! I'll have a look at your PR tomorrow, in the meantime, please target the fix at the |
* Adds host-math group and includes OpenBLAS and SuiteSparse in it to provide libcholmod (so that we have the option to avoid system deps for these). * Includes upstream patch ROCm/hipSOLVER#364 * Includes upstream patch ROCm/rocminfo#97 Includes workarounds for #82, #83 --------- Co-authored-by: Stella Laurenzo <[email protected]>
cb286bb
to
3466f65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @stellaraccident, it looks like my week was far busier than anticipated -- apologies for the delay. I see two other changes that are required in order to allow hipSOLVER
to find its Suitesparse dependencies in a general setting:
find_path(CHOLMOD_INCLUDE_DIR suitesparse/cholmod.h) |
should be updated into:
find_path(CHOLMOD_INCLUDE_DIR
NAMES cholmod.h
PATH_SUFFIXES suitesparse
)
find_path(SUITESPARSE_CONFIG_INCLUDE_DIR suitesparse/SuiteSparse_config.h) |
should be updated into:
find_path(SUITESPARSE_CONFIG_INCLUDE_DIR
NAMES SuiteSparse_config.h
PATH_SUFFIXES suitesparse
)
Thanks again for taking the time to make the PR, and please let me know if this works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is wrong, then mea culpa. I'd hoped that Spack would catch this sort of error, but I guess they had a patch for an earlier problem which ended up sidestepping this issue. :(
The bit that confuses me is that the SuiteSparse::CHOLMOD
target is actually quite a new thing in the upstream SuiteSparse project. It didn't exist in older versions, so it's weird that there's an expectation that the user will add an include path to their build flags just to use the OS-provided SuiteSparse headers.
Yeah, it's kind of a head scratcher if trying to unwind how this got this way and ever worked right. The details on this are context switched out of my head, but I have an easy repro to try changes with a local built SuiteSparse. |
@stellaraccident, I've opened a pr with the changes I suggested last week. They work in my own tests, but please let me know if you can try them in your reproducer. |
hipSOLVER's find module scripts (for suitesparse) were using `find_path` on name `suitesparse/cholmod.h` instead of `cholmod.h`, which allowed hipSOLVER to `#include <suitesparse/cholmod.h>`. This commit updates the aforementioned cmake scripts, to honour the way `Suitesparse::CHOLMOD` advertises its include directories.
Hello @renjithravindrankannath, we would be very grateful if you could test this PR in spack. Many thanks in advance! |
It appears that the
SuiteSparse::CHOLMOD
CMake library advertises its include directory as$PREFIX/include/suitesparse
, making the proper way to include it#include <cholmod.h>
. When installed in the system/usr
prefix, thesuitesparse/cholmod.h
path works by accident. When using a custom built suitesparse at a custom location, this is not so.I believe that this change is the correct way to do it for all configurations, based on how the SuiteSparse library is set up.