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