acfl: remove gcc oriented PATH / LD_LIBRARY_PATH (#46594)

This commit is contained in:
dslarm 2024-09-27 11:48:36 +01:00 committed by GitHub
parent 32b6381b9b
commit 044dcee7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack.package import *
@ -245,11 +244,6 @@ def get_acfl_prefix(spec):
return join_path(spec.prefix, f"arm-linux-compiler-{spec.version}_{os}")
def get_gcc_prefix(spec):
dirlist = next(os.walk(spec.prefix))[1]
return join_path(spec.prefix, next(dir for dir in dirlist if dir.startswith("gcc")))
def get_armpl_suffix(spec):
suffix = ""
if spec.satisfies("@24:"):
@ -393,7 +387,6 @@ def headers(self):
def setup_run_environment(self, env):
arm_dir = get_acfl_prefix(self.spec)
armpl_dir = get_armpl_prefix(self.spec)
gcc_dir = get_gcc_prefix(self.spec)
env.set("ARM_LINUX_COMPILER_DIR", arm_dir)
env.set("ARM_LINUX_COMPILER_INCLUDES", join_path(arm_dir, "includes"))
@ -405,25 +398,11 @@ def setup_run_environment(self, env):
env.prepend_path("LIBRARY_PATH", join_path(arm_dir, "lib"))
env.prepend_path("MANPATH", join_path(arm_dir, "share", "man"))
env.set("GCC_DIR", gcc_dir)
env.set("GCC_INCLUDES", join_path(gcc_dir, "include"))
env.append_path("GCC_LIBRARIES", join_path(gcc_dir, "lib"))
env.append_path("GCC_LIBRARIES", join_path(gcc_dir, "lib64"))
env.set("COMPILER_PATH", gcc_dir)
env.prepend_path("PATH", join_path(gcc_dir, "binutils_bin"))
env.prepend_path("CPATH", join_path(gcc_dir, "include"))
env.prepend_path("LD_LIBRARY_PATH", join_path(gcc_dir, "lib"))
env.prepend_path("LD_LIBRARY_PATH", join_path(gcc_dir, "lib64"))
env.prepend_path("LIBRARY_PATH", join_path(gcc_dir, "lib"))
env.prepend_path("LIBRARY_PATH", join_path(gcc_dir, "lib64"))
env.prepend_path("MANPATH", join_path(gcc_dir, "share", "man"))
@run_after("install")
def check_install(self):
arm_dir = get_acfl_prefix(self.spec)
armpl_dir = get_armpl_prefix(self.spec)
suffix = get_armpl_suffix(self.spec)
gcc_dir = get_gcc_prefix(self.spec)
armpl_example_dir = join_path(armpl_dir, f"examples{suffix}")
# run example makefile
make(
@ -432,7 +411,6 @@ def check_install(self):
"CC=" + self.cc,
"F90=" + self.fortran,
"CPATH=" + join_path(arm_dir, "include"),
"COMPILER_PATH=" + gcc_dir,
"ARMPL_DIR=" + armpl_dir,
)
# clean up