Strange intel fortran compiler issue.

Peter Diener via Scons-users <[email protected]> Wed, 30 Oct 2024 10:49:38 -0500 (CDT)
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
--0-12567054-1730303379=:11762
Content-Type: text/plain; format=flowed; charset=US-ASCII

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
--0-12567054-1730303379=:11762
Content-Type: text/x-fortran; name=module_sudoku.f90
Content-Transfer-Encoding: BASE64
Content-ID: <[email protected]>
Content-Description: 
Content-Disposition: attachment; filename=module_sudoku.f90

TU9EVUxFIHN1ZG9rdQ0KDQogIElOVEVHRVIsIFBBUkFNRVRFUiA6OiBzZWNy
ZXQ9IDQ1DQogIA0KRU5EIE1PRFVMRSBzdWRva3UNCg==

--0-12567054-1730303379=:11762
Content-Type: text/x-fortran; name=reveal.f90
Content-Transfer-Encoding: BASE64
Content-ID: <[email protected]>
Content-Description: 
Content-Disposition: attachment; filename=reveal.f90

UFJPR1JBTSByZXZlYWwNCg0KICBVU0Ugc3Vkb2t1DQoNCiAgUFJJTlQqLCdU
aGUgc2VjcmV0IGlzICcsIHNlY3JldA0KDQpFTkQgUFJPR1JBTSByZXZlYWwN
Cg==

--0-12567054-1730303379=:11762
Content-Type: text/plain; charset=US-ASCII; name=SConstruct.gnu
Content-Transfer-Encoding: BASE64
Content-ID: <[email protected]>
Content-Description: 
Content-Disposition: attachment; filename=SConstruct.gnu

aW1wb3J0IHN5cw0KaW1wb3J0IG9zDQoNCmVudiA9IERlZmF1bHRFbnZpcm9u
bWVudChFTlYgPSB7J1BBVEgnIDogb3MuZW52aXJvblsnUEFUSCddLA0KICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnTERfTElCUkFSWV9QQVRI
JyA6IG9zLmdldGVudignTERfTElCUkFSWV9QQVRIJyxkZWZhdWx0PScnKX0s
DQogICAgICAgICAgICAgICAgICAgICAgICAgTElOSyA9ICdnZm9ydHJhbics
DQogICAgICAgICAgICAgICAgICAgICAgICAgTElOS0ZMQUdTID0gJy1nJywN
CiAgICAgICAgICAgICAgICAgICAgICAgICBUT09MUz0gWydkZWZhdWx0Jywg
J2dmb3J0cmFuJ10pDQoNCmVudlsnRjkwRklMRVNVRkZJWEVTJ109WycuZjkw
JywnLmYnXQ0KZW52WydGOTAnXSAgICAgID0gJ2dmb3J0cmFuJw0KZW52WydG
T1JUUkFOJ10gID0gJ2dmb3J0cmFuJw0KZW52WydGOTBGTEFHUyddID0gWyct
ZyddDQplbnZbJ0ZPUlRSQU5NT0RESVInXSA9ICcuJw0KDQpFeHBvcnQoJ2Vu
dicpDQoNClByb2dyZXNzKCdFdmFsdWF0aW5nICRUQVJHRVRcbicpDQoNCnNv
dXJjZXMgPSBbJ3JldmVhbC5mOTAnLA0KICAgICAgICAgICdtb2R1bGVfc3Vk
b2t1LmY5MCddDQoNClByb2dyYW0oJ3JldmVhbC54Jywgc291cmNlcykNCg0K
RGVjaWRlcignTUQ1LXRpbWVzdGFtcCcpDQo=

--0-12567054-1730303379=:11762
Content-Type: text/plain; charset=US-ASCII; name=SConstruct.intel
Content-Transfer-Encoding: BASE64
Content-ID: <[email protected]>
Content-Description: 
Content-Disposition: attachment; filename=SConstruct.intel

aW1wb3J0IHN5cw0KaW1wb3J0IG9zDQoNCmVudiA9IERlZmF1bHRFbnZpcm9u
bWVudChFTlYgPSB7J1BBVEgnIDogb3MuZW52aXJvblsnUEFUSCddLA0KICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnTERfTElCUkFSWV9QQVRI
JyA6IG9zLmdldGVudignTERfTElCUkFSWV9QQVRIJyxkZWZhdWx0PScnKX0s
DQogICAgICAgICAgICAgICAgICAgICAgICAgTElOSyA9ICdpZngnLA0KICAg
ICAgICAgICAgICAgICAgICAgICAgIExJTktGTEFHUyA9ICctZycsDQogICAg
ICAgICAgICAgICAgICAgICAgICAgVE9PTFM9IFsnZGVmYXVsdCcsICdpZngn
XSkNCg0KZW52WydGOTBGSUxFU1VGRklYRVMnXT1bJy5mOTAnLCcuZiddDQpl
bnZbJ0Y5MCddICAgICAgPSAnaWZ4Jw0KZW52WydGT1JUUkFOJ10gID0gJ2lm
eCcNCmVudlsnRjkwRkxBR1MnXSA9IFsnLWcnXQ0KZW52WydGT1JUUkFOTU9E
RElSJ10gPSAnLicNCg0KRXhwb3J0KCdlbnYnKQ0KDQpQcm9ncmVzcygnRXZh
bHVhdGluZyAkVEFSR0VUXG4nKQ0KDQpzb3VyY2VzID0gWydyZXZlYWwuZjkw
JywNCiAgICAgICAgICAnbW9kdWxlX3N1ZG9rdS5mOTAnXQ0KDQpQcm9ncmFt
KCdyZXZlYWwueCcsIHNvdXJjZXMpDQoNCkRlY2lkZXIoJ01ENS10aW1lc3Rh
bXAnKQ0K

--0-12567054-1730303379=:11762
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users

--0-12567054-1730303379=:11762--