Skip to content

Commit

Permalink
Disable extensions in math.h with older versions of macOS for all pro…
Browse files Browse the repository at this point in the history
…jects
  • Loading branch information
mmuetzel committed Jan 3, 2024
1 parent 6562339 commit 5a711b0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ")

set ( CMAKE_INCLUDE_CURRENT_DIR ON )

#-------------------------------------------------------------------------------
# Workaround for math.h on old macOS
#-------------------------------------------------------------------------------

if ( APPLE AND CMAKE_SYSTEM_VERSION VERSION_LESS 11 )
# Older versions of math.h on the Mac define Real and Imag, which
# conflict with the internal use of those symbols in CHOLMOD, KLU, SPQR,
# UMFPACK, and ParU.
# This can be disabled with -D__NOEXTENSIONS__
message ( STATUS "MacOS: disable extensions in math.h" )
add_compile_definitions ( "__NOEXTENSIONS__" )
endif ( )

#-------------------------------------------------------------------------------
# check if Fortran is available and enabled
#-------------------------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions LAGraph/cmake_modules/SuiteSparsePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ")

set ( CMAKE_INCLUDE_CURRENT_DIR ON )

#-------------------------------------------------------------------------------
# Workaround for math.h on old macOS
#-------------------------------------------------------------------------------

if ( APPLE AND CMAKE_SYSTEM_VERSION VERSION_LESS 11 )
# Older versions of math.h on the Mac define Real and Imag, which
# conflict with the internal use of those symbols in CHOLMOD, KLU, SPQR,
# UMFPACK, and ParU.
# This can be disabled with -D__NOEXTENSIONS__
message ( STATUS "MacOS: disable extensions in math.h" )
add_compile_definitions ( "__NOEXTENSIONS__" )
endif ( )

#-------------------------------------------------------------------------------
# check if Fortran is available and enabled
#-------------------------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ")

set ( CMAKE_INCLUDE_CURRENT_DIR ON )

#-------------------------------------------------------------------------------
# Workaround for math.h on old macOS
#-------------------------------------------------------------------------------

if ( APPLE AND CMAKE_SYSTEM_VERSION VERSION_LESS 11 )
# Older versions of math.h on the Mac define Real and Imag, which
# conflict with the internal use of those symbols in CHOLMOD, KLU, SPQR,
# UMFPACK, and ParU.
# This can be disabled with -D__NOEXTENSIONS__
message ( STATUS "MacOS: disable extensions in math.h" )
add_compile_definitions ( "__NOEXTENSIONS__" )
endif ( )

#-------------------------------------------------------------------------------
# check if Fortran is available and enabled
#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 5a711b0

Please sign in to comment.