-
Notifications
You must be signed in to change notification settings - Fork 192
Error stop improvements #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. LGTM.
I originally authored this routine, which is updated for supported compilers. The logic selecting it in CMake was no longer relevant.
126bf73
to
165276f
Compare
I think there is some value in keeping the pre-Fortran 2018 error stop workaround. The current default branch still compiles with Intel 19, with this patch we would drop support for all Intel versions before 2021.3.
❯ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.5.281 Build 20190815
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.
❯ ninja -C _build_i19/ -j1
ninja: Entering directory `_build_i19/'
[1/184] Building Fortran object src/CMakeFiles/fortran_stdlib.dir/stdlib_error.f90.o
FAILED: src/CMakeFiles/fortran_stdlib.dir/stdlib_error.f90.o src/mod_files/stdlib_error.mod
/opt/intel/2019/compilers_and_libraries_2019年5月28日1/linux/bin/intel64/ifort -I../src -Isrc/mod_files -module src/mod_files/ -warn declarations,general,usage,interfaces,unused -stand f18 -c src/CMakeFiles/fortran_stdlib.dir/stdlib_error.f90-pp.f90 -o src/CMakeFiles/fortran_stdlib.dir/stdlib_error.f90.o
../src/stdlib_error.f90(39): error #6345: Either a PAUSE, STOP or ERROR STOP statement has an invalid argument. [MSG]
if(.not.present(code)) error stop msg
--------------------------------------^
../src/stdlib_error.f90(42): error #6345: Either a PAUSE, STOP or ERROR STOP statement has an invalid argument. [CODE]
error stop code
---------------^
compilation aborted for src/CMakeFiles/fortran_stdlib.dir/stdlib_error.f90-pp.f90 (code 1)
ninja: build stopped: subcommand failed.
Also, while Intel 2021.1 compiles stdlib, the support for Fortran 2018 error stop is buggy and will always report exit status 128 even if zero is passed as exit code.
@scivision can you explain in a sentence or two what this PR changes or improves? I understand the part about the more robust test driver. What is the tradeoff for dropping support for earlier Intel compilers?
I originally authored this error_stop routine. The logic selecting it in CMake was no
longer relevant. I made a driver for the error stop test to make it more reliable.
oneAPI 2021.1 on MacOS has bugs breaking stdlib_error, so I update CI to latest oneAPI for MacOS.