trend

- 4

Trapped Radiation ENvironment model Development

Frequently Asked Questions

[ Question | Answer | Illustration | See Also ]

Question

    T.01 - How to link the UNILIB library ?

Answer

    The UNILIB library is available in the form of a Fortran object library (unilib.lib or libunilib.a). To produce an executable code, the UNILIB library should be linked to any Fortran program (examples are included in the UNILIB Table of Contents). Note that, on several platforms, the UNILIB library can be linked to programs written in another computer language. In the following we will assume that the user's programme is called myprog.for (or myprog.f). For additional information and detailed descriptions of the linker, the user has to refer to a documentation specific of the platform and operating system.

    Under the OpenVMS operating system, the library can also be linked to the IDL software.

MS-DOS / MS-Windows

    The object library (v2.01) has been built with the DIGITAL Visual Fortran Compiler version 5.0C on a PC/Pentium running Microsoft Windows NT 4.00. Since the format of the LIB files does not seem to be a standard under the MS-DOS/MS-Windows operating system, we recommand to use the same compiler. Assuming that the files unilib.lib and structure.h are in the current directory, the user executable code can be produced by the command:
    > DF MYPROG.F UNILIB.LIB 

OpenVMS (FORTRAN)

    The object libraries for VAX and AXP platforms are different. The object libraries have been built with the Digital Fortran 77 compiler: the VAX library (v2.01) on a VAX Station 4000 running VAX/VMS V6.1, and the AXP library (v2.01) on a Alpha Station 600 running OpenVMS v7.1. Assuming that the files unilib.olb and structure.h are in the current directory, the user executable code can be produced by the command:
    $ FOR MYPROG.FOR
    $ LINK MYPROG.OBJ, UNILIB.OLB/LIB /EXE=MYPROG.EXE
    

OpenVMS (IDL)

    Before starting IDL, the user has to define a logical which includes the path to the shareable image. For further information see VMS-Specific Abilities / Calling a VAX FORTRAN Subroutine in Chapter 18 of the IDL user's guide.
    $ DEFINE unilib MY_DISK:[MY_DIRECTORY]UNILIB.EXE
    $ IDL
    
    See also the FAQ T.05.

HP-UX

    The object library (v2.01) has been built with the HP-UX FORTRAN 77 compiler on a HP 9000/879 running HP-UX release 10.20. Assuming that the files libunilib.a and structure.h are in the current directory, the user executable code can be produced by the command:
    > f77 +ppu myprog.f -Wl,-L. -lunilib -o myprog.out
    

OSF

    The object library (v2.01) has been built with the Digital FORTRAN 77 compiler on a Alpha Workstation 3000 running Digital UNIX V3.2C. Assuming that the files libunilib.a and structure.h are in the current directory, the user executable code can be produced by the command:
    > f77 myprog.f -L. -lunilib -o myprog.out
    

SunOS

    The object library (v2.01) has been built with the Sun FORTRAN 77 compiler version 4.0 on a SPARC Station running SunOS 5.4. Assuming that the files libunilib.a and structure.h are in the current directory, the user executable code can be produced by the command:
    > f77 myprog.f -L. -lunilib -o myprog.out
    

Linux (PC)

    The object library (v2.01) has been built with the PGI Fortran compiler on a PC/Pentium running Linux 2.2.0. Assuming that the files libunilib.a and structure.h are in the current directory, the user executable code can be produced by the command:
    > pgf77 myprog.f -L. -lunilib -o myprog.out
    

Illustration

    None

See also

    G.02 Where to find the UNILIB library and documentation ?