fortran-lang / stdlib

Fortran Standard Library
https://stdlib.fortran-lang.org
MIT License
1.05k stars 164 forks source link

Build failure in test-drive with Windows/Intel compiler #850

Open bapthorpe opened 1 month ago

bapthorpe commented 1 month ago

Description

stdlib-0.7.0 fails to build using ifx (Windows/Intel) in test-drive/main.f90(?) with

[build] _deps/test-drive-build/test/CMakeFiles/test-drive-tester.dir\C:/Users/bapthorpe/codes/g/stdlib/build/_deps/test-drive-src/test\main.f90(42): error #5533: Feature found on this line is not yet supported in ifx 
[build]         call run_selected(testsuites(is)%collect, test_name, error_unit, stat)
[build] -------------^
[build] compilation aborted for _deps\test-drive-build\test\CMakeFiles\test-drive-tester.dir\main.f90-pp.f90 (code 3)
[build] Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2022.0.0 Build 20211123

Steps to reproduce:

  1. Unpack archive stdlib-0.7.0.zip
  2. Change directory to package root (cd .\stdlib)
  3. Set up environment variables for Intel compiler (run setvars.bat)
  4. Configure with cmake -S . -B build -G Ninja
  5. Change directory to build directory (cd build)
  6. Build with ninja

It's not clear which language feature is not supported by this version of ifx. Likewise, it's also not clear where to find test-drive or main.f90 in the source tree (I can find it in the build tree but that doesn't help if I need to modify the code for debugging...)

Reconfiguring with cmake -B build -S . -G Ninja -DBUILD_TESTING:Bool=OFF leads to a different error so bypassing tests doesn't help. This is the first error encountered in a minimal reference release build.

Expected Behaviour

The same code (stdlib-0.7.0.tar.gz) builds cleanly on RHEL 8.8 with ifx Version 2022.2.0 Build 20220730. This might be resolved by upgrading the compiler but this is on a work machine so I'm at the mercy of what our IT staff provides.

Version of stdlib

v0.7.0 release

Platform and Architecture

Windows x64

Additional Information

[main] Building folder: c:/Users/bapthorpe/codes/g/stdlib/build 
[build] Starting build
[proc] Executing command: C:\Users\bapthorpe\codes\bin\cmake.CMD --build c:/Users/bapthorpe/codes/g/stdlib/build --config Debug --target all --
[build] [10/1347   0% :: 0.295] Building Fortran object src\CMakeFiles\fortran_stdlib.dir\stdlib_system.F90.obj
[build] [11/1347   0% :: 0.332] Building Fortran object src\CMakeFiles\fortran_stdlib.dir\stdlib_kinds.f90.obj
[build] [12/1347   0% :: 0.428] Building Fortran object _deps\test-drive-build\test\CMakeFiles\test-drive-tester.dir\main.f90.obj
[build] FAILED: _deps/test-drive-build/test/CMakeFiles/test-drive-tester.dir/main.f90.obj 
[build] C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin\ifx.exe  /nologo /fpp -DWITH_QP=1 -DWITH_XDP=0 -IC:\Users\bapthorpe\codes\g\stdlib\build\_deps\test-drive-src\test -IC:\Users\bapthorpe\codes\g\stdlib\build\_deps\test-drive-build\include -module:_deps\test-drive-build\test /Fo_deps\test-drive-build\test\CMakeFiles\test-drive-tester.dir\main.f90.obj /Fd -c _deps\test-drive-build\test\CMakeFiles\test-drive-tester.dir\main.f90-pp.f90
[build] #0 0x00007FF7659C8DB5 (0x0000023215AC0540 0x0000000000000012 0x0000023215AC0540 0x0000023215AC0CD0)
[build] #1 0x00007FF7659C8D8A (0x0000023214F0F370 0x00007FF768289A38 0x0000000000000000 0x0000000000000000)
[build] #2 0x00007FF7658F2314 (0x0000000000000000 0x8000002C0000000D 0x0000023214C5B008 0x00007FF76592F476)
[build] #3 0x00007FF7658F9FCD (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000023215AB0210)
[build] #4 0x00007FF7658F9A1B (0x000000000000000B 0x000000000000000B 0x0000023214C48640 0x00007FF765E5923E)
[build] #5 0x00007FF76595A0CC (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
[build] #6 0x00007FF765958EE1 (0x0000000000000007 0x0000023214BEEAF0 0x0000023215A10C00 0x0000023215160270)
[build] #7 0x00007FF765A180AC (0x0000000000000000 0x0000901120309051 0x0000000000000007 0x0000023215A20700)
[build] #8 0x00007FF765A1868D (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
[build] #9 0x00007FF765A155A4 (0x0000000000000007 0x0000023214BEEAF0 0x00000232159F0CC0 0x0000023215150BA0)
[build] #10 0x00007FF765A180AC (0x0000000000000000 0x00009011203091D1 0x0000000000000007 0x0000023215A009D0)
[build] #11 0x00007FF765A1868D (0x0000000000000000 0x0000000000000000 0x0000008DF978F8A8 0x0000008DF978F8A0)
[build] #12 0x00007FF765A155A4 (0x0000000000000007 0x0000023214BEEAF0 0x00000232159A0D80 0x0000023215150720)
[build] #13 0x00007FF765A180AC (0x0000000000000000 0x0000901120309F51 0x0000000000000007 0x0000023215990BB0)
[build] #14 0x00007FF765A1868D (0x0000000000000000 0x0000023215140E70 0x0000008DF978FA28 0x0000008DF978FA20)
[build] #15 0x00007FF765A155A4 (0x0000000000000000 0x00000232151301F0 0x8000001100000008 0x0000023215260F30)
[build] #16 0x00007FF765A180AC (0x0000000000000009 0x000000000000000F 0x00000232150E034C 0x0000901120309CD1)
[build] #17 0x00007FF765A1868D (0xFFFFFF004B4C4224 0x0000008DF978FD70 0x0000023214F2CEB0 0x00007FF765922980)
[build] #18 0x00007FF765A1AA18 (0x0000023214C21A30 0x0001656C706D6F63 0x0000023215430DF0 0x0000901120309D81)
[build] #19 0x00007FF765A180AC (0x0000008DF978FCC8 0x00007FF76599FC7D 0x8000000100000000 0x00007FF76872B158)
[build] #20 0x00007FF765A1522D (0x8000000100000000 0x524554534554000F 0x4F4D24454C494624 0x00000232151C0044)
[build] #21 0x00007FF765A180AC (0x00000232151C04E0 0x0000000000000000 0x0000000000000000 0x00007FF7658CF5C2)
[build] #22 0x00007FF7658CF19A (0x0000000000000001 0x00007FF76872B158 0x00007FF7679A4B30 0x0000000000000000)
[build] #23 0x00007FF7658CE9EA (0x00007FF700008002 0x0000023214B6C650 0x0000000000000024 0x00007FF700000002)
[build] #24 0x00007FF765A62AE3 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
[build] #25 0x00007FF767965E70 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
[build] #26 0x00007FF8C9697344 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
[build] #27 0x00007FF8C98FCC91 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
[build] 
[build] _deps/test-drive-build/test/CMakeFiles/test-drive-tester.dir\C:/Users/bapthorpe/codes/g/stdlib/build/_deps/test-drive-src/test\main.f90(42): error #5533: Feature found on this line is not yet supported in ifx 
[build]         call run_selected(testsuites(is)%collect, test_name, error_unit, stat)
[build] -------------^
[build] compilation aborted for _deps\test-drive-build\test\CMakeFiles\test-drive-tester.dir\main.f90-pp.f90 (code 3)
[build] [12/1347   0% :: 0.743] Building Fortran preprocessed example\bitsets\CMakeFiles\example_bitsets_value.dir\example_bitsets_value.f90-pp.f90
[build] Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2022.0.0 Build 20211123
[build] Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
[build] 
bapthorpe commented 1 month ago

Also from README.md:

To build the Fortran standard library you need

- a Fortran 2008 compliant compiler, or better, a Fortran 2018 compliant compiler
  (GCC Fortran and Intel Fortran compilers are known to work for stdlib)
- CMake version 3.14 or newer (alternatively Make can be used)
- a build backend for CMake, like Make or Ninja (the latter is recommended on Windows)
- the [fypp](https://github.com/aradi/fypp) preprocessor (used as meta-programming tool)

If we can isolate which feature is tripping up ifx, we can see if it falls under F2008 or later. If it's a F2008 feature, it may not be worth addressing because the compiler doesn't meet requirements. If it's a later feature, it should either be downgraded or requirements should be updated.

I understand that the Windows/Intel platform is difficult to test due to the cost and availability of the compiler. Hopefully this is an easily fixed edge case.