Skip to content

Commit

Permalink
TMP config
Browse files Browse the repository at this point in the history
  • Loading branch information
mgates3 committed Sep 22, 2024
1 parent 5108f75 commit d9b770b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def print_test( label ):
'''
if (label):
print( '-'*20 + '\n' + label, file=log )
# For long lines, print result on next line.
if (len( label ) > 72):
print( label )
label = ''
Expand Down
19 changes: 11 additions & 8 deletions config/lapack.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,21 @@ def blas():
libs = '-framework Accelerate'
flags = define('HAVE_ACCELERATE')
new_lapack = ' -DACCELERATE_NEW_LAPACK'
# macOS 13.3, g++ 12.2 requires extra flag to parse Apple's headers.
extra = ' -flax-vector-conversions'
# todo: -mmacos-version-min starting with Xcode 16
# todo: check `${CXX} --help -v`, as CMake does?
macos = ' -mmacosx-version-min=13.3'

choices.append(
['macOS Accelerate (new)',
{'LIBS': libs,
'CXXFLAGS': flags + new_lapack }])

# macOS 13.3, g++ 12.2 requires extra flag to parse Apple's headers.
version = ' -mmacosx-version-min=13.3'
extra = ' -flax-vector-conversions'
choices.append(
['macOS Accelerate (new, -flax-vector-conversions)',
{'LIBS': libs + version,
'CXXFLAGS': flags + new_lapack + version + extra }])
{'LIBS': libs + macos,
'CXXFLAGS': flags + new_lapack + macos + extra }])

choices.append(
['macOS Accelerate (old, pre 13.3)',
Expand All @@ -360,7 +363,7 @@ def blas():
choices.append(
['macOS Accelerate (old, pre 13.3, -flax-vector-conversions)',
{'LIBS': libs,
'CXXFLAGS': flags + extra}])
'CXXFLAGS': flags + extra }])
# end

#-------------------- generic -lblas
Expand Down Expand Up @@ -598,13 +601,13 @@ def lapack_version():
'''
config.print_test( 'LAPACK version' )
(rc, out, err) = config.compile_run( 'config/lapack_version.cc' )
s = re.search( r'^LAPACK_VERSION=((\d+)\.(\d+)\.(\d+))', out )
s = re.search( r'^LAPACK_VERSION=((-?\d+)\.(-?\d+)\.(-?\d+))', out )
if (rc == 0 and s):
major = int( s.group( 2 ) )
minor = int( s.group( 3 ) )
patch = int( s.group( 4 ) )
# Sanity checks may catch ilp64 error.
assert 3 <= major <= 4, "Expected LAPACK version 3 (current) or 4 (future), got version " + str( major )
assert 3 <= major <= 4, "Expected LAPACK version 3 (current) or 4 (future), got version " + str( major ) + "; possibly 32/64-bit mismatch"
assert 0 <= minor <= 100, "Expected LAPACK minor in 0-100, got " + str( minor )
assert 0 <= minor <= 100, "Expected LAPACK patch in 0-100, got " + str( patch )
v = '%d%02d%02d' % (major, minor, patch)
Expand Down

0 comments on commit d9b770b

Please sign in to comment.