1			  INSTALLING FTNCHEK
2
3To build and install ftnchek, follow the instructions below for your
4operating system.
5
6
7(1) UNIX and UNIX-like systems
8
9   Unpacking ftnchek: If the file you received is a UNIX compressed
10   tar file, suffix .Z, you should first unzip it using the UNIX
11   ``uncompress'' command, and then give it as input to ``tar'' to
12   unpack the files.  For example, assuming the file has been placed
13   in the desired directory, and is named ftnchek.tar.Z, you would
14   give the two UNIX commands
15
16      uncompress ftnchek.tar.Z
17      tar -xf ftnchek.tar
18
19   If the suffix is .gz instead of .Z, use the program ``gunzip'' in
20   place of ``uncompress''.  The gunzip program is publicly available
21   from the GNU project.
22
23   The tar command creates a directory named ftnchek-3.1.1 containing
24   the files of the distribution.  You should change directory to this
25   directory and follow the instructions below.
26
27   Next, configure a Makefile for your system with the command:
28
29      $ ./configure
30
31   This uses the file Makefile.in as a template.  If you want to change
32   some options, edit the file Makefile.in, not Makefile, and re-run
33   configure.
34
35   Next, build ftnchek with the command:
36
37      $ make
38
39   To verify correct operation of the newly created ftnchek, you can
40   now issue the command
41
42      $ make check
43
44   This will run ftnchek on the suite of test programs in the
45   subdirectory ``test'' and report on any discrepancies.
46
47   Note: if you have built and installed the ftnpp preprocessor
48   (provided separately), it will be tested for correct interaction
49   with ftnchek.  Otherwise this test will be skipped.  Similarly, if
50   your system has gawk or nawk installed, the dcl2inc script will
51   also be checked for correct operation.  Failure of either of these
52   tests usually does not indicate any problem with ftnchek itself.
53
54   Once ftnchek is working properly, issue the command (usually
55   requiring super-user authority):
56
57      $ make install
58
59   This will install the executable in /usr/local/bin and the manpage in
60   /usr/local/man by default.  (The dcl2inc program will also be
61   installed.)
62
63   There is also a small file, project.magic, which can be added to
64   your system's magic file, so that the ``file'' program will
65   recognize ftnchek project files for what they are.
66
67   If emacs is installed on your system, the lisp file ftnchek.el will
68   also be installed in the system site-lisp directory.
69
70   The HTML documentation is not installed by ``make install''.  See
71   the section on Associated Files below for details on installing
72   this component manually.
73
74   If you see a warning about "catman": on IRIX the manpage gets
75   specialized treatment, since man pages are pre-formatted and packed,
76   and nroff is not bundled with the OS.  If nroff is available, then it
77   is used to create the formatted man pages, and all is well.
78   Otherwise, the user should obtain the ftnchek "catman" file,
79   distributed separately.  (It is available from ftp.dsm.fordham.edu in
80   the pub/ftnchek directory).  Unpack this in the source directory and
81   proceed with "make install".  If the "catman" files are not found, a
82   notice will be issued, and the flat ascii ("doc") versions will be
83   used.
84
85   The UNIX Makefile employs a private script, man2ps, for converting
86   manual pages to PostScript (linked to names me2ps, mm2ps, and
87   ms2ps, it will support the -me, -mm, and -ms formats as well).  The
88   script currently knows about GNU groff, Sun Solaris 2.x troff +
89   dpost and psroff; it will use any of these, with groff preferred.
90   For troff + dpost, if you get errors like this
91
92troff: Can't open /usr/lib/font/devpost/C.out; line 818, file <standard input>
93
94   you can repair them if you have appropriate privileges:
95
96      % cd /usr/lib/font/devpost
97      % ln CO C
98      % ln CO.name C.name
99      % ln CO.out C.out
100
101   These commands simply create links between a Courier font that Sun
102   named CO, and the one named C that is expected by ftnchek.man.  If
103   some troff expert knows a better way to handle this, please tell
104   us.  Additional alternatives in the man2ps script to support
105   ditroff and other vendors' troff-to-PostScript solutions will also
106   be welcome.
107
108
109(2) VMS
110
111   Unpacking ftnchek: If the file you received is a VMS_SHAR.COM file,
112   unpack it in an empty directory by executing it as a DCL command
113   file.  For instance, if the file is named FTNCHEK_VMS_SHAR.COM and
114   located in the current directory, you would give the VMS command
115
116       @FTNCHEK_VMS_SHAR.COM
117
118   It is highly recommendend that VMS users also obtain the file
119   SHELL_MUNG.C.  This file is not necessary to build ftnchek, but
120   without it wildcards in file names on the command line will not be
121   expanded.  This file is no longer bundled with ftnchek, but is
122   obtainable at the ftnchek home site and elsewhere.  You should copy
123   SHELL_MUNG.C to the same directory as the ftnchek source before
124   proceeding to build ftnchek.
125
126   Rename the file "CONFIG-GENERIC.H" to "CONFIG.H".  Next, follow the
127   build instructions for Alpha or VAX.
128
129(2a) VMS on Alpha
130
131   Give the command
132
133        $ @BUILD
134
135   After the program has been compiled, you must turn it into a
136   so-called "DCL foreign command" so that it can be invoked by
137   giving its name on a command line, instead of using the RUN
138   command.  Do this with the command
139
140        $ FTNCHEK :== $disk:[directory]FTNCHEK
141
142   where you substitute the disk and directory names where the file
143   FTNCHEK.EXE resides.  This command must be executed once per
144   login.  It is suggested you put this command into your LOGIN.COM
145   file.
146
147   The BUILD procedure also creates a VMS help library named
148   FTNCHEK.HLB.  To access it from the VMS HELP command, you must
149   give the command
150
151        $ DEFINE HLP$LIBRARY disk:[directory]FTNCHEK.HLB"
152
153   Again, this command must be executed once per login to have effect.
154
155   Note that BUILD.COM uses the files CC.COM and LINK.COM
156   which are conditional compilation and link scripts that allow
157   re-making ftnchek by compiling only what has changed.
158
159   To verify correct operation of the newly created ftnchek, you can
160   now issue the command
161
162	$ @CHECK
163
164   This will run ftnchek on the suite of test programs in the
165   subdirectory [.TEST] and report on any discrepancies.  Note: thanks
166   to Bob Wells for yeoman service in providing CHECK.COM.
167
168(2b) VMS on DEC VAX
169
170   Same as (2a) except use BUILD-VAX.COM instead.  It has been found
171   that some compilers require the /VAXC qualifier in order to compile
172   this code properly.  If this is the case with your compiler, edit
173   CC.COM, changing cc to cc/vaxc at line 44.
174
175
176
177(3a) MS-DOS/Win with Borland BCC32
178
179   Edit CLIB in makefile.bcc32 (line 13) to reflect the location where
180   the BCC32 library is installed on your machine.  Rename the file
181   "makefile.bcc32" to "makefile".  Rename the file "config-win32.h"
182   to "config.h".  Then give the command:
183
184        C> MAKE
185
186   See Remark at (3c).
187
188(3b) MS-DOS/Win with Microsoft Visual C/C++
189
190   Open the workspace file ftnchek.dsw.  Rename the file
191   "config-win32.h" to "config.h".  Build ftnchek.exe.
192
193   See Remark at (3c).
194
195(3c) Other MS-DOS/Win
196
197   See the instructions at (6) below.  You should define the macro
198   MSDOS manually, if your compiler does not automatically define one
199   of the macros _WIN32, _MSDOS or __TURBOC__.  (If it does define one
200   of these, then MSDOS is defined automatically.)  The macro MSDOS is
201   needed in order to configure ftnchek's behavior to suit the
202   DOS/Windows environment.
203
204   Remark: You can verify correct operation of the MS-DOS/Win version of
205   ftnchek as follows.  Change directory to the TEST folder and
206   execute the CHECK.BAT batch file, i.e. give the commmand CHECK.
207   (This check is not as thorough as the one for Unix, due to some
208   limitations of the MS-DOS environment.
209
210   Note: Thanks to Gunnar Duus for providing  makefile.bcc32 and the
211   MSVC project files, as well as CHECK.BAT and its companion scripts.
212
213
214(4) Macintosh Programmer's Workshop (MPW)
215
216   Rename the file "makefile.mpw" to "makefile".  Edit the file,
217   changing character '+' to CHAR(182), option-d on the Macintosh
218   keyboard; and the character '/' to CHAR(196), option-f.  Rename the
219   file "config-generic.h" to "config.h".  Then use the "make" command
220   to create Ftnchek.
221
222
223(5) OS/2 with gcc
224
225   If you have installed the GNU utility "sed", you can customize the
226   makefile for your system.  Give the command:
227
228         configure_os2
229
230   This will create makefile.os2 with appropriate values for your
231   system.  You should rename it "makefile".  Rename the file
232   "config-generic.h" to "config.h".  Then run make to build ftnchek.
233   Configure_os2 also builds an OS/2 version of the dcl2inc script
234   that is configured for your system.  Many thanks to Jan Ftacnik,
235   Stefan A. Deutscher and Christian Bartels for producing and
236   improving this configuration script.
237
238
239(6a) Other systems having "make" utility
240
241   Rename the file "makefile.generic" to "makefile", edit it
242   appropriately for your system.  Rename the file "config-generic.h"
243   to "config.h", and edit it for your system.  Then run make.
244
245(6b) Other systems not having "make" utility
246
247   First rename the file "config-generic.h" to "config.h", and edit it
248   for your system.  Then it should suffice simply to compile all the
249   ".c" files and link them.  The main differences among the versions
250   for different operating systems have to do with:
251
252         -- the use of "/" vs. "-" as a command-line option prefix.
253            Define the macro name OPTION_PREFIX_SLASH if "/" is to be
254            accepted as an alternate to "-".  (No particular value
255            need be assigned to this macro, just define it.)  The "-"
256            prefix is always accepted.  NOTE: do not define this macro
257            if your system uses the "/" character as a separator in
258            path names.  Doing so will introduce ambiguities in the
259            command-line arguments.
260         -- the default filename extension ".for" vs. ".f".  Define
261            the macro name DEF_SRC_EXTENSION to the string value
262            corresponding to Fortran source files on your system.
263         -- the default home directory in which to search for
264            .ftnchekrc or ftnchek.ini.  Define SPECIAL_HOMEDIR to the
265            string value appropriate for your system.
266         -- the default systemwide directory in which to search for
267            include-files.  Define the macro DEFAULT_INCLUDE_DIR to
268            the string value of this directory.
269   These macros are all defined automatically to appropriate values
270   for Unix, VMS, and MSDOS systems.  You only need to define them by
271   hand if compiling ftnchek on other systems.
272
273   There are also some definitions in the file config.h that control
274   the use of certain system header files and library functions.  For
275   Unix systems, this file is automatically created by the configure
276   script.  If you are unable to use the configure script, the generic
277   version of config.h provided in the distribution will work for most
278   systems, but you may need to edit config.h manually to reflect the
279   situation on your own system.
280
281
282Once ftnchek is working, you can test it by giving the command:
283
284        $ ftnchek -list -sym average
285
286Then compare the output against the file ``average.out''.  A more
287thorough checkout is possible on Unix systems by giving the ``make
288check'' command described above.
289
290
291			   Associated files
292
293There are several auxiliary files included in the distribution.  Most
294of them are automatically installed by ``make install'' on a Unix
295system.  On non-Unix systems, you may not be able to use them.  If you
296can use them, you will need to install them in an appropriate place
297manually.
298
299dcl2inc is a script to convert the .dcl files produced by ftnchek with
300    the -makedcls option, into files suitable for inclusion in your
301    source code.  This script requires a modern version of awk.  The
302    dcl2inc script itself is a Bourne shell script that simply invokes
303    awk with suitable arguments.  On Unix systems, the dcl2inc script
304    is generated from dcl2inc.in by the configure script, which
305    substitutes apropriate values for the library where dcl2inc.awk is
306    installed and for the local version of awk (e.g. gawk or nawk).
307    If you wish to use this script on a non-Unix system, you can make
308    the substitutions by hand, since they are few and obvious
309    (assuming you have a suitable awk available).
310
311ftnchek.el is an Emacs lisp package that provides an ftnchek mode.
312    Using ``make install'' installs this in the system site-lisp
313    directory if there is one.  Read the comments at the head of the
314    file for details.  Each user should add a line like:
315      (add-hook 'fortran-mode-hook (require 'ftnchek-mode "ftnchek"))
316    to his or her personal .emacs file.  The author has said that this
317    package is still undergoing improvements, so the version included
318    in this distribution may well be out of date by now.  The most
319    recent version of ftnchek.el can be found at the URL given in that
320    file.
321
322ftnchek.1 and dcl2inc.1 are Unix man pages.  They are automatically
323    installed in the man directory by ``make install.''  They are not
324    much use on non-Unix systems.
325
326ftnchek.hlp is a VMS help document.  It is automatically converted to
327    a help library by BUILD.COM.  That script gives instructions for
328    making the help library available to VMS HELP.  You may wish to
329    install this in a suitable system-wide help directory.
330
331html is a directory containing a hypertext version of the
332    documentation.  This is NOT installed automatically by ``make
333    install.''  If you wish to make this documentation available on
334    your local system, install these files someplace where a browser
335    can access them.  A typical way to do this would be to create a
336    directory named "ftnchek" in a suitable place in the web server
337    directory, then copy all the files from the html directory to that
338    directory.  The file index.html is the top-level HTML file.
339
340    Note that the HTML documents contain some URLs pointing to other
341    man pages.  If your system has HTML man pages, or a cgi program
342    that converts man pages to HTML on the fly, you may want to edit
343    these links so they will work correctly.  As distributed, the html
344    files contain URLs of the form:
345       "http://localhost/cgi-bin/man/man2html?n+prog"
346    for a reference to program prog in manual section n.
347
348				Notes
349
350The suffix .prj for project files is also used by the program revision
351control system prcs (see http://scam.xcf.berkeley.edu/~jmacd/prcs.html) so
352that conflicts might occur.  Use the macro DEF_PROJ_EXTENSION to change the
353default suffix.  For Unix systems, you can specify the alternative
354extension on the make command line.  For example, to change the extension
355to .foo you would say:
356    make OPTIONS='-DDEF_PROJ_EXTENSION=\".foo\"'
357Alternatively, edit the Makefile to set the OPTIONS variable as above,
358or edit the file ftnchek.h to change the definition of DEF_PROJ_EXTENSION
359to the desired string.
360