@@ -339,18 +339,21 @@ def blas():
339339 libs = '-framework Accelerate'
340340 flags = define ('HAVE_ACCELERATE' )
341341 new_lapack = ' -DACCELERATE_NEW_LAPACK'
342+ # macOS 13.3, g++ 12.2 requires extra flag to parse Apple's headers.
343+ extra = ' -flax-vector-conversions'
344+ # todo: -mmacos-version-min starting with Xcode 16
345+ # todo: check `${CXX} --help -v`, as CMake does?
346+ macos = ' -mmacosx-version-min=13.3'
347+
342348 choices .append (
343349 ['macOS Accelerate (new)' ,
344350 {'LIBS' : libs ,
345351 'CXXFLAGS' : flags + new_lapack }])
346352
347- # macOS 13.3, g++ 12.2 requires extra flag to parse Apple's headers.
348- version = ' -mmacosx-version-min=13.3'
349- extra = ' -flax-vector-conversions'
350353 choices .append (
351354 ['macOS Accelerate (new, -flax-vector-conversions)' ,
352- {'LIBS' : libs + version ,
353- 'CXXFLAGS' : flags + new_lapack + version + extra }])
355+ {'LIBS' : libs + macos ,
356+ 'CXXFLAGS' : flags + new_lapack + macos + extra }])
354357
355358 choices .append (
356359 ['macOS Accelerate (old, pre 13.3)' ,
@@ -360,7 +363,7 @@ def blas():
360363 choices .append (
361364 ['macOS Accelerate (old, pre 13.3, -flax-vector-conversions)' ,
362365 {'LIBS' : libs ,
363- 'CXXFLAGS' : flags + extra }])
366+ 'CXXFLAGS' : flags + extra }])
364367 # end
365368
366369 #-------------------- generic -lblas
@@ -598,13 +601,13 @@ def lapack_version():
598601 '''
599602 config .print_test ( 'LAPACK version' )
600603 (rc , out , err ) = config .compile_run ( 'config/lapack_version.cc' )
601- s = re .search ( r'^LAPACK_VERSION=((\d+)\.(\d+)\.(\d+))' , out )
604+ s = re .search ( r'^LAPACK_VERSION=((-? \d+)\.(-? \d+)\.(-? \d+))' , out )
602605 if (rc == 0 and s ):
603606 major = int ( s .group ( 2 ) )
604607 minor = int ( s .group ( 3 ) )
605608 patch = int ( s .group ( 4 ) )
606609 # Sanity checks may catch ilp64 error.
607- assert 3 <= major <= 4 , "Expected LAPACK version 3 (current) or 4 (future), got version " + str ( major )
610+ assert 3 <= major <= 4 , "Expected LAPACK version 3 (current) or 4 (future), got version " + str ( major ) + "; possibly 32/64-bit mismatch"
608611 assert 0 <= minor <= 100 , "Expected LAPACK minor in 0-100, got " + str ( minor )
609612 assert 0 <= minor <= 100 , "Expected LAPACK patch in 0-100, got " + str ( patch )
610613 v = '%d%02d%02d' % (major , minor , patch )
0 commit comments