SuiteSparse
SuiteSparse copied to clipboard
GraphBLAS needs to be linked to libatomic on some platforms
In SuiteSparse 5.7, a call to __atomic_compare_exchange
was introduced in GraphBLAS/Source/Template/GB_AxB_saxpy3_template.h
.
Under some circumstances, the compiler turns those __atomic
statements into a call to a function provided by the libatomic
library. However, the GraphBLAS build system does not link executables to libatomic
in that case, resulting in a build failure (occurring in reduce_demo
).
In Debian, the problem manifests at least with the ARM 32-bit (little endian) and MIPS 32-bit (little endian) architectures, see the respective build logs: https://buildd.debian.org/status/fetch.php?pkg=suitesparse&arch=armel&ver=1%3A5.7.1%2Bdfsg-1&stamp=1582754466&raw=0 https://buildd.debian.org/status/fetch.php?pkg=suitesparse&arch=mipsel&ver=1%3A5.7.1%2Bdfsg-1&stamp=1582758238&raw=0
Thanks for the heads up. Not sure how to fix it though. Looking around for possible issues elsewhere, I see that LLVM has a solution ... but a fairly complex one: https://sources.debian.org/patches/qtox/1.16.3-2/0001-chore-cmake-check-for-libatomic-support.patch/ for example, and https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/CheckAtomic.cmake . I'll see what I can do.
For the Debian package, I simply unconditionally added -latomic
to GraphBLAS.
See the patch: https://salsa.debian.org/science-team/suitesparse/-/blob/master/debian/patches/libatomic.patch
OK. But that might break systems that don't have libatomic, right?
On Sat, Feb 29, 2020 at 7:20 AM Sébastien Villemot [email protected] wrote:
For the Debian package, I simply unconditionally added -latomic to GraphBLAS.
See the patch: https://salsa.debian.org/science-team/suitesparse/-/blob/master/debian/patches/libatomic.patch
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/DrTimothyAldenDavis/SuiteSparse/issues/21?email_source=notifications&email_token=AEYIIOIZOIRLOIU5FBMYJO3RFEFTDA5CNFSM4K5TTRLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENLZ6QY#issuecomment-592944963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYIIOL2ILF2C67G6R2YSNDRFEFTDANCNFSM4K5TTRLA .
Yes, for sure. So this patch is not a fix ready to be incorporated, I just mentioned it for your information. It is enough on Debian though because all architectures have libatomic there.
I've just finished a beta version of SuiteSparse v6.0.0 (soon to be tagged as a pre-release), which has an entirely new CMake build system. Is this something that the CheckAtomic.cmake can work with?
See my latest attempt on the dev2 branch: https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev2 . This draft version of CMake (with a draft GraphBLAS v7.3.3) checks to see if -latomic is required or not. See also the discussion here: https://github.com/DrTimothyAldenDavis/GraphBLAS/issues/178
Can you try GraphBLAS v7.3.3.beta3 to see if it correctly detects when -latomic is needed? I think this should resolve the problem. https://github.com/DrTimothyAldenDavis/GraphBLAS/releases/tag/v7.3.3.beta3
Fixed in v7.3.3.