@@ -77,14 +77,20 @@ set install_prefix ${ATFL_INSTALL_PREFIX}
7777# from the install directory
7878set module_prefix [file dirname \$ ModulesCurrentModulefile]/../..
7979
80- # Base directory of all dependant modules
81- set moduledeps \$ module_prefix/moduledeps
80+ ###########################################################################
81+ # Helper Functions #
82+ ###########################################################################
83+ proc is-lmod {} {
84+ global env
85+ if { [info exists env(LMOD_VERSION_MAJOR)] } {
86+ return true
87+ }
88+ return false
89+ }
8290
8391###########################################################################
8492# Main section #
8593###########################################################################
86- # Pull in some utility functions
87- source \$ module_prefix/moduleglobals/compiler_functions/${ATFL_VERSION}
8894
8995# Install directory of this package
9096set package_prefix \$ install_prefix
@@ -100,9 +106,6 @@ set package_prefix \$install_prefix
100106 append-path LIBRARY_PATH \$ package_prefix/lib/aarch64-unknown-linux-gnu
101107 prepend-path MANPATH \$ package_prefix/share/man
102108
103- # Make dependant modules available
104- prepend-path MODULEPATH \$ moduledeps/atfl/${ATFL_VERSION}
105-
106109if { [is-lmod] } {
107110 # Lmod family
108111 # When this modulefile is used with lmod, This ensures only one compiler is loaded at once
@@ -125,37 +128,3 @@ switch -- \$SHELL {
125128}
126129EOT
127130) > " modulefiles/atfl/${ATFL_VERSION} "
128-
129- mkdir -p " moduleglobals/compiler_functions"
130- (
131- cat << EOT
132- #%Module1.0################################################################
133- ##
134- ## Utility functions for Arm modulefiles
135- ##
136- ##
137- ## Copyright 2015-2025 Arm Limited. All rights reserved.
138- ##
139-
140- # Helper function, to load/unload a set of prerequisite modules
141- proc depends-on {dependencies} {
142- foreach dep \$ dependencies {
143- if { [module-info mode load] } {
144- # This will load the module if it has not already been loaded
145- # is-loaded only triggers on a mode load, so it would not allow an auto-unload
146- if { ! [is-loaded \$ dep] } {
147- module load \$ dep
148- }
149- }
150- }
151- }
152-
153- proc is-lmod {} {
154- global env
155- if { [info exists env(LMOD_VERSION_MAJOR)] } {
156- return true
157- }
158- return false
159- }
160- EOT
161- ) > " moduleglobals/compiler_functions/${ATFL_VERSION} "
0 commit comments