LASwift icon indicating copy to clipboard operation
LASwift copied to clipboard

Future issues due to Accelerate CLAPACK deprecation

Open bal-agates opened this issue 1 year ago • 0 comments

This library still works but when compiled for macOS 13.3 or later generates lots of deprecation warnings. I am compiling for macOS 14.2 and see warnings similar to:

'dgetrf_' was deprecated in macOS 13.3: The CLAPACK interface is deprecated. Please compile with -DACCELERATE_NEW_LAPACK to access the new lapack headers.

The current Accelerate/BLAS help says

For Swift projects, specify ACCELERATE_NEW_LAPACK=1 and ACCELERATE_LAPACK_ILP64=1 as preprocessor macros in Xcode build settings.

When I did that all occurrences of __CLPK_int and __CLPK_doublereal generate undefined errors. The current web and Xcode 15.1 documentation seems broken with respect to LAPACK documentation so I could not find how the new LAPACK defines things. I did find in Apple's Solving systems of linear equations with LAPACK sample code uses __LAPACK_int. I assume this is the equivalent to __CLPK_int. I didn't find an equivalent to __CLPK_doublereal. Changing all __CLPK_int to __LAPACK_int and __CLPK_doublereal to Double compiled without errors and a simple test case produced the expected results. To confirm this more testing is needed.

I am not sure of the best way to solve in the long term. Maybe make new typealias that selects the appropriate alias for OS version? I want to think about this more before making any changes. Hoping to see Apple improve the LAPACK documentation so we can make more informed decisions. No urgency for a fix but sometime in the future it will break.

A related annoyance is I haven't found a way to turn off deprecation warnings in Xcode 15.1. The deprecation warnings generate a lot of clutter that could obscure more important warnings.

bal-agates avatar Dec 28 '23 01:12 bal-agates