-
Notifications
You must be signed in to change notification settings - Fork 30
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
Using fypp through the Intel Fortran compilers #24
Comments
I had a look at it with a toy bash script as pre-processor. The ifort option seems to work somewhat differently from what is documented. It writes all the command line arguments it wants to pass to the pre-processor (including the source file name) into a file, and passes that file, prefixed with One could, in theory, implement the same feature in Fypp (one would have to parse |
So it actually uses response files? They were added also to GCC to support Windows platforms where command-line length limits exist. I small test on MacOS shows response files work here too: ivan:~/fortran/legacy$ cat debug
-Wall -Werror -g
ivan:~/fortran/legacy$ gfortran @debug -v loop_cycle.f
Driving: gfortran -Wall -Werror -g -v loop_cycle.f -mmacosx-version-min=12.5.0 -asm_macosx_version_min=12.5 -nodefaultexport -l gfortran -shared-libgcc
... My initial goal was to write an ifort command wrapper or perhaps simply a configuration file to get a "natural" experience of using the fypp preprocessor without a separate generation step. While non-portable to some extent, it simplifies the writing of build-system files. (Since our cluster has Intel CPUs dominantly, the Intel Fortran compiler is the de-facto standard one, hence I'm willing to sacrifice portability for a nicer developer experience.) |
I thought I'd mention that fpm on Windows also uses response files in the archiver and linker commands: fortran-lang/fpm#427. Given that fpm is in the process of adding a fypp wrapper (fortran-lang/fpm#729) it might become an issue for fpm sooner or later. |
I've opened an issue about the undocumented behavior at the Intel Fortran Forum: https://community.intel.com/t5/Intel-Fortran-Compiler/Undocumented-behavior-of-fpp-with-alternative-preprocessor/m-p/1411981#M162675 |
One of the moderators replied that the documentation will be amended. The exact layout of the response file remains somewhat under-specified for my taste. More information can be found here:
The GCC mail archives state the contents of the file are whitespace-separated strings. Presumably, this would mean the separator between option strings are all the tokens recognized by the C library function |
The Intel compilers provide a flag
-fpp-name=<name>
which can be used to specify an alternative preprocessor of the form:which prints output to STDOUT that will get captured by the compiler for further processing.
I've tried to use this with fypp, but I run into errors:
It seems like the compiler prepends
@
to the path, but otherwise it seems it could work. If you'd like to experiment, here is the toy code:Do you have any previous experience with such usage, or should I raise an issue at the Intel Fortran forum?
The text was updated successfully, but these errors were encountered: