1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
findent: Indents/beautifies/converts Fortran sources.
Prints dependencies based on:
- definitions and uses of modules and submodules
- include, #include and ??include statements
Findent can emit a script that uses findent to
create a dependencies file for use in an Makefile.
- findent supports Fortran-66 up to Fortran-2018
- findent can convert from fixed form to free form and vice-versa
- findent honours cpp and coco preprocess statements
- findent is validated against all constructs in
'Modern Fortran explained, Incorporating Fortran 2018, Metcalf e.a.'
- findent honours OpenMP conditionals
- findent runs in Unix and Windows
- high speed: 50K - 100K lines per second
- wrapper for processing one or more files in one call available
for Unix and Windows (wfindent and wfindent.bat respectively)
- vim, gedit, emacs: findent optionally emits configuration files
for these editors to use findent as a plugin.
- gui frontent available in a separate package: jfindent
Unix-Linux users with a 'decent' shell and make:
prerequisites: gnumake, g++
make findent and wfindent:
download findent-x.y.tgz
$ tar xf findent-x.y.z.tgz
$ cd findent-x.y
$ ./configure --prefix=<Your installation directory, default /usr/local>
$ make clean
$ make
On systems with sudo (Debian, Ubuntu, Linux Mint, ...):
$ sudo make install
On systems without sudo (Redhat, Scientific Linux, ...):
$ su -c 'make install'
if bison or flex are found, they will
be used to regenerate the parser and lexer
sources. See ./configure --help
You can create an Windows executable
(requires Ubuntu package g++-mingw-w64-i686):
$ ./configure --with-windows
$ make clean
$ make
If things are ok:
findent.exe will be available in src/
wfindent.bat is available in scripts/
Unix-Linux users for whom above recipe does not work:
prerequisites: a Bourne shell (sh, bash), C++ compiler
make findent:
download findent-x.y.tgz
$ tar xf findent-x.y.z.tgz
$ cd findent-x.y
edit simplemake.sh to fill in the correct values of
the name of the C++ compiler, default: g++
the compile flags, default: -O2
the name of the program to create, default: findent
$ sh simplemake.sh
copy the generated program to the desired location
( e.g. $HOME/bin).
make wfindent:
in the directory 'scripts' you find a template
for wfindent: wfindent.tmpl
edit wfindent.tmpl: change 'findent-location' into
the path to findent e.g. /usr/local/bin/findent.
Copy wfindent.tmpl to the desired location, e.g.:
$ cp wfindent.tmpl $HOME/bin/wfindent
Windows users: download findent-x.y.zip
$ unzip findent-x.y.zip
$ copy findent.exe C:\WINDOWS
$ copy wfindent.bat C:\WINDOWS
All systems:
Usage: $ findent -h
Examples: $ findent < in.f90 > out.f90
$ findent -i4 -Rr < in.f > out.f90
$ wfindent -i4 -Rr *.f
Usage with Make:
$ findent --makefdeps > makefdeps
$ chmod +x makefdeps
use something like the following in your Makefile:
include deps
dep deps:
./makefdeps *.f90 > deps
Of course, if makefdeps is not adequate for you, you
can create your own script, possibly inspired by makefdeps.
(g)vim users:
Install findent, the following command shows instructions
how to use findent in (g)vim:
findent --vim_help
Documentation:
in (g)vim:
:help equalprg
:help indentexpr
vim/README
and the comments in the files vim/findent.vim and vim/fortran.vim
gedit users:
Install findent, the following command shows instructions
how to use findent in gedit:
findent --gedit_help
emacs users:
Install findent, the following command shows instructions
how to use findent in emacs:
findent --emacs_help
|