-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
link OpenMP explicitly; help CMake actually find it
- Loading branch information
1 parent
0ca728c
commit 590e3ce
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
From 4cab116c4e811f977c816f3027df57d1fba3bd0c Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <h.vetinari@gmx.com> | ||
Date: Mon, 1 Jul 2024 09:05:00 +1100 | ||
Subject: [PATCH] explicitly link to OpenMP | ||
|
||
bump CMake minimum to adopt CMP0074 for checking OpenMP_ROOT, see | ||
https://cmake.org/cmake/help/latest/policy/CMP0074.html | ||
--- | ||
CMakeLists.txt | 15 ++++++++++++++- | ||
1 file changed, 14 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 096ca88b3..ef505f70d 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -2,7 +2,7 @@ | ||
## Author: Hank Anderson <hank@statease.com> | ||
## | ||
|
||
-cmake_minimum_required(VERSION 2.8.5) | ||
+cmake_minimum_required(VERSION 3.12) | ||
|
||
project(OpenBLAS C ASM) | ||
|
||
@@ -100,6 +100,10 @@ endif() | ||
|
||
message(WARNING "CMake support is experimental. It does not yet support all build options and may not produce the same Makefiles that OpenBLAS ships with.") | ||
|
||
+if (USE_OPENMP) | ||
+ find_package(OpenMP REQUIRED) | ||
+endif () | ||
+ | ||
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake") | ||
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake") | ||
|
||
@@ -256,6 +260,15 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|Drago | ||
endif() | ||
endif() | ||
|
||
+if (USE_OPENMP) | ||
+ if(BUILD_STATIC_LIBS) | ||
+ target_link_libraries(${OpenBLAS_LIBNAME}_static OpenMP::OpenMP_C) | ||
+ endif() | ||
+ if(BUILD_SHARED_LIBS) | ||
+ target_link_libraries(${OpenBLAS_LIBNAME}_shared OpenMP::OpenMP_C) | ||
+ endif() | ||
+endif() | ||
+ | ||
# Seems that this hack doesn't required since macOS 11 Big Sur | ||
if (APPLE AND BUILD_SHARED_LIBS AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 20) | ||
set (CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) |