Skip to content
Snippets Groups Projects
Unverified Commit 97895946 authored by Tim Kaune's avatar Tim Kaune
Browse files

Move choice of CMake generator to user preset file

parent 9d5f1a13
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ set(CMAKE_MAXIMUM_SUPPORTED_VERSION 3.31)
cmake_minimum_required(VERSION 3.12...${CMAKE_MAXIMUM_SUPPORTED_VERSION})
project(AccelerateLAPACKE VERSION 1.2.0 LANGUAGES C)
project(AccelerateLAPACKE VERSION 1.3.0 LANGUAGES C)
include(FetchContent)
......
......@@ -7,13 +7,17 @@
},
"configurePresets": [
{
"name": "base",
"name": "install",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "$env{HOME}/.local"
}
},
{
"name": "make",
"hidden": true,
"generator": "Unix Makefiles"
},
{
"name": "ninja",
"hidden": true,
......@@ -22,8 +26,7 @@
{
"name": "accelerate-lapacke32",
"inherits": [
"base",
"ninja"
"install"
],
"binaryDir": "${sourceDir}/build/32",
"cacheVariables": {
......@@ -34,8 +37,7 @@
{
"name": "accelerate-lapacke64",
"inherits": [
"base",
"ninja"
"install"
],
"binaryDir": "${sourceDir}/build/64",
"cacheVariables": {
......@@ -50,27 +52,30 @@
"hidden": true,
"verbose": true
},
{
"name": "install",
"hidden": true,
"targets": [
"install"
]
},
{
"name": "accelerate-lapacke32",
"inherits": [
"verbose"
"verbose",
"install"
],
"displayName": "LAPACKE 32bit build linking against Accelerate and installation",
"configurePreset": "accelerate-lapacke32",
"targets": [
"install"
]
"configurePreset": "accelerate-lapacke32"
},
{
"name": "accelerate-lapacke64",
"inherits": [
"verbose"
"verbose",
"install"
],
"displayName": "LAPACKE 64bit build linking against Accelerate ILP64 interface and installation",
"configurePreset": "accelerate-lapacke64",
"targets": [
"install"
]
"configurePreset": "accelerate-lapacke64"
}
],
"workflowPresets": [
......
......@@ -7,6 +7,7 @@
{
"name": "user-accelerate-lapacke32",
"inherits": [
"ninja",
"accelerate-lapacke32"
],
"cacheVariables": {
......@@ -17,6 +18,7 @@
{
"name": "user-accelerate-lapacke64",
"inherits": [
"ninja",
"accelerate-lapacke64"
],
"cacheVariables": {
......
......@@ -26,27 +26,28 @@ SOFTWARE.
# Accelerate LAPACKE #
Since MacOS 13.3 Ventura, Apple's Accelerate framework comes with a new
[BLAS/LAPACK
interface](https://developer.apple.com/documentation/accelerate/blas) compatible
with [Reference LAPACK
v3.9.1](https://github.com/Reference-LAPACK/lapack/releases/tag/v3.9.1). It also
provides an ILP64 interface. On Apple Silicon M-processors, it utilises the
[proprietary AMX co-processor](https://github.com/corsix/amx), which makes it
especially interesting. Unfortunately, it comes without the LAPACKE C-interface
library.
[BLAS/LAPACK interface][accelerate-docs] compatible with [Reference LAPACK
v3.9.1][lapack-v3.9.1]. It also provides an ILP64 interface. On Apple Silicon
M-processors, it utilises the [proprietary AMX co-processor][apple-amx], which
makes it especially interesting. Unfortunately, it comes without the LAPACKE
C-interface library.
**Update**: With the release of MacOS 15.0 Sequoia, Apple updated the Accelerate
framework to be compatible with [Reference LAPACK
v3.11.0](https://github.com/Reference-LAPACK/lapack/releases/tag/v3.11.0).
framework to be compatible with [Reference LAPACK v3.11.0][lapack-v3.11.0].
Unfortunately, there is no mention of it in the [MacOS 15.0 Sequoia Release
Notes](), but the note in the [Accelerate BLAS
docs](https://developer.apple.com/documentation/accelerate/blas) has been
updated accordingly.
Notes][macos15-release-notes], but the note in the [Accelerate BLAS
docs][accelerate-docs] has been updated accordingly.
These new interfaces are hidden behind the preprocessor defines
`ACCELERATE_NEW_LAPACK` and `ACCELERATE_LAPACK_ILP64` and they only work, if you
include the Accelerate C/C++ headers.
[accelerate-docs]: https://developer.apple.com/documentation/accelerate/blas-library
[apple-amx]: https://github.com/corsix/amx
[lapack-v3.9.1]: https://github.com/Reference-LAPACK/lapack/releases/tag/v3.9.1
[lapack-v3.11.0]: https://github.com/Reference-LAPACK/lapack/releases/tag/v3.11.0
[macos15-release-notes]: https://developer.apple.com/documentation/macos-release-notes/macos-15-release-notes
## The Problem ##
But what if you have to or just want to link against the Accelerate framework
......@@ -58,12 +59,11 @@ the linker, when linking any program or library that uses the standard
BLAS/LAPACK API.
Take, for example, the `dgeqrt` LAPACK routine, that is used by the [Reference
LAPACK CMake
script](https://github.com/Reference-LAPACK/lapack/blob/v3.9.1/CMakeLists.txt#L315-L316)
to determine, if the user provided LAPACK version is recent enough. When the
Fortran test executable is compiled, the `gfortran` compiler creates a function
call with the binary symbol `_dgeqrt_`, which results in the following error
when linking to Accelerate (`ld` is the Apple system linker, here):
LAPACK CMake script][dgeqrt-ref] to determine, if the user provided LAPACK
version is recent enough. When the Fortran test executable is compiled, the
`gfortran` compiler creates a function call with the binary symbol `_dgeqrt_`,
which results in the following error when linking to Accelerate (`ld` is the
Apple system linker, here):
```plaintext
ld: Undefined symbols:
......@@ -75,6 +75,8 @@ The reason for this is, that the binary symbol provided by the Accelerate
framework is called `_dgeqrt$NEWLAPACK`, literally. This is a symbol, that no
Fortran compiler will probably ever emit voluntarily. So, what to do?
[dgeqrt-ref]: https://github.com/Reference-LAPACK/lapack/blob/v3.11.0/CMakeLists.txt#L365-L366
## The Solution ##
According to its `man` page, the Apple system linker `ld` provides the options
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment