Pro Fortran 7.5 for PowerPC/Linux Technical FAQs
19-Apr-02

IMSL Documentation                                                         22-Sep-97
Supporting -r8 flag in Fortran 77                                          24-Sep-97
F90 cannot find functions in modules                                       02-Oct-97
Using the ABSOFT_RT_FLAGS environment variable                             04-Sep-98
Fortran string lengths                                                     14-Jan-99
Adjustable array is not a dummy argument                                   17-Dec-99
Is there an F90 compiler option for big or little endian?                  22-Sep-00
Segmentation violation on Linux                                            06-Dec-00
Fx on Linux can't see C Source files                                       06-Dec-00
F90 error message problems                                                 08-Dec-00
setting xfx source paths                                                   08-Dec-00
Problems linking functions compiled with g77                               08-Dec-00
Static linking on Linux                                                    08-Dec-00
Core dump with HUGE executables                                            08-Dec-00
Linking to g77 and gcc                                                     08-Dec-00
VMS and Unix libraries on Linux                                            08-Dec-00
IMSL linking problem                                                       08-Dec-00
Using AltiVec with Linux PPC                                               13-Dec-00
I can't get the VMS (or Unix) libraries to link                            30-Oct-01
Using more than 2GB of addressable memory                                  19-Apr-02

Platform: All

Problem Details:
OS Version: All
Product Version: All
Date: 22-Sep-97

Q. Where can I find IMSL documentation.

A. The documentation for the IMSL libraries (7 volume set) may be
   purchased separately, or you can find it on line at:
   http://www.vni.com/products/imsl/alphabetized_functions.html
    

index

Platform: All

Problem Details:
OS Version: All
Product Version: All
Date: 24-Sep-97

Q. Does FORTRAN 77 support the -r8 flag?

A. Use the -N113 compiler option.
   The -N2 option forces all intrinsic functions to be performed
   in DOUBLE PRECISION.
    

index

Platform: All

Problem Details:
OS Version: All
Product Version: All
Date: 02-Oct-97

Q. I have a file which "uses" a precompiled by module containing a
   function used by the main file. When I try to compile the main it
   says there is an unresolved reference.

A. Your module contains executable code. Precompiling it created both
   a module file and an object file. Present the object file to the linker
   and the reference will be resolved. If you're compiling from the
   command line, simply add the object file on the compiler invocation
   line.
    

index

Platform: all
OS version: any

Product Version: Pro Fortran 6.0 and later
Q. How can I modify the default behavior of the Absoft runtime library?
A. Starting with Absoft Pro Fortran 6.0 and Absoft Fortran SDK 4.5, the
     runtime library checks for an environment variable named ABSOFT_RT_FLAGS
     on entry to the first I/O statement in a program. 
     The following switches can be specified using this variable:
      -defaultcarriage:

           Causes the units preconnected to standard output to interperet
           carriage control characters as if they had been connected with
           ACTION='PRINT'.
      -fileprompt: 
           Causes the library to prompt the user for a filename when it
           implicitly opens a file as the result of I/O to an unconnected
           unit number. By default, the library creates a filename based on
           the unit number.
       -vaxnames: 
           Causes the library to use 'vax style' names (FORnnn.DAT) when
           creating a filename as the result of I/O to an unconnected
           unit number.
        -unixnames: 
           Causes the library to use 'unix style' names (fort.nnn) when
           creating a filename as the result of I/O to an unconnected
           unit number.
         -bigendian: 
           Causes the library to interpret all unformatted files using
           big endian byte ordering.
         -littleendian:            
           Causes the library  to interpret all unformatted files using
           little endian byte ordering.
         -noleadzero: 
           Causes the library to surpress the printing of leading zeroes
           when processing an Fw.d edit descriptor. This only affects the
           limited number of cases where the ANSI standard makes printing
           of a leading zero implementation defined. 
         -reclen32: 
           Causes the library to interpret the value specified for RECL=
           in an OPEN statement as 32-bit words instead of bytes.
          -f90nlexts:
           Allows f90 namelist reads to accept non-standard syntax for
           array elements. Without this flag, the following input results
           in a runtime error:
           $ONE
           A(1)=1,2,3,4
           $END

           When -f90nlexts is set, the values are assigned to the first
           four elements of A.
           To set ABSOFT_RT_FLAGS:
           On Windows:
           Open a command prompt window and enter:
           set ABSOFT_RT_FLAGS=-fileprompt
           On Mac OS 9:
           Open the MPW worksheet and enter:
           set -e ABSOFT_RT_FLAGS -fileprompt
           On Mac OS X(using tcsh):
           Open the terminal and enter:
           setenv ABSOFT_RT_FLAGS -fileprompt
           On Linux(using bash):
           export ABSOFT_RT_FLAGS=-fileprompt
           MRWE applications must be launched from the
           command line so that the ABSOFT_RT_FLAGS
           will be used.

           Note: the leading minus sign is required for each switch and multiple
           switches must be separated by one or more spaces.

index

Platform: All

Problem Details:
OS Version: All
Product Version: All
Date: 14-Jan-99

Q. Does Absoft Fortran pass the lengths of strings like most Unix
   Fortran compilers I've used?

A. Yes, string lengths are passed as extra arguments (by value) at
   the end of the formal argument list:
C:\Absoft60>type main.c
#include <string.h>
void Fcode(char *, int, double *, int);
int main()
    {
    char string[13] = {"hello, world"};
    int i = 1;
    double d = 2.0;
    Fcode(string, i, &d, strlen(string));
        return 0;
    }
C:\Absoft60>acc -c -A main.c
Absoft C/C++ Compiler 1.3, Copyright (c) 1994-1997, Absoft Corp.
C:\Absoft60>type fcode.f
        subroutine Fcode(string, i, d)
        character*(*) string
        integer i
        value i
        double precision d
        print *, string, i, d, len(string)
        end
C:\Absoft60>f77 -o main.exe main.obj fcode.f
FORTRAN 77 Compiler 4.5, Copyright (c) 1987 - 1998, Absoft Corp.
C:\Absoft60>main
 hello, world  1  2.00000000000000  12
C:\Absoft60>
    

index

Platform: All

Problem Details:
OS Version: All
Product Version: All
Date: 17-Dec-99

Q. I get the error message:
	"adjustable array is not a dummy argument"

A. The most common cause of this is:

          subroutine some_name(a,b,n)
          real A(N), B(N)

   The Absoft FORTRAN 77 compiler is case sensitive by default.
   The easiest way to solve this type of problem is use a
   case folding option: -f or -N109.
    

index

Platform: All

Problem Details:
OS Version: All
Product Version: All
Date: 22-Sep-00

Q. Is there an F90 compiler option that will force the compiler to
   consider the byte ordering of all unformatted files to either big
   or little endian?
A. Use the F90 open statement specifier:
   convert ={"big_endian"|"little_endian"}
   For example:

   Open(10,file="filename",form="unformatted",convert="big_endian")

   Or, use the ABSOFT_RT_FLAGS as described in the technical FAQ on
   Using the ABSOFT_RT_FLAGS environment variable which can
   be found here:

   linux75tfaq.html#anchor0058
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: All
Date: 06-Dec-00

Q. When I declare large arrays (>8 MB of variables), I get a
   segmentation violation from Linux.

A. Use the "-s" compiler option (static storage) to move
   the data from the stack to the heap or use the ulimit
   command (ulimit is a bash command - the csh equivalent to
   'ulimit -s' is 'limit stack') to raise the stack size limit
   # ulimit -s
   8192
   # ulimit -s 32768
   # ulimit -s
   32768


   Once raised the limit applies to the current
   process and any children of that process.

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: All
Date: 06-Dec-00

Q. I am trying to debug a mixed language program on Linux. Even though
   my C files are compiled with -g, Fx can't see them.

A. You need to compile the C files with -gdwarf instead of -g.
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: All
Date: 08-Dec-00

Q. When I try to compile a program with the Fortran 90
   compiler I get the following error message:

   cft90 INTERNAL: Cannot retrieve message 3 from the message system.

   What does this message mean?

A. The error message file is:

   /opt/absoft/nls/cf90

   This path is hard-wired into the compiler. However, if an
   environment variabled named NLSPATH is defined, the compiler
   will use it to attempt to locate the message file. Either
   unset this variable when you are using the Fortran 90 compiler,
   or add the path specified above to the variable:

   NLSPATH=/opt/absoft/lib/nls/cf90/
   export NLSPATH
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: 7.0
Date: 08-Dec-00

Q. Is there an execution argument for "xfx" that sets the path
   in which it should search for sources?

A. You can use an environment variable or a command line
   argument:

   export FXSRCPATHS={colon separated list of directories}

   or:

   xfx -p {colon separated list of directories}
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: 7.0
Date: 08-Dec-00

Q. I am trying to link to some functions compiled with
   g77.  When I compile my program I get linker errors
   and undefined reference to any of the necessary functions.

A. Include the g77 runtime library libf2c.a or libg2c.a in
   your compile Line to make it an argument to the linker
   like this:

   f77 test.f g77sub.o -lf2c
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: All
Date: 08-Dec-00

Q. If I want executable files to run on other linux systems
   which do not have the Absoft compiler installed, do I need to
   link the libraries statically or does that happen automatically?

A. In order to statically link the libraries you must pass
   an argument to the linker on the command line like this:

   -X -static
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: All
Date: 08-Dec-00

Q. I have a program with some very large arrays; 500 MB
   and more. I have plenty of memory in my computer, but
   the program still core dumps immediately.

A. First, be certain that you are using the '-s' (static
   storage) compiler option (f77 or f90). The default Linux
   stack size of 8 MB will not be sufficient.

   This is a problem with the Linux dynamic loader. You should
   be able to solve the problem by linking against static
   versions of the system libraries to avoid dynamic linking.
   Add this option to your compiler command line:

   -X -static
    

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: All
Date: 08-Dec-00

Q. I am trying to use a compiled g77 object with Absoft
   f77 or f90 and I receive these errors:

    test.o(.text+0x9): undefined reference to `s_wsle'
    test.o(.text+0x22): undefined reference to `do_lio'
    test.o(.text+0x2a): undefined reference to `e_wsle'

A. You must link against the g77 runtime library f2c or g2c
   depending on your Linux distribution.

Q. Ok, I added -lg2c and I still get an unresolved reference
   to the g77 subroutine that I am trying to call in F77?

A. G77 folds all external names to lower case and appends
   a trailing underscore. You must add the -B108 and -f compiler
   options. Your compile line should look like this:

   f77 t.f test.o -lg2c -B108 -f

   For F90 you must also add -YEXT_NAMES="LCS"
   which folds all external symbolic names to lower case
   and -B108 that appends a trailing underscore.
   Your compile line should look like this:

   f90 t.f test.o -lg2c -B108 -YEXT_NAMES="LCS"

Q. I am trying to use F77 with gcc.  My C code compiles fine.  When
   I try to use the compiled gcc object code with F77, I receive unresolved
   references for every call to the C math library that is in my C code?

A. Add libm.a to your compile line like this:
       f77 t.f test.o -lm

Q. Is there an equivalent of -fno-second-underscore in your compiler?
   I need to be able to link g77/gcc produced code that is compiled with this option.

A. Do not use the -B108 f77/f90 compiler option. This is a back-end (code generator)
   option and has specific knowledge of the Linux environment; hence the double
   underscores. Instead, use a front-end option which is machine independent:
   f77: -N15
   f90: -YEXT_SFX='_'
     

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: 7.0
Date: 08-Dec-00

Q. I can't get the VMS (or Unix) libraries to link.

A. The libraries contain three entry points for each function. One
   in all upper case, one in all upper case with a trailing underscore,
   and one in all lower case with a trailing underscore:

   DATE
   DATE_
   date_

   Be sure that your spelling matches one of these.

   The libraries are maintained in /usr/absoft/lib:

   /usr/absoft/lib/libV77.a   VMS compatibility library
   /usr/absoft/lib/libU77.a   Unix compatibility library

   For example:

   test.f:

          character*40 argument
          n = IARGC()
            do i=1,n
              call GETARG(i,argument)
              print *,trim(argument)
           end do
         end

   $ f77 -lU77 test.f
     

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: 7.0
Date: 08-Dec-00

Q. I'm having problems using the IMSL functions. The linker reports
   unresolved references for any function I try to use.

A. You must include the IMSL and BLAS libraries:

   libimsl.a and libimslblas.a

   as an argument to the linker like this:

   f77 t.f -f -N15 -limsl -limslblas
   f90 a.f -limsl -limslblas -YEXT_NAMES="LCS" -YEXT_SFX="_"

   It is necessary to add the options -f(fold to lower case)
   and the -N15(appends a trailing underscore) for F77 and
   the corresponding F90 options, -YEXT_NAMES="LCS" -YEXT_SFX="_"
   because the IMSL and BLAS libraries were compiled with these options.
     

index

Platform: Linux PPC

Problem Details:
OS Version: All
Product Version: 7.0
Date: 13-Dec-00

Q.  I am trying to compile a program using the "-altiVec" switch
    on a PPCLinux box and we get the error message: "exec of gcc-vec
    failed, compilation aborted" or  " cannot resolve savev_22 " etc errors..."
    Is there some additional compiler package we need to install to utilize
    the AltiVec optimizations, and if so do you know where we can find it?

A. You need to download gcc with AltiVec extensions from

     http://www.altivec.org

    The packages on their site run on a PowerPC Linux system with
    glibc-2.1 or later. (Yellow Dog Linux, Black Lab Linux, and
    LinuxPPC 2000)
   Once the Altivec gcc is installed, you need to do one of the following:

   For the Fortran 90 compiler:

   $ f90 -YEXT_NAMES=LCS -YEXT_SFX=_ -altiVec <source files> -lblas_altivec

   For the Fortran 77 compiler:

   $ export CC=/usr/bin/gcc-vec
   $ f77 -f -N15 <source files> -lblas_altivec
      

index

Platform: PPC/Linux
Problem Details:
OS Version: Linux
Product Version: Pro Fortran V7.0
Date: 30-Oct-2001
Q. I can't get the VMS (or Unix) libraries to link.
A. The libraries contain three entry points for each function.
   One in all upper case, one in all upper case with a trailing underscore,
   and one in all lower case with a trailing underscore:
   DATE
   DATE_
   date_
   Be sure that your spelling matches one of these.
   The libraries are maintained in /opt/absoft/lib:
   /opt/absoft/lib/libV77.a VMS compatibility library
   /opt/absoft/lib/libU77.a Unix compatibility library
   For example:
   test.f:
   character*40 argument
   n = IARGC()
    do i=1,n
     call GETARG(i,argument)
     print *,trim(argument)
    end do
   end
   $ f77 -1U77 test.f


   The VMS and Unix libraries are documented in:
   /opt/absoft/doc/supportLibrary.pdf

index


Platform: All

Problem Details:
OS Version: Any
Product Version: 7.5
Date: 19-Apr-02

Q. Using more than 2GB of addressable memory

A. The following table shows the maximum process size (code+data)
on each operating system:
                     OS | Max process size
   ---------------------+--------------------
   x86 Linux kernel 2.4 | 3GB
   x86 Linux kernel 2.2 | 2GB
              PPC Linux | 2GB
                Windows | 2GB
                Mac OSX | 2GB, 64MB max stack
   In addition to those limits, f90 has a limit of a maximum of 512MB
   for any single array or common block. This limit is scheduled to be
   removed from f90 in the next release after version 7.5.
   F77 has a limit of 2GB for any single array, and 2,000,000,000 bytes
   for any single common block.
   To have the maximum amount of memory available for data on Linux,
   it is necessary to link your application statically. This is done
   by using the "-X -static" option for either f77 or f90.
   On x86 Linux there is also a limit in the GNU assembler that
   you can't have more than 2GB of static data (either save
   statements, or the -s switch) in a single file. If you try,
   you will get the following error: Error: attempt to .org backwards ignored
   To work around this, you can put some data into a common block.

index