Fix for ESMF post_install on macOS (#36087)
This commit is contained in:
parent
09fd3e8e61
commit
97d6c741b0
1 changed files with 10 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue