@@ -45,10 +45,16 @@ description = """
4545toolchain = SYSTEM
4646
4747# All the dependencies we filter in EESSI
48- local_deps_to_filter = "Autoconf,Automake,Autotools,binutils,bzip2,DBus,flex,gettext,gperf,help2man,intltool,libreadline,libtool,M4,makeinfo,ncurses,ParMETIS,util-linux,XZ,zlib"
48+ local_deps_to_filter = "binutils,bzip2,DBus,flex,gettext,gperf,help2man,intltool,libreadline,makeinfo,ncurses,ParMETIS,util-linux,XZ,zlib"
49+
50+ # filter extra dependencies based on CPU family
4951local_arch_specific_deps_to_filter = {'aarch64' : ',Yasm' , 'riscv64' : ',Yasm' , 'x86_64' : '' }
5052local_deps_to_filter += local_arch_specific_deps_to_filter [ARCH ]
5153
54+ # only filter Autotools & co for EESSI 2023.06
55+ if version == '2023.06' :
56+ local_deps_to_filter += ",Autoconf,Automake,Autotools,libtool,M4"
57+
5258# Set the universal EasyBuild variables
5359modextravars = {
5460 'EASYBUILD_FILTER_DEPS' : local_deps_to_filter ,
@@ -70,7 +76,7 @@ modextravars = {
7076# EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR}
7177# EASYBUILD_SOURCEPATH=${WORKDIR}/easybuild/sources:${EESSI_SOURCEPATH}
7278#
73- # And also some optional ones based on the kind of installation
79+ # And also some optional ones based on the installation mode
7480# EASYBUILD_SET_GID_BIT
7581# EASYBUILD_GROUP_WRITABLE_INSTALLDIR
7682# EASYBUILD_UMASK
@@ -98,21 +104,26 @@ if (eessi_accelerator_target ~= nil) then
98104 end
99105end
100106
107+ -- Some environment variables affect behaviour, let's gather them once
108+ local eessi_cvmfs_install = os.getenv("EESSI_CVMFS_INSTALL") ~= nil
109+ local eessi_site_install = os.getenv("EESSI_SITE_INSTALL") ~= nil
110+ local eessi_project_install = os.getenv("EESSI_PROJECT_INSTALL") ~= nil
111+ local eessi_user_install = os.getenv("EESSI_USER_INSTALL") ~= nil
112+
101113-- Use an installation prefix that we _should_ have write access to
102- if (os.getenv("EESSI_CVMFS_INSTALL") ~= nil) then
114+ if eessi_cvmfs_install then
103115 -- Make sure no other EESSI install environment variables are set
104- if ((os.getenv("EESSI_SITE_INSTALL") ~= nil) or (os.getenv("EESSI_PROJECT_INSTALL") ~= nil) or (os.getenv("EESSI_USER_INSTALL") ~= nil) ) then
116+ if (eessi_site_install or eessi_project_install or eessi_user_install ) then
105117 LmodError("You cannot use EESSI_CVMFS_INSTALL in combination with any other EESSI_*_INSTALL environment variables")
106118 end
107- eessi_cvmfs_install = true
108119 easybuild_installpath = os.getenv("EESSI_SOFTWARE_PATH")
109120 -- enforce accelerator subdirectory usage for CVMFS installs (only if an accelerator install is requested)
110121 if (eessi_accelerator_target ~= nil) and (cuda_compute_capability ~= nil) and (os.getenv("EESSI_ACCELERATOR_INSTALL") ~= nil) then
111122 easybuild_installpath = pathJoin(easybuild_installpath, eessi_accelerator_target)
112123 end
113- elseif (os.getenv("EESSI_SITE_INSTALL") ~= nil) then
124+ elseif eessi_site_install then
114125 -- Make sure no other EESSI install environment variables are set
115- if ((os.getenv("EESSI_PROJECT_INSTALL") ~= nil) or (os.getenv("EESSI_USER_INSTALL") ~= nil) ) then
126+ if (eessi_project_install or eessi_user_install ) then
116127 LmodError("You cannot use EESSI_SITE_INSTALL in combination with any other EESSI_*_INSTALL environment variables")
117128 end
118129 easybuild_installpath = os.getenv("EESSI_SITE_SOFTWARE_PATH")
@@ -122,35 +133,35 @@ elseif (os.getenv("EESSI_SITE_INSTALL") ~= nil) then
122133 end
123134else
124135 -- Deal with user and project installs
125- project_install = os.getenv("EESSI_PROJECT_INSTALL")
136+ project_install_dir = os.getenv("EESSI_PROJECT_INSTALL")
126137 project_modulepath = nil
127- if (project_install ~= nil) then
138+ if eessi_project_install then
128139 -- Check the folder exists
129- if not isDir(project_install ) then
130- LmodError("The location of EESSI_PROJECT_INSTALL (" .. project_install .. ") does not exist or is not a folder")
140+ if not isDir(project_install_dir ) then
141+ LmodError("The location of EESSI_PROJECT_INSTALL (" .. project_install_dir .. ") does not exist or is not a folder")
131142 end
132143 if (mode() == "load") then
133- LmodMessage("Configuring for use of EESSI_PROJECT_INSTALL under " .. project_install )
144+ LmodMessage("Configuring for use of EESSI_PROJECT_INSTALL under " .. project_install_dir )
134145 end
135- easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), project_install )
146+ easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), project_install_dir )
136147 project_modulepath = pathJoin(easybuild_installpath, 'modules', 'all')
137148 end
138- user_install = os.getenv("EESSI_USER_INSTALL")
149+ user_install_dir = os.getenv("EESSI_USER_INSTALL")
139150 user_modulepath = nil
140- if (user_install ~= nil) then
151+ if eessi_user_install then
141152 -- Check the folder exists
142- if not isDir(user_install ) then
143- LmodError("The location of EESSI_USER_INSTALL (" .. user_install .. ") does not exist or is not a folder")
153+ if not isDir(user_install_dir ) then
154+ LmodError("The location of EESSI_USER_INSTALL (" .. user_install_dir .. ") does not exist or is not a folder")
144155 end
145- elseif (user_install == nil) and (project_install == nil) then
156+ elseif (user_install_dir == nil) and (project_install_dir == nil) then
146157 -- No need to check for existence when we use a HOME subdir
147- user_install = pathJoin(os.getenv("HOME"), "eessi")
158+ user_install_dir = pathJoin(os.getenv("HOME"), "eessi")
148159 end
149- if (user_install ~= nil) then
160+ if (user_install_dir ~= nil) then
150161 if (mode() == "load") then
151- LmodMessage("Configuring for use of EESSI_USER_INSTALL under " .. user_install )
162+ LmodMessage("Configuring for use of EESSI_USER_INSTALL under " .. user_install_dir )
152163 end
153- easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), user_install )
164+ easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), user_install_dir )
154165 user_modulepath = pathJoin(easybuild_installpath, 'modules', 'all')
155166 end
156167end
@@ -196,10 +207,33 @@ elseif (project_modulepath ~= nil) then
196207 -- configure MODULEPATH
197208 prepend_path("MODULEPATH", project_modulepath)
198209end
210+
199211-- Make sure EasyBuild itself is loaded
212+ -- need to also handle the unload behaviour where the version is defined only before we unload
213+ easybuild_version = os.getenv("EBVERSIONEASYBUILD")
200214if not ( isloaded("EasyBuild") ) then
201215 load(latest("EasyBuild"))
202216end
217+ easybuild_version = os.getenv("EBVERSIONEASYBUILD") or easybuild_version
218+ eessi_version = os.getenv("EESSI_VERSION") or "2023.06"
219+
220+ -- Set environment variables that are EasyBuild version specific
221+ -- Do unload unconditionally, so that even if EB versions were switched in the meantime, this gets unset
222+ -- This avoids issues where EESSI-extend is first loaded with EB => 5.1 (which set these vars)
223+ -- but then EB is swapped for a version < 5.1 and then EESSI-extend is unloaded (which would not unset
224+ -- these vars if we did it conditional on the EB version)
225+ if mode() == "unload" or mode() == "dependencyCk" or convertToCanonical(easybuild_version) >= convertToCanonical("5.1") then
226+ setenv ("EASYBUILD_STRICT_RPATH_SANITY_CHECK", "1")
227+ setenv ("EASYBUILD_CUDA_SANITY_CHECK_ERROR_ON_FAILED_CHECKS", "1")
228+ setenv ("EASYBUILD_FAIL_ON_MOD_FILES_GCCCORE", "1")
229+ setenv ("EASYBUILD_LOCAL_VAR_NAMING_CHECK", "error")
230+ -- Set environment variables that are EESSI version specific
231+ if convertToCanonical(eessi_version) > convertToCanonical("2023.06") then
232+ setenv ("EASYBUILD_PREFER_PYTHON_SEARCH_PATH", "EBPYTHONPREFIXES")
233+ setenv ("EASYBUILD_MODULE_SEARCH_PATH_HEADERS", "include_paths")
234+ setenv ("EASYBUILD_SEARCH_PATH_CPP_HEADERS", "include_paths")
235+ end
236+ end
203237"""
204238
205239moduleclass = 'devel'
0 commit comments