Closed szhorvat closed 10 months ago
Thanks for the update. I found that too and I'm in the process of fixing it. I think it's actually using OpenMP but the message is not correct. I have a few commits that fix this but not yet a beta11 because I still have to confirm that it's fixed.
This should be fixed now in beta11, https://github.com/DrTimothyAldenDavis/SuiteSparse/releases/tag/v7.4.0.beta11
@DrTimothyAldenDavis Thanks for the fix! It's now compiling on my machine (it takes a while). While I'm waiting for it, a few questions about SuiteSparse in general:
CMAKE_MACOSX_RPATH
to be OFF
. From what I'm told this is so that it can detect linking issues when a library is updated and its dependents need re-compiling. SuiteSparse has CMAKE_MACOSX_RPATH
hard-coded to ON
, even though as I understand this is a default for CMake 3.0 and late (reference). As far as I can tell, all SuiteSparse packages now require CMake 3.22, with the exception of CSparse which requires 3.13. Grepping the source-tree for cmake_minimum_required
reveals lower version requirements only for some vendored libraries, such as CHOLMOD/SuiteSparse_metis
or GraphBLAS/cpu_features
. Would it be then possible to not hard-code CMAKE_MACOSX_RPATH
so that it wouldn't need to be patched in MacPorts?
- Which packages support OpenMP, and which ones do you recommend enabling it for? I understand that it is essential for GraphBLAS, and probably for LAGraph as well. I would only enable it for essential ones as there seem to be potentially bad interactions with OpenBLAS that I do not understand well.
Here are the packages that can use OpenMP directly (not counting the possible use in the BLAS / LAPACK):
Each of those packages has its own Package_USE_OPENMP flag (but I see one is missing in the top README.md):
SUITESPARSE_USE_OPENMP
: if OFF, OpenMP is disabled for all of SuiteSparse.SUITESPARSE_CONFIG_USE_OPENMP
CHOLMOD_USE_OPENMP
GRAPHBLAS_USE_OPENMP
LAGRAPH_USE_OPENMP
PARU_USE_OPENMP
Other packages might use OpenMP if the BLAS/LAPACK need it: UMFPACK, CHOLMOD, SPQR, and ParU.
- At the moment, parallel build is disabled for SuiteSparse in MacPorts. Do you have any idea why this may have been done? I am re-enabling it an hoping nothing breaks.
No idea. Maybe because UMFPACK, etc use the BLAS and get performance that way. GraphBLAS and ParU are new.
- MacPorts wants
CMAKE_MACOSX_RPATH
to beOFF
. From what I'm told this is so that it can detect linking issues when a library is updated and its dependents need re-compiling. SuiteSparse hasCMAKE_MACOSX_RPATH
hard-coded toON
, even though as I understand this is a default for CMake 3.0 and late (reference). As far as I can tell, all SuiteSparse packages now require CMake 3.22, with the exception of CSparse which requires 3.13. Grepping the source-tree forcmake_minimum_required
reveals lower version requirements only for some vendored libraries, such asCHOLMOD/SuiteSparse_metis
orGraphBLAS/cpu_features
. Would it be then possible to not hard-codeCMAKE_MACOSX_RPATH
so that it wouldn't need to be patched in MacPorts?
I'm not sure why this was hard coded. I think I had trouble getting my codes to compile on the Mac. If it's the default for 3.0 and later, then I can remove it, and then MacPorts and set it OFF as needed.
See the dev2 branch for the update to the README, just now:
https://github.com/DrTimothyAldenDavis/SuiteSparse/commit/b4f5a78066e8edbb8f04095b654e605a5c9d28b8
Confirmed fixed, closing.
See https://github.com/DrTimothyAldenDavis/SuiteSparse/pull/637 . I've also removed all instances of set ( CMAKE_MACOSX_RPATH TRUE )
.
Sundials 5.8 (sundials5
port in MacPorts) failed to compile with 7.4.0 (it did with 7.3.1). It complains about a missing klu.h
. I won't debug this today. I'll report back after I've figured out the cause.
It might be looking in /usr/local/include. All the include files for SuiteSparse are in /usr/local/include/suitesparse. If sundials uses cmake, this should be found automatically via the *Config.cmake files. But if it doesn't, it would need to look at /usr/local/include/suitesparse.
Yes, that was the issue, and it's fixable by -DSUITESPARSE_INCLUDEDIR_POSTFIX=""
.
I tried to include ParU as well, but I'm getting:
CMake Error at CMakeLists.txt:233 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:SuiteSparse::UMFPACK,INTERFACE_INCLUDE_DIRECTORIES>
Target "SuiteSparse::UMFPACK" not found.
I have not investigated this yet. Before I do so, do you have any tips?
This is not a big deal as I might just not include ParU yet, since it doesn't have a stable API.
Here's a full output form MacPorts:
Finally, I wanted to draw your attention to this patch that exists in MacPorts. According to the comments, this is necessary on very old OS X systems that run on PPC, so it's probably not worth bothering with it. I certainly can't (and won't) test on such old systems. But I thought I'd let you know just in case. https://github.com/macports/macports-ports/blob/master/math/SuiteSparse/files/patch-KLU-Include-klu_version.h.diff
Ack. Hard to believe that Apple wrote a math.h that defined terms "Real" and "Imag". Those aren't in any C standard and exposing such generic terms to an end user code (like KLU) is a bad idea on their part. At least they don't do that anymore.
I could change that but I'm worried I might break something else. It could be that an end user sees those structs and changing them would break their code.
Since it's an obscure case on MacPorts I would prefer not to change it.
Not sure why umfpack is not found. It should be built just before ParU, right? I'm away from the keyboard just now, on my phone, but I'll take a closer look later.
@DrTimothyAldenDavis The ParU readme says,
ParU: is a set of routings
Should this not be "routines" instead of "routings"?
Yes. The that's a typo. I'll fix it when I get back to the keyboard
Describe the bug
GraphBLAS does not use OpenMP, even if it is explicitly requested.
To Reproduce
Clone the repo, check out tag
v7.4.0.beta10
. Here's a terminal transcript.clang-mp-17
is Clang 17 from MacPorts, with OpenMP support (as Apple Clang doesn't do OpenMP). It does not matter if I leave off-DGRAPHBLAS_USE_OPENMP=ON -DSUITESPARSE_USE_OPENMP=ON
, the outcome is the same.Expected behavior
Output should show
use OpenMP: yes
. Instead it shows:Desktop (please complete the following information):
Additional context —