From d4872118550c1cfc92fc681efca107f266251225 Mon Sep 17 00:00:00 2001 From: Stella Laurenzo Date: Tue, 11 Feb 2025 17:43:45 -0800 Subject: [PATCH 1/2] Use proper include path for cholmod.h. It appears that the `SuiteSparse::CHOLMOD` CMake library advertises its include directory as `$PREFIX/include/suitesparse`, making the proper way to include it `#include `. 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. --- library/src/amd_detail/dlopen/cholmod.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/amd_detail/dlopen/cholmod.hpp b/library/src/amd_detail/dlopen/cholmod.hpp index 0864172e..342ed4f9 100644 --- a/library/src/amd_detail/dlopen/cholmod.hpp +++ b/library/src/amd_detail/dlopen/cholmod.hpp @@ -24,7 +24,7 @@ #include "lib_macros.hpp" #ifdef HAVE_ROCSPARSE -#include +#include #else // constants From ffb8ccdfbd0e912d67e1e726f449bdaa70421d75 Mon Sep 17 00:00:00 2001 From: Julio Machado Silva <161654951+jmachado-amd@users.noreply.github.com> Date: Thu, 27 Feb 2025 19:17:54 -0700 Subject: [PATCH 2/2] Update suitesparse's find module scripts (#1) 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 `. This commit updates the aforementioned cmake scripts, to honour the way `Suitesparse::CHOLMOD` advertises its include directories. --- library/src/cmake/suitesparse/FindCHOLMOD.cmake | 7 +++++-- library/src/cmake/suitesparse/FindSuiteSparse_config.cmake | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/library/src/cmake/suitesparse/FindCHOLMOD.cmake b/library/src/cmake/suitesparse/FindCHOLMOD.cmake index 51678d75..f33239f4 100644 --- a/library/src/cmake/suitesparse/FindCHOLMOD.cmake +++ b/library/src/cmake/suitesparse/FindCHOLMOD.cmake @@ -1,5 +1,5 @@ # ######################################################################## -# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,10 @@ This module defines the following variables: #]=======================================================================] -find_path(CHOLMOD_INCLUDE_DIR suitesparse/cholmod.h) +find_path(CHOLMOD_INCLUDE_DIR + NAMES cholmod.h + PATH_SUFFIXES suitesparse + ) find_library(CHOLMOD_LIBRARY cholmod) include(FindPackageHandleStandardArgs) diff --git a/library/src/cmake/suitesparse/FindSuiteSparse_config.cmake b/library/src/cmake/suitesparse/FindSuiteSparse_config.cmake index dcdf78fe..0fe60b50 100644 --- a/library/src/cmake/suitesparse/FindSuiteSparse_config.cmake +++ b/library/src/cmake/suitesparse/FindSuiteSparse_config.cmake @@ -1,5 +1,5 @@ # ######################################################################## -# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,10 @@ This module defines the following variables: #]=======================================================================] -find_path(SUITESPARSE_CONFIG_INCLUDE_DIR suitesparse/SuiteSparse_config.h) +find_path(SUITESPARSE_CONFIG_INCLUDE_DIR + NAMES SuiteSparse_config.h + PATH_SUFFIXES suitesparse + ) find_library(SUITESPARSE_CONFIG_LIBRARY suitesparseconfig) include(FindPackageHandleStandardArgs)