[Scons-users] Strange intel fortran compiler issue.

Peter Diener diener at cct.lsu.edu
Wed Oct 30 11:49:38 EDT 2024


Hi all,

I have just encountered a very perplexing issue with SCons when compiling 
a Fortran code (with a few C++ files) on a Linux cluster I have gotten 
access to.

I don't have root on this machine and pip install in user space is not 
available. I therefore downloaded scons-local-4.8.1.tar.gz, unpacked it 
and created an scons alias for the scons.py script. Compilation of the 
source code using gfortran and g++ succeeded without problems but when I 
switch to the Intel oneAPI compilers the fortran depencies are not found 
correctly and the build fails.

The failure happens with both ifort and ifx (after copying ifort.py to 
ifx.py in scons-local-4.8.1/SCons/Tool and replacing ifort with ifx).
Now the strange thing is that the exact same source tree with essentially 
the same SConstruct file works perfectly fine on a different machine using 
the same (local) version of SCons and the intel oneAPI compilers (albeit a 
slightly older version).

I have been able to create a minimal example with just 2 Fortran file that 
shows the problem. I have attached the two Fortran files and the two 
simple SConstruct files for gnu and intel respectively.

When I run scons -Q --tree=prune -n -f SConstruct.gnu

I get:

Evaluating SConstruct.gnu
Evaluating module_sudoku.f90
Evaluating /sw/compiler/gcc-13.2.0/bin/gfortran
Evaluating module_sudoku.o
Evaluating sudoku.mod
gfortran -o module_sudoku.o -c -g -J. module_sudoku.f90
Evaluating reveal.f90
Evaluating reveal.o
gfortran -o reveal.o -c -g -J. reveal.f90
Evaluating reveal.x
gfortran -o reveal.x -g reveal.o module_sudoku.o
Evaluating .
+-.
   +-SConstruct.gnu
   +-module_sudoku.f90
   +-module_sudoku.o
   | +-module_sudoku.f90
   | +-/sw/compiler/gcc-13.2.0/bin/gfortran
   +-reveal.f90
   +-reveal.o
   | +-reveal.f90
   | +-sudoku.mod
   | | +-module_sudoku.f90
   | | +-/sw/compiler/gcc-13.2.0/bin/gfortran
   | +-/sw/compiler/gcc-13.2.0/bin/gfortran
   +-reveal.x
   | +-[reveal.o]
   | +-[module_sudoku.o]
   | +-/sw/compiler/gcc-13.2.0/bin/gfortran
   +-[sudoku.mod]

while I run scons -Q --tree=prune -n -f SConstruct.intel

I get:

Evaluating SConstruct.intel
Evaluating module_sudoku.f90
Evaluating reveal.f90
Evaluating /sw/compiler/rrz-wrapper/oneapi-2024.2.1/ifx
Evaluating reveal.x
ifx -o reveal.x -g reveal.f90 module_sudoku.f90
Evaluating .
+-.
   +-SConstruct.intel
   +-module_sudoku.f90
   +-reveal.f90
   +-reveal.x
     +-reveal.f90
     +-module_sudoku.f90
     +-/sw/compiler/rrz-wrapper/oneapi-2024.2.1/ifx

showing that scons does not find the dependency on the module.

On the other hand on the machine where things work running

scons -Q --tree=prune -n -f SConstruct.intel

gives:

Evaluating SConstruct.intel
Evaluating module_sudoku.f90
Evaluating /home/packages/compilers/intel/compiler/2022.0.2/linux/bin/ifx
Evaluating module_sudoku.o
Evaluating sudoku.mod
ifx -o module_sudoku.o -c -g -module . module_sudoku.f90
Evaluating reveal.f90
Evaluating reveal.o
ifx -o reveal.o -c -g -module . reveal.f90
Evaluating reveal.x
ifx -o reveal.x -g reveal.o module_sudoku.o
Evaluating .
+-.
   +-SConstruct.intel
   +-module_sudoku.f90
   +-module_sudoku.o
   | +-module_sudoku.f90
   | +-/home/packages/compilers/intel/compiler/2022.0.2/linux/bin/ifx
   +-reveal.f90
   +-reveal.o
   | +-reveal.f90
   | +-sudoku.mod
   | | +-module_sudoku.f90
   | | +-/home/packages/compilers/intel/compiler/2022.0.2/linux/bin/ifx
   | +-/home/packages/compilers/intel/compiler/2022.0.2/linux/bin/ifx
   +-reveal.x
   | +-[reveal.o]
   | +-[module_sudoku.o]
   | +-/home/packages/compilers/intel/compiler/2022.0.2/linux/bin/ifx
   +-[sudoku.mod]

showing that here scons was able to find the module dependency correctly.

So in summary: on one machine scons fails to build with the intel 
compilers (this uses Python 3.11.2) but works fine with the gnu compilers, 
while the exact same SConstruct files and source tree work on a different 
machine.

Does anybody have any idea what could cause something like this? Any 
suggestion as to how to debug this?

Cheers,

   Peter Diener
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module_sudoku.f90
Type: text/x-fortran
Size: 76 bytes
Desc: 
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20241030/e474a151/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reveal.f90
Type: text/x-fortran
Size: 91 bytes
Desc: 
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20241030/e474a151/attachment-0001.bin>
-------------- next part --------------
import sys
import os

env = DefaultEnvironment(ENV = {'PATH' : os.environ['PATH'],
                                'LD_LIBRARY_PATH' : os.getenv('LD_LIBRARY_PATH',default='')},
                         LINK = 'gfortran',
                         LINKFLAGS = '-g',
                         TOOLS= ['default', 'gfortran'])

env['F90FILESUFFIXES']=['.f90','.f']
env['F90']      = 'gfortran'
env['FORTRAN']  = 'gfortran'
env['F90FLAGS'] = ['-g']
env['FORTRANMODDIR'] = '.'

Export('env')

Progress('Evaluating $TARGET\n')

sources = ['reveal.f90',
          'module_sudoku.f90']

Program('reveal.x', sources)

Decider('MD5-timestamp')
-------------- next part --------------
import sys
import os

env = DefaultEnvironment(ENV = {'PATH' : os.environ['PATH'],
                                'LD_LIBRARY_PATH' : os.getenv('LD_LIBRARY_PATH',default='')},
                         LINK = 'ifx',
                         LINKFLAGS = '-g',
                         TOOLS= ['default', 'ifx'])

env['F90FILESUFFIXES']=['.f90','.f']
env['F90']      = 'ifx'
env['FORTRAN']  = 'ifx'
env['F90FLAGS'] = ['-g']
env['FORTRANMODDIR'] = '.'

Export('env')

Progress('Evaluating $TARGET\n')

sources = ['reveal.f90',
          'module_sudoku.f90']

Program('reveal.x', sources)

Decider('MD5-timestamp')


More information about the Scons-users mailing list