Closed szhorvat closed 7 months ago
I've had other portability issues with the cpu_features package.
I should add an option to disable it completely. A cmake check could be written to detect this. Not having cou_features would limit performance in a few semirings but it make GraphBLAS more portable.
So let's consider this something that will be fixed.
CORRECTION: I do have an option ... see below.
I do have a -DGBNCPUFEAT=1 option that you can pass to cmake. It's not made visible with a cmake option command like this option:
but you can set it with cmake -DGBNCPUFEAT=1 ...
I use it here:
It's described in the GraphBLAS User Guide.
I should add this to the CMakeLists.txt file though, so it's more easily available to cmake gui interfaces like ccmake, though:
option ( GRAPHBBLAS_USE_CPU_FEATURES "use Google cpu_features, default ON " ON )
If I understand you correctly, -DGBNCPUFEAT=1
should avoid this problem in 7.5.1? I'll submit a PR with this to MacPorts, but only for the affected old systems.
Yes, adding that to the cmake options should get MacPorts to work for a system where cpu_features fails to compile/link.
Here's what it should look like (excerpts of the cmake output). This is on my M1 Mac
mac $ pwd
/Users/davis/dev2/SuiteSparse/GraphBLAS
mac $ cd build
mac $ cmake -DGBNCPUFEAT=1 ..
-- Building SuiteSparse:GraphBLAS version: v9.0.1, date: Jan 20, 2024
...
-- cpu_features (by google.com): disabled
...
-- CMAKE C flags: -DGBNCPUFEAT -O3 -DNDEBUG
-- ------------------------------------------------------------------------
-- JIT configuration:
-- ------------------------------------------------------------------------
-- JIT C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- JIT C flags: -DGBNCPUFEAT -O3 -DNDEBUG -fPIC -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk
...
-- ------------------------------------------------------------------------
-- CMAKE report for: GraphBLAS
-- ------------------------------------------------------------------------
...
-- C flags: -DGBNCPUFEAT -O3 -DNDEBUG
...
-- ------------------------------------------------------------------------
...
@DrTimothyAldenDavis @szhorvat FYI, this issue seems to be affecting only Intel. On PowerPC I have GraphBLAS
building with no fixes from my side needed.
Does -DGBNCPUFEAT=1
solve the problem or shall I keep this issue open?
@DrTimothyAldenDavis Just to make sure, can it introduce undesirable effect to PowerPC? Because it got merged into Macports without checking on it so far.
Does
-DGBNCPUFEAT=1
solve the problem or shall I keep this issue open?
It took some time until my PR got merged, but yes, it seems that GraphBLAS was built correctly on the old Intel systems where the problem was previously present:
https://ports.macports.org/port/SuiteSparse_GraphBLAS/details/
So yes, -DGBNCPUFEAT=1
works.
@DrTimothyAldenDavis Just to make sure, can it introduce undesirable effect to PowerPC? Because it got merged into Macports without checking on it so far.
This should be fine. I only use cpu_features to determine if an x86 processor can use AVX2 or AVX512. So if cpu_features is present, I would get the answer "no", and if cpu_features is not present, I get the same answer.
@DrTimothyAldenDavis Thank you! Then all good.
This is just an FYI, not a request to fix it.
The only SuiteSparse package that fails to compile on old systems within MacPorts is GraphBLAS (and of course LAGraph, as it depends on it). You can see the affected systems here:
https://ports.macports.org/port/SuiteSparse_GraphBLAS/details/
This is an example of an installation log:
https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/248598/steps/install-port/logs/stdio
There seems to be a linking error:
To be clear, I'm not sure that it's worth putting in effort into supporting very old operating systems with a modern package like GraphBLAS, which is all about performance. But I thought you might be interested in knowing about this issue in case there's a quick fix that you might want to commit.
Note that I cannot test on these old operating systems. The log is from the MacPorts build bots.
I'm also happy to report that all other SuiteSparse packages compiled fine (with no patches) all all versions of macOS that MacPorts is building for.