Improved documentation

Version:1.2.21

Version:1.2.20
This commit is contained in:
Anthony Scemama 2013-07-08 23:40:40 +02:00
parent bcfc768b7a
commit ff34366fde
12 changed files with 158 additions and 54 deletions

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
.PHONY: all src man
all: src man
src:
$(MAKE) -C $@
man:
$(MAKE) -C $@

52
README
View File

@ -1,35 +1,47 @@
+==============================================================================+
| IRPF90 |
+==============================================================================+
======
IRPF90
======
Dependencies:
-------------
Dependencies
------------
- GNU make (3.81 recommended)
- GNU make (>= 3.81 recommended)
- Python > 2.3
- Any Fortran 90 compiler (gfortran, for example)
- Any Fortran 90 compiler (Intel recommended, for example)
Installing IRPF90:
------------------
Installing IRPF90
-----------------
- As the super-user, run
./irpf90.install
${IRPF90_HOME} is the location of your irpf90 directory::
cd ${IRPF90_HOME}
make
cat << EOF >> ${HOME}/.bash_profile
export PYTHONPATH=${IRPF90_HOME}/src:${PYTHONPATH}
export PATH=${IRPF90_HOME}/bin:${PATH}
EOF
Using IRPF90:
-------------
Using IRPF90
------------
In an empty directory, run::
irpf90 --init
In an empty directory, run:
irpf90 -init
This command creates a new Makefile suitable for most irpf90 projects.
Now you can start to program using irpf90.
Web Site:
Web Site
--------
http://irpf90.ups-tlse.fr
Author:
Anthony Scemama, LCPQ-IRSAMC, CNRS-Universite Paul Sabatier
scemama@irsamc.ups-tlse.fr
http://irpf90.ups-tlse.fr/index.php?title=Anthony_Scemama
Author
------
| Anthony Scemama, LCPQ-IRSAMC, CNRS-Universite Paul Sabatier
| scemama@irsamc.ups-tlse.fr
| http://scemama.mooo.com

View File

@ -1,4 +1,4 @@
IRPF90 = irpf90 -a -d
IRPF90 = ~/irpf90/bin/irpf90 -a -d
FC = gfortran
FCFLAGS= -O2

View File

@ -12,22 +12,14 @@ END_PROVIDER
BEGIN_PROVIDER [ integer, u1 ]
integer :: fu
u1 = fu(d1,d2)
integer :: n, m
n=3
do i=1,n
print *, i
enddo
m=2
do i=1,m
print *, i
enddo
! PROVIDE u2
! u1 = fu(d1,d2)
u1 = d1+d2+1
END_PROVIDER
BEGIN_PROVIDER [ integer, u2 ]
integer :: fu
u2 = fu(d3,d4)
! u2 = fu(d3,d4)
u2 = d3+d4+1
END_PROVIDER
integer function fu(x,y)

1
man/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
options.rst

12
man/Makefile Normal file
View File

@ -0,0 +1,12 @@
RST2MAN=rst2man -d -t
default: man1/irpman.1.gz man1/irpf90.1.gz
options.rst: ../src/command_line.py
python ../src/command_line.py > options.rst
man1/irpf90.1.gz: irpf90.rst options.rst
rm -f $@ ; $(RST2MAN) --title="IRP Fortran 90" irpf90.rst man1/irpf90.1 ; gzip man1/irpf90.1
man1/irpman.1.gz: irpman.rst
rm -f $@ ; $(RST2MAN) --title="IRP man" irpman.rst man1/irpman.1 ; gzip man1/irpman.1

36
man/irpf90.rst Normal file
View File

@ -0,0 +1,36 @@
======
IRPF90
======
----------------------------------------------------------
Fortran programming using Implicit Reference to Parameters
----------------------------------------------------------
:Author: Anthony Scemama scemama@irsamc.ups-tlse.fr
:Version: 1.20
:Manual section: 1
SYNOPSIS
========
irpf90 [options]
DESCRIPTION
===========
irpf90 provides a programming environment which simplifies Fortran
programming, via the Implicit Reference to Parameters (IRP) method.
For more details, read the tutorial ditributed with the package
or visit http://irpf90.ups-tlse.fr
OPTIONS
=======
.. include:: options.rst
SEE ALSO
========
* irpman
* http://irpf90.ups-tlse.fr

32
man/irpman.rst Normal file
View File

@ -0,0 +1,32 @@
======
IRPman
======
----------------------------------------------------
Developper's documentation in the irpf90 environment
----------------------------------------------------
:Author: Anthony Scemama scemama@irsamc.ups-tlse.fr
:Version: 1.20
:Manual section: 1
SYNOPSIS
========
irpman variable
DESCRIPTION
===========
irpman is a documentation environment for IRPF90. Every IRP
variable (described with a BEGIN_PROVIDER ... END_PROVIDER block)
has an associated manual page. When a provider contains a
documentation block (BEGIN_DOC ... END_DOC), the text entered inside
the block is displayed in the manual page of the variable.
SEE ALSO
========
* irpf90
* http://irpf90.ups-tlse.fr

Binary file not shown.

Binary file not shown.

View File

@ -31,21 +31,21 @@ import re
description = "IRPF90 Fortran preprocessor."
options = {}
options['d'] = [ 'debug' , 'Activate debug', 0 ]
options['v'] = [ 'version' , 'Print version of irpf90', 0 ]
options['a'] = [ 'assert' , 'Activate assertions', 0 ]
options['d'] = [ 'debug' , 'Activates debug. The name of the current subroutine/function/provider will be printed on the standard output when entering or exiting a routine, as well as the CPU time passed inside the routine.', 0 ]
options['v'] = [ 'version' , 'Prints version of irpf90', 0 ]
options['a'] = [ 'assert' , 'Activates ASSERT statements. If absent, remove ASSERT statements.', 0 ]
options['h'] = [ 'help' , 'Print this help', 0 ]
options['i'] = [ 'init' , 'Initialize current directory', 0 ]
options['D'] = [ 'define' , 'Define variable', 1 ]
options['o'] = [ 'checkopt' , 'Show where optimization may be required', 0 ]
options['p'] = [ 'preprocess' , 'Preprocess file', 1 ]
options['g'] = [ 'profile' , 'Generate profile code', 0 ]
options['t'] = [ 'touch' , 'Display which entities are touched', 1 ]
options['m'] = [ 'memory' , 'Debug memory info', 0 ]
options['z'] = [ 'openmp' , 'Automatic openMP tasks (may not work)', 0 ]
options['l'] = [ 'align' , 'Align arrays using compiler directives. Sets the $IRP_ALIGN variable', 1 ]
options['s'] = [ 'substitute' , 'Substitute values for loop max values', 1 ]
options['r'] = [ 'no_directives', 'Ignore compiler directives !DEC$ and !DIR$', 0 ]
options['i'] = [ 'init' , 'Initialize current directory. Creates a default Makefile and the temporary working directories.', 0 ]
options['D'] = [ 'define' , 'Defines a variable identified by the IRP_IF statements.', 1 ]
options['o'] = [ 'checkopt' , 'Shows where optimization may be required', 0 ]
options['p'] = [ 'preprocess' , 'Prints a preprocessed file to standard output. Useful for debugging files containing shell scripts.', 1 ]
options['g'] = [ 'profile' , 'Activates profiling of the code.', 0 ]
options['t'] = [ 'touch' , 'Display which entities are touched when touching the variable given as an argument.', 1 ]
options['m'] = [ 'memory' , 'Print memory allocations/deallocations.', 0 ]
#options['z'] = [ 'openmp' , 'Automatic openMP tasks (may not work)', 0 ]
options['l'] = [ 'align' , 'Align arrays using compiler directives and sets the $IRP_ALIGN variable. For example, --align=32 aligns all arrays on a 32 byte boundary.', 1 ]
options['s'] = [ 'substitute' , 'Substitute values in do loops for generating specific optimized code.', 1 ]
options['r'] = [ 'no_directives', 'Ignore all compiler directives !DEC$ and !DIR$', 0 ]
options['n'] = [ 'inline' , 'all|providers|builders : Force inlining of providers or builders', 1 ]
options['u'] = [ 'unused' , 'Print unused providers', 0 ]
@ -135,12 +135,7 @@ Options:
t = t.replace("$EXE",self.executable_name)
t = t.replace("$DESCR",description)
print t
sorted = options.keys()
sorted.sort()
for o in sorted:
print " -%s , --%15s : %s"%(o,options[o][0].ljust(15),options[o][1])
if options[o][2] == 1:
print " Requires an argument"
print_options()
print ""
print "Version : ", version
print ""
@ -195,3 +190,17 @@ do_$LONG = property(fget=do_$LONG)
command_line = CommandLine()
def print_options():
keys = options.keys()
keys.sort()
import subprocess, threading
for k in keys:
description = options[k][1]
p1 = subprocess.Popen(["fold", "-s", "-w", "40"],stdout=subprocess.PIPE,stdin=subprocess.PIPE)
description = p1.communicate(description)[0]
description = description.replace('\n','\n'.ljust(27))
print ("-%s, --%s"%(k,options[k][0])).ljust(25), description+'\n'
if __name__ == '__main__':
print_options()

View File

@ -1 +1 @@
version = "1.2.18"
version = "1.2.20"