Add capitalized symlinks for libesmf.{a,so} (#35774)

* Add capitalized symlinks for libesmf.{a,so}
* Add import of lib suffixes
This commit is contained in:
Alex Richert 2023-03-01 15:28:46 -08:00 committed by GitHub
parent 7c1a164219
commit ed07cee852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@
import os import os
from spack.build_environment import dso_suffix, stat_suffix
from spack.package import * from spack.package import *
@ -345,8 +346,14 @@ def setup_build_environment(self, env):
env.set("ESMF_SHARED_LIB_BUILD", "OFF") env.set("ESMF_SHARED_LIB_BUILD", "OFF")
@run_after("install") @run_after("install")
def install_findesmf(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
# 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))
def check(self): def check(self):
make("check", parallel=False) make("check", parallel=False)