|
41 | 41 | CORE = 'Core' |
42 | 42 | COMPILER = 'Compiler' |
43 | 43 | MPI = 'MPI' |
| 44 | +TOOLCHAIN = 'Toolchain' |
44 | 45 |
|
45 | 46 | MODULECLASS_COMPILER = 'compiler' |
46 | 47 | MODULECLASS_MPI = 'mpi' |
| 48 | +MODULECLASS_TOOLCHAIN = 'toolchain' |
47 | 49 |
|
48 | 50 | GCCCORE = GCCcore.NAME |
49 | 51 |
|
@@ -107,7 +109,11 @@ def det_toolchain_compilers_name_version(self, tc_comps): |
107 | 109 | # no compiler in toolchain, system toolchain |
108 | 110 | res = None |
109 | 111 | elif len(tc_comps) == 1: |
110 | | - res = (tc_comps[0]['name'], self.det_full_version(tc_comps[0])) |
| 112 | + tc_comp = tc_comps[0] |
| 113 | + if tc_comp is None: |
| 114 | + res = None |
| 115 | + else: |
| 116 | + res = (tc_comp['name'], self.det_full_version(tc_comp)) |
111 | 117 | else: |
112 | 118 | comp_versions = dict([(comp['name'], self.det_full_version(comp)) for comp in tc_comps]) |
113 | 119 | comp_names = comp_versions.keys() |
@@ -135,6 +141,10 @@ def det_module_subdir(self, ec): |
135 | 141 | if tc_comps is None: |
136 | 142 | # no compiler in toolchain, system toolchain => Core module |
137 | 143 | subdir = CORE |
| 144 | + elif tc_comps == [None]: |
| 145 | + # no info on toolchain compiler (cfr. Cray toolchains), |
| 146 | + # then use toolchain name/version |
| 147 | + subdir = os.path.join(TOOLCHAIN, ec.toolchain.name, ec.toolchain.version) |
138 | 148 | else: |
139 | 149 | tc_comp_name, tc_comp_ver = self.det_toolchain_compilers_name_version(tc_comps) |
140 | 150 | tc_mpi = det_toolchain_mpi(ec) |
@@ -223,6 +233,10 @@ def det_modpath_extensions(self, ec): |
223 | 233 | fullver = self.det_full_version(ec) |
224 | 234 | paths.append(os.path.join(MPI, tc_comp_name, tc_comp_ver, ec['name'], fullver)) |
225 | 235 |
|
| 236 | + # special case for Cray toolchains |
| 237 | + elif modclass == MODULECLASS_TOOLCHAIN and tc_comp_info is None: |
| 238 | + paths.append(os.path.join(TOOLCHAIN, ec.toolchain.name, ec.toolchain.version)) |
| 239 | + |
226 | 240 | return paths |
227 | 241 |
|
228 | 242 | def expand_toolchain_load(self, ec=None): |
|
0 commit comments