Comments (5)
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 @
to the pre-processor. The pre-processor is supposed to recognize the @
prefix and treat the content of the file as command line arguments. While GNU cpp seems to be capable to do so (although, I did not find this feature anywhere documented), fypp is currently not.
One could, in theory, implement the same feature in Fypp (one would have to parse sys.argv
before optparse
sees it) and pass the extracted list of arguments to optparse. But first, it would be good to know, that this is the intended long term behavior of the ifort compiler...
from fypp.
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.)
from fypp.
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.
from fypp.
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
from fypp.
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:
- Use Response Files | Intel DPC++ Compiler
- @ (Specify a Compiler Response File) | MSVC Compiler Options
- The Response File Command | MIDL, Win32
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 isspace
.
from fypp.
Related Issues (20)
- block/call macros: Is there a way to define a fypp custom macro in a procedural manner? HOT 2
- Multiple tuple returns for #:for HOT 1
- Dependency generation for fypp HOT 2
- Parsing the code -- choice HOT 1
- Linemarkers with Intel oneAPI compilers HOT 1
- `pip install fypp` breaks on Python 2.7, using `pip3 install fypp` works. HOT 3
- Accessing Python dictionaries within fypp HOT 5
- Variadic templates with fypp HOT 5
- expanding macro in include directive HOT 1
- parsing cmake variables values of bool HOT 5
- Logical test behaves different in a def'ed macro compares to outside of macro HOT 2
- Fedora packaging HOT 2
- fypp with pypy throwing a FyppFatalError/NameError HOT 2
- test/input/filevarroot.fypp missing in 3.2 tarball on PyPI
- Macro changes HOT 3
- Feature: Print result directly to an output file in the *same directory* as the input file HOT 5
- Kernel launcher HOT 6
- Enhancement request : detect repeated #:def with the same signature
- Append method for lists HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fypp.