Coder Social home page Coder Social logo

Comments (11)

szhorvat avatar szhorvat commented on June 2, 2024 1

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.

from suitesparse.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on June 2, 2024

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.

from suitesparse.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on June 2, 2024

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:

option ( GRAPHBLAS_USE_OPENMP "ON: Use OpenMP in GraphBLAS if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)" ${SUITESPARSE_USE_OPENMP} )

but you can set it with cmake -DGBNCPUFEAT=1 ...

I use it here:

# find cpu_features
#-------------------------------------------------------------------------------
if ( NOT GBNCPUFEAT )
# default: enable Google's cpu_features package
message ( STATUS "cpu_features (by google.com): enabled " )
include_directories ( "cpu_features/include" "cpu_features" "cpu_features/src" "cpu_features/include/internal" )
else ( )
# disable Google's cpu_features package
message ( STATUS "cpu_features (by google.com): disabled" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGBNCPUFEAT " )
endif ( )

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 )

from suitesparse.

szhorvat avatar szhorvat commented on June 2, 2024

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.

from suitesparse.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on June 2, 2024

Yes, adding that to the cmake options should get MacPorts to work for a system where cpu_features fails to compile/link.

from suitesparse.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on June 2, 2024

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
...
-- ------------------------------------------------------------------------
...

from suitesparse.

barracuda156 avatar barracuda156 commented on June 2, 2024

@DrTimothyAldenDavis @szhorvat FYI, this issue seems to be affecting only Intel. On PowerPC I have GraphBLAS building with no fixes from my side needed.

from suitesparse.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on June 2, 2024

Does -DGBNCPUFEAT=1 solve the problem or shall I keep this issue open?

from suitesparse.

barracuda156 avatar barracuda156 commented on June 2, 2024

@DrTimothyAldenDavis Just to make sure, can it introduce undesirable effect to PowerPC? Because it got merged into Macports without checking on it so far.

from suitesparse.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on June 2, 2024

@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.

from suitesparse.

barracuda156 avatar barracuda156 commented on June 2, 2024

@DrTimothyAldenDavis Thank you! Then all good.

from suitesparse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.