

    This document discusses some of the more complex aspects of the
installation of this product including operations performed during
product installation as well as those that might be appropriate after
the installation is done.

Environment variables
=====================

    Environment variables can be somewhat of a problem on Windows NT
systems. There is no easy way to "reset" them and there are few standards
regarding their usage. Compiler products have an additional problem in
that compilers from different vendors often use the same names for
environment variables with the same purpose but may require slightly
different versions of the referenced files. There are a number of ways
that a compiler product can handle this problem.

    The first is that a compiler product installation can assume that it
is the only product on the system and simply "fix" the system to do the
right thing for that product. When the assumption is true this has the
nice attribute that a complete and correct setup is done for the user.
When the assumption is false, this "blind" setup can cause complete
confusion for the user and may not function correctly at all making this
a very dangerous alternative.

    A second possible choice that an installation procedure can
do is to use some method, either by asking the user or by "sniffing" the
system, to try to figure out what the installation environment looks
like. If this can be done properly this provides a much higher
probability for success than the previous method.  Unfortunately it can
be almost impossible to guess all the possible ways that people setup and
utilize systems. If a product has very few dependencies on other pieces
of the system this method of installation can work quite well. Consider
the case where a product only needs one environment variable to point to a
root directory. An installation script might check to see if a previous
version of that product is installed and that may be all the information
needed to do the setup correctly. (Of course if a previous product was
installed on a network drive which is not currently visible or installed
from another user account even this "simple" case may not be so simple!)
In the case, as in compiler products, where there are many
interdependencies amongst products, it is virtually impossible to handle
all the various combinations. Consider that on most development systems
at least two compilation systems are present. They may have common tools
(linkers, etc), common libraries, common header files, etc. They may even
be used together to build a single executable. Multiple versions of the
tools may be used to produce executables compatible with various versions
of the operating system.  While most application type products only need
to install the "latest version that will run on a given operating
system", compiler products may have to support running multiple versions
on a system to support compatible development. Consider the case of a C
compilation system that while running on Windows NT 3.51 will create
images that are compatible with Windows NT 3.1. The complexities of the
setup involved may be enormous.

    Thus a third choice for a product installation procedure is to only
make "safe" modifications to the system environment and to provide the
user with the appropriate information to allow him or her to properly
tailor the system as needed.

    This last method is the method used by the DIGITAL Visual Fortran
installation procedure based on the assumption that it is better to 
require the user to have a small understanding of the system setup than 
to take a chance of performing modifications to the system that might 
totally mess things up. As a result of this choice the installation 
procedure specifically does NOT modify the system-wide PATH variable, nor 
does it define the INCLUDE, LIB, CPU or TOOLS environment variables. These
variables are known to be used by other vendors products. Rather, the 
DIGITAL Visual Fortran product installation places on the system a command
file that defines these, and other environment variables in a way that has
a "good chance" of being correct.  In some cases the installation procedure
may actually modify the system if the user has confirmed that such a 
modification is desired and the installation procedure determines that
there is a "good chance" that the modification will be correct. The 
information below is provided so that a user of the DIGITAL Visual Fortran
product can check, modify or augment appropriately any system changes
required by the product installation.


    The installation procedure writes a command file called DFVARS.BAT
into the top of the directory tree that contains the Fortran compiler.
This directory tree is usually rooted at \DEC\DFOR. Note that this is one
level below the top of the directory tree used by the entire kit as the
toolset directory tree is also contained on the kit and usually installed
under \DEC\CDK. The DFVARS.BAT command file can be used as a sample to
show what environment variables are needed to use the Fortran compiler.

*** It is up to the user to insure that this environment variable setup,
*** or equivalent, is done before the compiler is used.

There are a number of ways to accomplish this.

1. The environment variables may be established on a system-wide basis.
   On Windows NT 3.51 or greater systems this can be done by starting the
   control panel application from an administrator account and then
   selecting the "System" applette. The appropriate entries are then
   placed in the "System Environment Variable" section. Another way that
   this can be done is to start the REGEDT32 application and then under
   LOCAL_MACHINE -> System -> CurrentControlSet -> Control -> Session
   Manager -> Environment add or modify pairs of environment variable 
   names and values.  Both of these methods provide system-wide 
   definitions and may require a system reboot to take effect.

2. Environment variables may be established for a given user.
   This can be done by starting the control panel application and then
   selecting the "System" applette. The appropriate entries are then
   placed in the "User Environment Variable" section. Another way that
   this can be done (and the only way on 3.1 systems) is to start the
   REGEDT32 application and then under CURRENT_USER -> Environment add
   or modify pairs of environment variable names and values.
   Both of these methods provide user-wide definitions and may require
   the user to re-logon to take effect.

3. Environment variables may be established for a given Icon.
   This is the method used by the installation procedure to establish the
   "F90" icon. The desired commands are placed in a .BAT or .CMD file
   (in this case DFVARS.BAT) and the desired icon is set up to contain
   the following command line "cmd /k full_path_of_command_file".
   When an icon defined in this way is selected the command file will
   execute and the modified command process window will remain for use.
   (/k means "keep".)

4. A command process environment may be modified manually prior to
   running the compiler. This is one of the methods that we use during
   development where we may be using and/or testing various compilers
   in conjunction with multiple compilation systems. For this method
   a command procedure can be developed that, given the appropriate
   parameter(s), will properly redefine the current command processor
   environment to select and setup the appropriate toolset.
   This command procedure is invoked interactively as appropriate.

   *** Note this last method does not effect processes already created
   *** and this may not have the desired effect for program manager
   *** icons.


Having selected the desired method to set up your environment the
information below may be used to help you define the environment
variables correctly.


The DEC Fortran product uses the following environment variables:


    PATH

        The PATH environment variable is used by the system to
        search for images to run. The PATH variable must include
        the directory of the DF.EXE image in order for the
        system to automatically find the compiler.

    DF_TOOLS
        and
    DECFORT90_TOOLS

        These environment variables are used to control support for
        the toolset. Valid values are "MSDN35", "MSVC40", and "MSVC".
        Specifically, these environment variables cause the DF driver
        to generate different switches to the various tools and
        to select different libraries. In the case of the C runtime
        library "CRTDLL" is used as appropriate for the MSDN toolset
        while "MSVCRT" is used as appropriate for the Microsoft (r)
        Visual C++ (tm) toolset.  The DF_TOOLS environment variable
        is evaluated first.

    CPU

        This environment variable is used by NTWIN32.MAK to select
        the proper switches, etc. for the compilation. It should be
        set to "i386" on Intel hardware and "ALPHA" on Alpha 
        hardware.

    DF

        The DF environment variable can be used to specify frequently
        used DF options and files. The characters contained in
        the DF environment variable are added to the beginning of the
        user specified DF command line. Thus options selected
        by using the DF environment variable may be overridden by
        negating them with the user specified command. See the user
        manual for more description of how to use the DF environment
        variable to specify frequently-used options.

    LIB

        This environment variable is used like a PATH spec by the
        linker to search for libraries that are named without path
        information. For Visual Fortran, this variable usually contains
        two components. The first specifies where to find the Fortran
        specific libraries. The second specifies where to find the
        C runtime library and system libraries. If you are using the
        Visual Fortran product with another product you probably want to
        retain the first part (Fortran library location) but you
        may have a different location for the system libraries.
        Note that the Fortran libraries supplied are specifically
        built to work with either the MSDN toolset or the Microsoft
        Visual C++ toolset and should NOT be intermixed. Reinstall
        the Fortran kit if your usage changes.


    INCLUDE

        This environment variable is used like a PATH spec by the
        compiler, preprocessor, resource compiler and nmake to find
        files that are "included" into the source. Make sure that
        the order of path definitions in this environment variable
        is correct to cause the desired behavior.

    INIT

        This environment variable is used like a PATH spec by
        various tools (MEP and WINDBG for example) to find the
        TOOLS.INI file. Entries can be placed in the TOOLS.INI
        file to tailor the operation of some of the development tools.
        See the appropriate tool online documentation for more
        information.

    HELPFILES

        The MEP editor uses the HELPFILES environment variable to
        locate its help files. The HELPFILES environment variable
        must point to the directory in which MEP.HLP is installed.

    TMP

        This environment variable is used by the system APIs
        GetTempPath(), GetTempDrive() and others. In general, this
        environment variable should point to a fast access (non-network)
        place where sometimes large temporary files can be written.
        The Fortran preprocessor, DF Driver, and other components
        may write files in this location during various operations.
        These files are automatically deleted at the conclusion of
        the performed operation unless some type of interruption
        (system crash, operator abort, etc) prevents the cleanup. For
        this reason, most users find it easier if the TMP environment
        variable points to a normally empty directory. If this is
        done then it is always safe to delete all files in that
        directory at appropriate times without worry. The Fortran
        compiler and related tools will never place anything in the
        TMP directory that can not be recreated.



System DLLs
===========

    Fortran programs may be built to either include the runtime support
or to use appropriate DLLs (Dynamically Linked Libraries). Each has its
own advantages and disadvantages.  Using the DLLs will create smaller
images but will execute slightly slower and incur the complexity of
making sure that the required / affiliated DLLs are shipped with the
program image. Including the runtime support in the main image causes
slightly faster execution but prevents runtime support bugfixes by DLL
replacement and produces larger on-disk image sizes.

    Part of the installation procedure copies the appropriate DLL images
to the system area (%SYSTEMROOT%\SYSTEM32) so that they are automatically
found (if required) when programs run. These images may be redistributed
with your program (see license agreement for details). Note that these
images are specifically built for the appropriate MSDN or Visual C++
environment so you should reinstall if your usage changes.



Product Registration
====================

    The installation procedure also writes an entry into the system
registry under the LOCAL MACHINE\Software key to record which products
have been installed. Even if an older entry is overwritten, this
operation is always safe and currently has no effect on the operation of
the product.
