|
211 | 211 | easybuild_version = os.getenv("EBVERSIONEASYBUILD") or easybuild_version |
212 | 212 | eessi_version = os.getenv("EESSI_VERSION") or "2023.06" |
213 | 213 |
|
| 214 | +if (mode() == "unload") then |
| 215 | + -- unload unconditionally, so that even if EB versions were switched in the meantime, this gets unset |
| 216 | + -- This avoids issues where EESSI-extend is first loaded with EB => 5.1 (which set these vars) |
| 217 | + -- but then EB is swapped for a version < 5.1 and then EESSI-extend is unloaded (which would not unset |
| 218 | + -- these vars if we did it conditional on the EB version) |
| 219 | + setenv ("EASYBUILD_STRICT_RPATH_SANITY_CHECK", "1") |
| 220 | + setenv ("EASYBUILD_CUDA_SANITY_CHECK_ERROR_ON_FAILED_CHECKS", "1") |
| 221 | + setenv ("EASYBUILD_FAIL_ON_MOD_FILES_GCCCORE", "1") |
| 222 | + setenv ("EASYBUILD_LOCAL_VAR_NAMING_CHECK", "error") |
| 223 | + -- This can still be conditional, eessi_version is always set |
| 224 | + if convertToCanonical(eessi_version) > convertToCanonical("2023.06") then |
| 225 | + setenv ("EASYBUILD_PREFER_PYTHON_SEARCH_PATH", "EBPYTHONPREFIXES") |
| 226 | + setenv ("EASYBUILD_MODULE_SEARCH_PATH_HEADERS", "include_paths") |
| 227 | + setenv ("EASYBUILD_SEARCH_PATH_CPP_HEADERS", "include_paths") |
| 228 | + end |
214 | 229 | -- Set environment variables that are EasyBuild version specific |
215 | | -if convertToCanonical(easybuild_version) >= convertToCanonical("5.1") then |
| 230 | +elseif convertToCanonical(easybuild_version) >= convertToCanonical("5.1") then |
216 | 231 | setenv ("EASYBUILD_STRICT_RPATH_SANITY_CHECK", "1") |
217 | 232 | setenv ("EASYBUILD_CUDA_SANITY_CHECK_ERROR_ON_FAILED_CHECKS", "1") |
218 | 233 | setenv ("EASYBUILD_FAIL_ON_MOD_FILES_GCCCORE", "1") |
|
0 commit comments