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) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os import os
import sys
from spack.build_environment import dso_suffix, stat_suffix from spack.build_environment import dso_suffix, stat_suffix
from spack.package import * from spack.package import *
@ -352,12 +353,15 @@ def setup_build_environment(self, env):
@run_after("install") @run_after("install")
def post_install(self): def post_install(self):
install_tree("cmake", self.prefix.cmake) install_tree("cmake", self.prefix.cmake)
# Several applications using ESMF are affected by CMake capitalization # Several applications using ESMF are affected by CMake
# issue. The following fix allows all apps to use as-is. # capitalization issue. The following fix allows all apps
for prefix in [dso_suffix, stat_suffix]: # to use as-is. Note that since the macOS file system is
library_path = os.path.join(self.prefix.lib, "libesmf.%s" % prefix) # case-insensitive, this step is not allowed on macOS.
if os.path.exists(library_path): if sys.platform != "darwin":
os.symlink(library_path, os.path.join(self.prefix.lib, "libESMF.%s" % prefix)) 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): def check(self):
make("check", parallel=False) make("check", parallel=False)