forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to get Mac Sonoma 14.6.1 with Command Line Tools 15.3 working.
- Loading branch information
1 parent
33eea04
commit e830dda
Showing
4 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
var/spack/repos/builtin/packages/fms/enable-shared-libs.patch
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,64 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 2ca5c652..5082a98e 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -52,14 +52,16 @@ endif() | ||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
|
||
# Build options | ||
-option(OPENMP "Build FMS with OpenMP support" OFF) | ||
-option(32BIT "Build 32-bit (r4) FMS library" ON) | ||
-option(64BIT "Build 64-bit (r8) FMS library" OFF) | ||
-option(FPIC "Build with position independent code" OFF) | ||
+option(OPENMP "Build FMS with OpenMP support" OFF) | ||
+option(32BIT "Build 32-bit (r4) FMS library" ON) | ||
+option(64BIT "Build 64-bit (r8) FMS library" OFF) | ||
+option(FPIC "Build with position independent code" OFF) | ||
+option(SHARED_LIBS "Build shared/dynamic libraries" OFF) | ||
|
||
# Options for compiler definitions | ||
option(INTERNAL_FILE_NML "Enable compiler definition -DINTERNAL_FILE_NML" ON) | ||
option(ENABLE_QUAD_PRECISION "Enable compiler definition -DENABLE_QUAD_PRECISION" ON) | ||
+option(PORTABLE_KINDS "Enable compiler definition -DPORTABLE_KINDS" OFF) | ||
option(GFS_PHYS "Enable compiler definition -DGFS_PHYS" OFF) | ||
option(LARGEFILE "Enable compiler definition -Duse_LARGEFILE" OFF) | ||
option(WITH_YAML "Enable compiler definition -Duse_yaml" OFF) | ||
@@ -266,6 +268,10 @@ if(ENABLE_QUAD_PRECISION) | ||
list(APPEND fms_defs ENABLE_QUAD_PRECISION) | ||
endif() | ||
|
||
+if(PORTABLE_KINDS) | ||
+ list(APPEND fms_defs PORTABLE_KINDS) | ||
+endif() | ||
+ | ||
if(LARGEFILE) | ||
list(APPEND fms_defs use_LARGEFILE) | ||
endif() | ||
@@ -360,8 +366,15 @@ foreach(kind ${kinds}) | ||
endif() | ||
|
||
# FMS (C + Fortran) | ||
- add_library(${libTgt} STATIC $<TARGET_OBJECTS:${libTgt}_c> | ||
- $<TARGET_OBJECTS:${libTgt}_f>) | ||
+ if (SHARED_LIBS) | ||
+ message(STATUS "Shared library target: ${libTgt}") | ||
+ add_library(${libTgt} SHARED $<TARGET_OBJECTS:${libTgt}_c> | ||
+ $<TARGET_OBJECTS:${libTgt}_f>) | ||
+ else () | ||
+ message(STATUS "Static library target: ${libTgt}") | ||
+ add_library(${libTgt} STATIC $<TARGET_OBJECTS:${libTgt}_c> | ||
+ $<TARGET_OBJECTS:${libTgt}_f>) | ||
+ endif () | ||
|
||
target_include_directories(${libTgt} PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
@@ -397,7 +410,8 @@ foreach(kind ${kinds}) | ||
target_compile_definitions(${libTgt} PRIVATE "${fms_defs}") | ||
target_compile_definitions(${libTgt} PRIVATE "${${kind}_defs}") | ||
|
||
- target_link_libraries(${libTgt} PUBLIC NetCDF::NetCDF_Fortran | ||
+ target_link_libraries(${libTgt} PUBLIC NetCDF::NetCDF_C | ||
+ NetCDF::NetCDF_Fortran | ||
MPI::MPI_Fortran) | ||
|
||
if(OpenMP_Fortran_FOUND) |
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