User Tools

Site Tools


dev:fypp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:fypp [2017/01/26 18:03] – typo pseewalddev:fypp [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Fortran metaprogramming using Fypp ====== ====== Fortran metaprogramming using Fypp ======
-Fypp ([[https://bitbucket.org/aradi/fypp|official repository]]) is a Fortran preprocessor based on Python expressions. Fypp directives can be used in all CP2K Fortran source files for metaprogramming For simple tasks (such as conditional compilation and include statements), the default Fortran preprocessor (cpp or fpp) can still be used. However cpp is very limited and if more advanced metaprogramming capability is needed (loop unrolling, templates, code generation), usage of Fypp is highly encouraged. In particular code generators should be written using Fypp instead of custom scripts (if feasible). CP2K's own template engine is deprecated and templates should be implemented using Fypp.+Fypp ([[https://bitbucket.org/aradi/fypp|official repository]]) is a Fortran preprocessor based on Python expressions. Fypp directives can be used in all CP2K Fortran source files. For simple metaprogramming tasks (such as conditional compilation and include statements), the default Fortran preprocessor (cpp or fpp) can still be used. However cpp is very limited and if more advanced metaprogramming capability is needed (loop unrolling, templates, code generation), usage of Fypp is highly encouraged. In particular code generators should be written using Fypp instead of custom scripts (if feasible).
  
-For getting started with Fypp, read the [[http://fypp.readthedocs.io/en/latest/|official documentation]].+For getting started with Fypp, read the [[http://fypp.readthedocs.io/en/stable/|official documentation]]
 +===== Debugging Fypp directives ===== 
 +Compiler and runtime messages always refer to the original (not preprocessed) ''.F'' file such that Fypp-preprocessed files can usually be ignored. Only for debugging Fypp directives, it is sometimes necessary to consider preprocessed Fortran sources. After compiling CP2K, all Fypp-preprocessed sources are stored in ''cp2k/obj'' with ''.F90'' extension. In order to find a specific line in a preprocessed file, consider the [[http://fypp.readthedocs.io/en/stable/fypp.html#line-numbering-markers|line numbering markers]]. 
 + 
 +By default, CP2K invokes Fypp with ''-n'' option. To invoke Fypp with other options, put ''FYPPFLAGS=<options>'' in your ''arch'' file. To learn about all Fypp options, invoke ''cp2k/tools/build_utils/fypp -h''.
dev/fypp.1485453835.txt.gz · Last modified: 2020/08/21 10:14 (external edit)