Skip to content

Commit

Permalink
Merge branch 'release-1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
baradi09 committed Apr 5, 2016
2 parents 918134f + bcbb699 commit 7e6bed2
Show file tree
Hide file tree
Showing 6 changed files with 985 additions and 628 deletions.
41 changes: 22 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
Fypp — Python powered Fortran metaprogramming
=============================================

Fypp is a Python powered Fortran preprocessor. It extends Fortran with
condititional compiling and template metaprogramming capabilities. Instead of
introducing its own expression syntax, it uses Python expressions in its
preprocessor directives, offering the consistency and flexibility of Python when
formulating metaprogramming tasks. It puts strong emphasis on robustness and on
neat integration into Fortran developing toolchains.
Fypp is a Python powered preprocessor. It can be used for any programming
languages but its primary aim is to offer a Fortran preprocessor, which helps to
extend Fortran with condititional compiling and template metaprogramming
capabilities. Instead of introducing its own expression syntax, it uses Python
expressions in its preprocessor directives, offering the consistency and
versatility of Python when formulating metaprogramming tasks. It puts strong
emphasis on robustness and on neat integration into developing toolchains.

The project is `hosted on bitbucket <http://bitbucket.org/aradi/fypp>`_.

Expand All @@ -33,10 +34,12 @@ Main features
Fortran standard)::

#:def assertTrue(cond)
#:if DEBUG > 0
if (.not. ${cond}$) then
print *, "Assert failed in file ${_FILE_}$, line ${_LINE_}$"
error stop
end if
#:endif
#:enddef

! Invoked via direct call (needs no quotation)
Expand All @@ -57,7 +60,7 @@ Main features
use serial
#:endif

* Iterated output (e.g. for Fortran templates)::
* Iterated output (e.g. for generating Fortran templates)::

interface myfunc
#:for dtype in [ 'real', 'dreal', 'complex', 'dcomplex' ]
Expand Down Expand Up @@ -109,33 +112,32 @@ Main features
#:mute
#:include "macrodefs.fypp"
#:endmute


Installing
==========

Fypp needs a working Python interpreter, either version 2.7 or version 3.2 or
above.
Fypp needs a Python interpreter of version 2.7, 3.2 or above.

Automatic install
-----------------

You can use Pythons installer `pip` to install the last stable release of Fypp
on your system::
Use Pythons command line installer ``pip`` in order to download the stable
release from the `Fypp page on PyPI <http://pypi.python.org/pypi/fypp>`_ and
install it on your system::

pip install fypp

This installs the command line tool ``fypp`` as well as the Python module
``fypp``. Latter you can import if you want to access the functionality of Fypp
directly from within your Python scripts.
This installs both, the command line tool ``fypp`` and the Python module
``fypp.py``. Latter you can import if you want to access the functionality of
Fypp directly from within your Python scripts.


Manual install
--------------

Alternatively, you can download the source code from the `Fypp project website
<http://bitbucket.org/aradi/fypp>`_ ::
For a manual install, you can download the source code from the `Fypp project
website <http://bitbucket.org/aradi/fypp>`_ ::

git clone https://[email protected]/aradi/fypp.git

Expand Down Expand Up @@ -164,6 +166,7 @@ environment variable, by just issuing ::

fypp

The python module ``fypp.py`` can be found in ``FYP_SOURCE_FOLDER/src``.


Running
Expand All @@ -172,9 +175,9 @@ Running
The Fypp command line tool reads a file, preprocesses it and writes it to
another file, so you would typically invoke it like::

fypp source.fypp source.f90
fypp source.F90 source.f90

which would process `source.fypp` and write the result to `source.f90`. If
which would process `source.F90` and write the result to `source.f90`. If
input and output files are not specified, information is read from stdin and
written to stdout.

Expand Down
Loading

0 comments on commit 7e6bed2

Please sign in to comment.