Fix for ESMF post_install on macOS (#36087)

This commit is contained in:
Matthew Thompson 2023-03-16 19:32:54 -04:00 committed by GitHub
parent 09fd3e8e61
commit 97d6c741b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)