Skip to content

Commit 9da5c35

Browse files
committed
Set oneapi_fortran=True by default for Intel 2024.0.0+
ifort is deprecated, so default to ifx
1 parent 5f00b71 commit 9da5c35

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed

easybuild/toolchains/compiler/intel_compilers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class IntelCompilers(IntelIccIfort):
4848
'oneapi': (None, "Use oneAPI compilers icx/icpx/ifx instead of classic compilers"),
4949
'oneapi_c_cxx': (None, "Use oneAPI C/C++ compilers icx/icpx instead of classic Intel C/C++ compilers "
5050
"(auto-enabled for Intel compilers version 2022.2.0, or newer)"),
51-
'oneapi_fortran': (False, "Use oneAPI Fortran compiler ifx instead of classic Intel Fortran compiler"),
51+
'oneapi_fortran': (None, "Use oneAPI Fortran compiler ifx instead of classic Intel Fortran compiler "
52+
"(auto-enabled for Intel compilers version 2024.0.0, or newer)"),
5253
})
5354

5455
def _set_compiler_vars(self):
@@ -75,6 +76,9 @@ def set_variables(self):
7576
# auto-enable use of oneAPI C/C++ compilers for sufficiently recent versions of Intel compilers
7677
comp_ver = self.get_software_version(self.COMPILER_MODULE_NAME)[0]
7778
if LooseVersion(comp_ver) >= LooseVersion('2022.2.0'):
79+
if LooseVersion(comp_ver) >= LooseVersion('2024.0.0'):
80+
if self.options.get('oneapi_fortran', None) is None:
81+
self.options['oneapi_fortran'] = True
7882
if self.options.get('oneapi_c_cxx', None) is None:
7983
self.options['oneapi_c_cxx'] = True
8084

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#%Module
2+
proc ModulesHelp { } {
3+
puts stderr {
4+
5+
Description
6+
===========
7+
Intel C, C++ & Fortran compilers (classic and oneAPI)
8+
9+
10+
More information
11+
================
12+
- Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html
13+
}
14+
}
15+
16+
module-whatis {Description: Intel C, C++ & Fortran compilers (classic and oneAPI)}
17+
module-whatis {Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html}
18+
module-whatis {URL: https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html}
19+
20+
set root /tmp/intel-compilers/2024.0.0
21+
22+
conflict intel-compilers
23+
24+
prepend-path CPATH $root/tbb/2021.11/include
25+
prepend-path LD_LIBRARY_PATH $root/compiler/2024.0/linux/lib
26+
prepend-path LD_LIBRARY_PATH $root/tbb/2021.11/lib/intel64/gcc4.8
27+
prepend-path LIBRARY_PATH $root/compiler/2024.0/linux/lib
28+
prepend-path LIBRARY_PATH $root/tbb/2021.11/lib/intel64/gcc4.8
29+
prepend-path MANPATH $root/compiler/2024.0/share/man
30+
prepend-path OCL_ICD_FILENAMES $root/compiler/2024.0/lib/libintelocl.so
31+
prepend-path PATH $root/compiler/2024.0/bin
32+
prepend-path TBBROOT $root/tbb/2021.11
33+
setenv EBROOTINTELMINCOMPILERS "$root"
34+
setenv EBVERSIONINTELMINCOMPILERS "2024.0.0"
35+
setenv EBDEVELINTELMINCOMPILERS "$root/easybuild/Core-intel-compilers-2024.0.0-easybuild-devel"
36+
37+
# Built with EasyBuild version 4.8.2

test/framework/toolchain.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,37 @@ def test_intel_toolchain_oneapi(self):
14961496
self.assertEqual(os.getenv('F90'), 'ifx')
14971497
self.assertEqual(os.getenv('FC'), 'ifx')
14981498

1499+
self.modtool.purge()
1500+
tc = self.get_toolchain('intel-compilers', version='2024.0.0')
1501+
tc.prepare()
1502+
1503+
# by default (for version >= 2024.0.0): oneAPI C/C++ compiler + oneAPI Fortran compiler
1504+
self.assertEqual(os.getenv('CC'), 'icx')
1505+
self.assertEqual(os.getenv('CXX'), 'icpx')
1506+
self.assertEqual(os.getenv('F77'), 'ifx')
1507+
self.assertEqual(os.getenv('F90'), 'ifx')
1508+
self.assertEqual(os.getenv('FC'), 'ifx')
1509+
1510+
self.modtool.purge()
1511+
tc = self.get_toolchain('intel-compilers', version='2024.0.0')
1512+
tc.set_options({'oneapi_fortran': False})
1513+
tc.prepare()
1514+
self.assertEqual(os.getenv('CC'), 'icx')
1515+
self.assertEqual(os.getenv('CXX'), 'icpx')
1516+
self.assertEqual(os.getenv('F77'), 'ifort')
1517+
self.assertEqual(os.getenv('F90'), 'ifort')
1518+
self.assertEqual(os.getenv('FC'), 'ifort')
1519+
1520+
self.modtool.purge()
1521+
tc = self.get_toolchain('intel-compilers', version='2024.0.0')
1522+
tc.set_options({'oneapi_c_cxx': False, 'oneapi_fortran': False})
1523+
tc.prepare()
1524+
self.assertEqual(os.getenv('CC'), 'icc')
1525+
self.assertEqual(os.getenv('CXX'), 'icpc')
1526+
self.assertEqual(os.getenv('F77'), 'ifort')
1527+
self.assertEqual(os.getenv('F90'), 'ifort')
1528+
self.assertEqual(os.getenv('FC'), 'ifort')
1529+
14991530
self.modtool.purge()
15001531
tc = self.get_toolchain('intel', version='2021b')
15011532
tc.set_options({'oneapi_c_cxx': True})

0 commit comments

Comments
 (0)