From 97d6c741b02cda132b8eaee28caeb192506e5233 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 16 Mar 2023 19:32:54 -0400 Subject: [PATCH] Fix for ESMF post_install on macOS (#36087) --- var/spack/repos/builtin/packages/esmf/package.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/esmf/package.py b/var/spack/repos/builtin/packages/esmf/package.py index 50d9cf6c6b..4aefe352b5 100644 --- a/var/spack/repos/builtin/packages/esmf/package.py +++ b/var/spack/repos/builtin/packages/esmf/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import sys from spack.build_environment import dso_suffix, stat_suffix from spack.package import * @@ -352,12 +353,15 @@ def setup_build_environment(self, env): @run_after("install") def post_install(self): install_tree("cmake", self.prefix.cmake) - # Several applications using ESMF are affected by CMake capitalization - # issue. The following fix allows all apps to use as-is. - for prefix in [dso_suffix, stat_suffix]: - library_path = os.path.join(self.prefix.lib, "libesmf.%s" % prefix) - if os.path.exists(library_path): - os.symlink(library_path, os.path.join(self.prefix.lib, "libESMF.%s" % prefix)) + # Several applications using ESMF are affected by CMake + # capitalization issue. The following fix allows all apps + # to use as-is. Note that since the macOS file system is + # case-insensitive, this step is not allowed on macOS. + if sys.platform != "darwin": + for prefix in [dso_suffix, stat_suffix]: + library_path = os.path.join(self.prefix.lib, "libesmf.%s" % prefix) + if os.path.exists(library_path): + os.symlink(library_path, os.path.join(self.prefix.lib, "libESMF.%s" % prefix)) def check(self): make("check", parallel=False)