SCons / scons

SCons - a software construction tool
http://scons.org
MIT License
2.07k stars 316 forks source link

intelc compiler support is out of date #3962

Open mwichmann opened 3 years ago

mwichmann commented 3 years ago

Created from the scons-users thread at https://pairlist4.pair.net/pipermail/scons-users/2021-June/008551.html and from a subsequent Discord chat.

The support for Intel compilers has gone out of date as the compilers have evolved and needs to be updated. The tool is not setting up properly, the user ended up with an error like

scons: *** While building `['cello.o']' from `['cello.cpp']': Don't know how to build from a source file with suffix `.cpp'.  Expected a suffix in this list: ['.c', '.m', '.i', '.fpp', '.FPP', '.I', '.f77', '.F77', '.i90', '.I90', '.f95', '.F95', '.f03', '.F03', '.f08', '.F08', '.s', '.asm', '.ASM', '.spp', '.SPP', '.sx', '.S', '.d']
mwichmann commented 2 years ago

Addendum: this applies to Intel Fortran as well (ifort and ifl tools are the existing ones for that)

mwichmann commented 2 years ago

Helpfully, there are now two Fortran compilers:

The Intel® oneAPI product packages provide two Fortran compilers. Intel® Fortran Compiler Classic (ifort) provides best-in-class Fortran language features and performance for CPU. The Intel® Fortran Compiler (ifx) enables developers needing OpenMP* offload to Intel GPUs. The OpenMP 5.0, 5.1 GPU offload features in ifx are not available in ifort.

dfox-coventor commented 1 year ago

Here is a gist with windows 10 registry values of intel products oneAPI 2022 (and also Intel Parallel Studio 2018.4 which does work with scons)

https://gist.github.com/dfox-coventor/c792495e8905e81c8a969c8eb3141040

dfox-coventor commented 1 year ago

So, we currently use Intel Parallel Studio 2018.4 C++ Compiler. And that is successfully discovered by existing intelc.py tool. You can see it in the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Intel\Suites\18.0\ path. However, oneAPI uses the following path... HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Intel\1ASuites\2022. So that's one difference.

mwichmann commented 1 year ago

I saw the one yesterday... there's a new path component. And now the versions are numeric-year rather than numeric like 16.0, 18.0, etc. Probably both require a bit of attention, but maybe this isn't as hard as it first seems?

mwichmann commented 1 year ago

Adding mine... the diff shows how environment variables are modified after running the setup script. ENVVAR-diff.txt oneapi-reg.txt

alexksr commented 7 months ago

From a question on the discord server, one (hacky) way to get Intel oneAPI to work with scons, is to use the module system Intel provides. When the scons command is issued in a shell where e.g. module load intel-oneapi/compiler was issued, one can use the shells env with env['ENV'] = os.environ.copy() in the SConstruct file. [bit off topic, only for completeness] Regarding Intels fortran MPI compiler: The MPI compiler mpiifort is not supported by SCons, but adding to the SConstruct

for dialect in ['F77', 'F90', 'FORTRAN', 'F95']:
  env[f'{dialect}'] = 'mpiifort'

makes things work.

mwichmann commented 7 months ago

Just so this is saved somewhere, someone compiled this table (in another context)

Here is a table of file extensions with default support by different compilers:

Compiler Fixed-form Fixed-form with preprocessor Free-form Free form with preprocessor
gfortran .f, .for, .ftn .fpp, .F, .FOR, .FPP, .FTN .f90, .f95, .f03, .f08 .F90, .F95, .F03, .F08
ifort .f, .for, .ftn, .i .fpp, .FPP, .F, .FOR, .FTN .f90, .i90 .F90
nvfortran .f .for .ftn .F .FOR .FTN .fpp .FPP .f90 .f95 .f03 .F90 .F95 .F03
nagfor .f, .for, .ftn .ff, .F .f90, .f95 .ff90, .ff95, .F90, .F95
Cray .f, .for .F, .FOR .f90, .f95, .f03, .f08, .f18, .ftn .F90, .F95, .F03, .F08, .F18, .FTN
IBM .f, .f77 .F, .F77 .f90, .f95, .f03, .f08 .F90, .F95, .F03, .F08
g95 .f, .for .F, .FOR .f90, .f95, .f03 .F90, .F95, .F03

The only options that are compatible along the tool-chains listed above are: .f, .F, .f90, .F90.