|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 27-Jul-07
Q. Windows Memory Allocation Limits
A.
The windows limit of addressable space per application is 2 GB. However,
a change to boot.ini can raise the limit to 3GB. Information regarding
this can be found here http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx
More information regarding Windows Memory Allocation is referenced here:
http://www.rivix.com/tech_tip16.htm
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 27-Jul-07
Q. Stack
Overflow
A. The default
setting for the Pro Fortran V10.0 is 1 Megabyte stack size. The flag
-stack:0x2000000 allocates roughly 32 megabytes on the stack. To increase
the stack size, you can use the same option you've used before -stack:0x40000000.
This will double the stack size you were previously using. These are
hexadecimal numbers, to convert a hexadecimal number, just input it
into the Windows calculator as hexadecimal and then click decimal, and
it will automatically convert it for you. This is useful in finding
how many megabytes you're reserving for the stack. This option is documented
on page 34 of the User Guide found in your documentation folder.
index
|
|
Platform:
All
Problem Details:
OS Version: any
Product Version: any
Date: 27-Jul-07
Q.
I am trying to use some subroutines such as DATE, TIME, GETARG, IARGC,
etc, but I get linker error messages indicating that they cannot be
found. Is there some library I should be using?
A. You need to use the VMS and Unix compatibility functions. If
you are using Linux or OS X, the easiest solution is to add the compatibility
libraries to your compile command line. For example:f90
myprog.f -lU77 -lV77 From
the Developer Tools Interface for Macintosh OS X 10.4, check the "Use
UNIX Library" and "Use VAX/VMS Library" boxes (page 100
of the Pro Fortran Mac OS X User Guide).
If you are
using Windows Development Command shell, the libraries to add are "unix.lib"
and vms.lib" (pages 101 - 102 of the Windows Fortran & C/C++
User Guide).
If you're using the "Developer Tools Interface", check the
"Use VAX/VMS library" box on the Target tab, then click on
the UNIX Lib drop-down menu and select UNIX library (LCS).
On Macintosh and Windows, we now also provide a module for accessing
these functions. Simply add a USE statement to your Fortran 95 programs.
Example:C:\Absoft90>type
t.f95
use vax_library
character*20 thedate
call date(thedate)
print *,thedate
end
C:\Absoft90>f95 t.f95C:\Absoft90>t
26-Oct-05
C:\Absoft90>On
Unix/Linux:
use unix_library
use unixlib_types
character*24 tim
tim = ctime(5)
write(*,*) tim
end
rmd@dingo
rmd $ f90 -L/Applications/Absoft/examples/UnixAndVaxLibs/ -lU77 q.f90
rmd@dingo rmd $ ./a.out
Wed Dec 31 19:00:05 1969
For a list of available routines, please refer to the Absoft Support
Library located in C:\Absoft90\DOCUMENTATION.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. Libraries and object files compiled with previous versions
of Pro Fortran do not link with my newly
compiled code.
I receive errors such as: #
link error: undefined symbol - ___cdiv
# first ref in - ..\ABSOFT82\LIB\SF90MP.LIB(c_fast_2dft.obj)
# link error: undefined symbol - ___casgn
# first ref in - ..\ABSOFT82\LIB\SF90MP.LIB(s_error_post.obj)
# link error: undefined symbol - ___char
# first ref in - ..\ABSOFT82\LIB\SF90MP.LIB(s_error_post.obj)
# link error: undefined symbol - ___con
A.
To avoid problems involving accidentally linking with C libraries,
Absoft has renamed all symbols in our I/O and math libraries so that
they contain an "_absoft_" preceding the name. For compatibility
reasons, we have provided an object file (C:\Absoft82\Lib\f77_oldnames.obj)
which will
resolve these references.
To use the file from the Absoft Compiler Interface, simply add the object
file to your project just like any other file. From a command
shell, add it to the link command. This
file is provided for compatibility reasons only.
If possible, it is highly recommended that you rebuild all object files
and libraries with Pro Fortran 8.2.
index
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. When I try to link Visual C++ 4.2 object files which contain
debugging information using the Absoft Linker, I get the following
error:
"symbol records not in natural alignment"
What should I do to correct this?
A. When linking object files created by Visual C++ 4.2, you need
to
specify the /CVPACK switch to the Absoft linker.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. I get errors when using the Windows header files with your
C compiler.
A. Use the -windefs compiler option.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. How do I pass an array from VB to a DLL?
A. Refer to your Microsoft VisualBasic Programmer's Guide page
652. VB
passes entire arrays using OLE Automation argument protocols. Absoft
F77/F90/C/C++ expect CDECL arguments. The VB manual section explains
how to pass the
address of the first argument of the array. Basically:
Declare ... lParam as Any
Dim array(100)
Call DLL(array(0))
index
|
|
Platform:
All
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
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:
WindowsProblem
Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. I have been trying to compile a Windows program using Absoft
Fortran 77.
I forced a map to be generated and it became clear that the subroutines
and functions are being renamed-"ABOUTPROC" becomes "_ABOUTPROC@16"
for
example. And the module that calls the routine is not using the modified
name. What is the correct way to compile and link such programs?
A. This is STDCALL mangling. The leading underscore is normal
for Windows
API compliant procedures. The trailing @nn is the size of the stack
that
needs to be popped by the callee (4 times the argument list count).
STDCALL
uses a callee stack pop protocol and the name mangling helps the linker
pick
the proper procedure.
When the ABOUTPROC function is included in the main source file, the
compiler can match the argument lists. When it's separate, the compiler
does not
know how many arguments the ABOUTPROC function will take. It mangles
the
name as:_ABOUTPROC
You need to create an alias file to map the name:_ABOUTPROC_ABOUTPROC@16
index
|
|
Platform:
Windows
Problem Details:
OS Version: Any
Product Version: Fortran77
Date: 01-Sep-02
Q. Does FORTRAN 77 support the -r8 flag?
A. Use the -N113 compiler option.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
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:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. What is "point" in MoveToEx? I found the RECORD
statement, but
no corresponding STRUCTURE statement in main.f
A. It looks like this:
STRUCTURE /POINT/
INTEGER*4 x
INTEGER*4 y
END STRUCTURE
The source is: ...\Absoft\FInclude\Windef.inc
The include files for FORTRAN 77 and the module files for Fortran 90
are translations of the Microsoft C header files (also included with
Pro Fortran). The easiest way to look these up is to select "Find"
from the "Start" menu and then choose the "Find Files
or Folders..."
command:
1. Under the "Name and Location" tab, leave "Named"
blank, but set
"Look in:" to "...\Absoft\FInclude".
2. Under the "Advanced" tab, fill in what you're looking for
in the
"Containing Text" edit box. For example: "STRUCTURE /POINT/"
index
|
|
Platform:
Windows
Problem Details:
OS Version: Any
Product Version: Any
Date: 01-Sep-02
Q. How do I pass a Visual Basic string to a DLL?
A. Visual Basic strings are maintained in a data structured
referred to as a BSTR which is not compatible with other
languages in a DLL. However, you can pass a null terminated,
C programming language string in Visual Basic. The
declaration and usage would take the following form:
Private Declare Sub getString Lib "Test" Alias "_getString@4"
_
(ByVal text As String)
Private Sub Command1_Click()
Dim text As String
text = "hello, world"
Call getString(text)
End Sub
The key is to pass the string by value (ByVal).
At the FORTRAN end:
stdcall subroutine getString(p_theString)
implicit none
! FORTRAN expects the string lengths to be passed
! after the formal argument list as values. Since
! Visual Basic does not do this and because this is
! a STDCALL procedure, we need to accept the argument
! as a general pointer to a string passed by value.
integer p_theString; value p_theString
! local variables
character*1024 string ! longer than expected
pointer (p_string, string)
character*1024 temp, title
integer length, p_temp, p_title, i
! definitions for using the Win32 API MessageBox function
include "windef.inc"
include "winuser.inc"
! the Visual Basic string is passed as a null terminated
! C string. The first thing we have to do is find the
! null to determine the length of the string.
p_string = p_theString
length = index(string, char(0))
if ((length .lt. 2) .or. (length .gt. 1024)) return
! copy the string to a local (and safe) variable.
! initialize the message box title string
temp = string(1:length-1)
title = "FORTRAN DLL"
! null terminate the strings for the call to "Message Box"
temp = trim(temp)//char(0)
title = trim(title)//char(0)
! create pointers to the strings so they can be
! passed by value to the Win32 API function "MessageBox"
p_temp = loc(temp)
p_title = loc(title)
i = MessageBox(val(0),val(p_temp),val(p_title),val(MB_OK))
end
Use the following commands to build the DLL (assuming the
FORTRAN source file is "test.f"):
f77 -c test.f
lnk -lib test.obj -exports:test.xps
lnk -dll test.obj -exports:test.xps absRT0.lib kernel32.lib user32.lib
\
fiodll.lib fmathdll.lib -aliases:unicode.als
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. Apparently the compiler considers the variable NORMX as integer
even
though I explicitly typed it as: real normx
Please fix the compilers and send me the patch.
A. There is no need to provide a patch for the compiler.
The FORTRAN 77 compiler is case sensitive. You can use either
of the two following options to disable case sensitivity:
-f fold to lower case
-N109 fold to upper case
Caution: The use of either option will make it impossible to communicate
directly with the Windows API.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. I receive linker errors when compiling C programs which reference
certain POSIX functions such as open(), close(), read(), write(), etc.
Am I missing a library?
A. Unlike most other operating systems, a POSIX library is not
supplied
with Windows. It is only included with the Microsoft C/C++ compilers.
Absoft supplies an ANSI C library, but POSIX functions are not defined
as part of that library. We recommend for portability reasons that you
use the ANSI C streams functions such as fopen(), fclose(), fread(),
fwrite(), etc.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. Could I put in a plea for an MRWE sample program (or is there
one
already - I couldn't find it)?
A. In the "ABSOFT\EXAMPLES\MRWE" folder, you'll find
two
makefiles:
1. makefile. This one constructs the mrwe.lib library. Simply
enter "amake" from the MS-DOS Prompt command line in this
directory to (re)build the library. Don't forget to copy
the output to "ABSOFT\LIB"
2. makefile.dev. This one constructs the debugging version of
mrwe and includes a demo of some of mrwe's features in its
main program: "main.f". Enter "amake -f makefile.dev"
to
build this version. This version is an application: main.exe
and can be executed out of this directory. This is to simplify
the development process. After changes are made, the
release version should then be built as outlined in 1., above.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. Is it possible to execute DOS commands like DIR or CLS
with the Unix library SYSTEM function?
A. You need to use "command.com" to execute the MS-DOS
Prompt
built-in commands. For example: call SYSTEM("command.com /c dir")
For Windows NT,2000 and XP use: call SYSTEM("cmd/c dir")
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. How can I control the processor FPU?
A. You can use arm387 to control the FPU. This is an
integer function built into the runtime library. Here
are the definitions of the control arguments:
fenv.inc:
! Intel specific FPU control constants for use with fpcontrol
integer*4 FE_TONEAREST
parameter ( FE_TONEAREST = (z'00000000'))
integer*4 FE_TOWARDZERO
parameter ( FE_TOWARDZERO = (z'00000C00'))
integer*4 FE_UPWARD
parameter ( FE_UPWARD = (z'00000800'))
integer*4 FE_DOWNWARD
parameter ( FE_DOWNWARD = (z'00000400'))
integer*4 FE_INEXACT
parameter ( FE_INEXACT = (z'00000020'))
integer*4 FE_DIVBYZERO
parameter ( FE_DIVBYZERO = (z'00000004'))
integer*4 FE_UNDERFLOW
parameter ( FE_UNDERFLOW = (z'00000010'))
integer*4 FE_OVERFLOW
parameter ( FE_OVERFLOW = (z'00000008'))
integer*4 FE_INVALID
parameter ( FE_INVALID = (z'00000001'))
Then use arm387 as follows:
test.f:
implicit none
include "fenv.inc"
integer arm387
integer state
* first retrieve the current state of the FPU
state = arm387(0)
* enable divide-by-zero exceptions (for example)
state = arm387(state .and. .not. FE_DIVBYZERO)
end
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. I am very much interested in using OpenGL for applications.
Do
you have any simple examples of using them ProFortran?
A. OpenGL was produced by Silicon Graphics. The libraries are
included
by Microsoft on Windows NT systems. We supply them on the CDROM so
that Windows 95 users will have them available. You can get more
information from: http://www.sgi.com/software/opengl/faq.html
index
|
|
Platform:
all
Problem Details:
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. -connectunit9 Causes UNIT 9 to be preconnected to
standard input and output.
-maceol Formatted sequential files are in Classic Macintosh format where
each
record ends with a carriage return,
-doseol Formatted sequential files are in Windows format where each
record ends
with a carriage return followed by a line feed.
-unixeol Formatted sequential files are in Unix format where each record
ends with a line feed. -hex_uppercase Data written with the Z edit descriptor
will use upper case characters for A-F. 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:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q. Whenever I try to debug my program, Fx displays a dialog box
that reads "Unable to load object file" followed by the name
of my program. How do I get Fx to debug my program?
A. This error is most likely displayed because the program you
are
trying to debug does not contain any symbolic debugging information.
Make sure that you are compiling your source code with the -g option
and linking it with the -debug:full and -debugtype:both options. If
you are using one of the compiler drivers (f77.exe/f90.exe/ACC.exe)
to
do both compilation and linking, you only need to specify the -g option,
as in:
f77 -g program.f
But if you are using a separate link step, you will need to supply the
additional options to the linker, as in:
lnk -o program.exe -debug:full -debugtype:both program.obj
index
|
|
Platform:
All
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
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:\Absoft70>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:\Absoft70>acc -c -A main.c
Absoft C/C++ Compiler 1.3, Copyright (c) 1994-1997, Absoft Corp.
C:\Absoft70>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:\Absoft70>f77 -o main.exe main.obj fcode.f
FORTRAN 77 Compiler 5.0, Copyright (c) 1987 - 1998, Absoft Corp.
C:\Absoft70>main
hello, world 1 2.00000000000000 12
C:\Absoft70>
You can use the -YVF_CHAR f95 option to change the
argument passing convention from:
call foo (string1, string2, ..., len1, len2, ...)
to:
call foo (string1,len1, string2, len2, ...)
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: Pro Fortran 6.0 and later
Date: 01-Sep-02
Q. Is there a way to read an ASCII tab character, CHAR(9),
from a file?
A. Tabs read from formatted files are expanded modulo TABSIZE
where TABSIZE is an environment variable. If TABSIZE is not
set, tabs are expanded modulo 8. If TABSIZE is set to 0, the
tab is passed unmolested to the application.
index
|
|
Platform:
Windows
Problem Details:
OS Version: any
Product Version: any
Date: 01-Sep-02
Q: Is there an interface between Absoft Fortran and Microsoft's
ODBC?
A: Canaima Software, a third party, provides f90SQL,
which offers
a convenient and familiar way to directly read and write data
from Fortran programs to many applications formats. Product
details and a light version compatible with Absoft Pro Fortran
v7.0 for Windows is available for free download from
Canaima at: http://www.canaimasoft.com
index
Platform:
Windows
Problem Details:
OS Version: all
Product Version: any
Date: 01-Sep-02
Q: When I print a large(>33000)lines of data to
standard output using MRWE it crashes.
A: The maximum number of lines and characters is
defined in "c:\absoft\examples\mrwe\mrwe.inc".
integer MAX_LINES; parameter (MAX_LINES = 32768)
integer MAX_CHARS; parameter (MAX_CHARS = 262144)
To increase these maximums, follow this procedure:
1.Edit the file "c:\absoft\examples\mrwe\mrwe.inc"
MAX_LINES and MAX_CHARS are defined on lines 84-85.
Increase them as required. In version 7.0 or later change
the parameter b_index in line 32 in child.inc to increase the maxume
number of lines. Child.inc is in the \examples\mrwe directory.
Save your changes.
2.From the "Absoft Pro Fortran" menu, open the
"Development Command Shell". Change your directory
to the MRWE source directory:
cd c:\absoft\examples\mrwe
3.Delete all of the object files in this directory:
del*.obj
4.Enter the command to rebuild the library:
amake
5.Move the newly built library "mrwe.lib" to:
c:\absoft\lib
index
|
|
Platform:
Windows
Problem Details:
OS Version: all
Product Version: all
Date: 01-Sep-02
Q. How do I use the Microsoft Win32 API?
A. Using the Microsoft Win32 API is beyond the scope
of Absoft technical support.
For more information on win32 API see
the Win32 SDK help in the Absoft menu on
Absoft Pro Fortran 7.0.
index
|
|
Platform:
Windows
Problem Details:
OS Version: Any
Product Version: Any
Date: 01-Sep-02
Q. I am trying to write a large array as one record and when
using
the -N3 compiler option I get this run time error:
? FORTRAN Runtime Error:
? Buffer allocation failed
? WRITE(UNIT=3,...
A. The -N3 option instructs the compiler to read/write unformatted
sequential access files with record length information embedded
in the record. This places a 32-bit integer at the beginning and
the end of each record which allows the runtime library to skip and
backspace these records. Without the length information that would
be impossible.
However, your write statements try to write this entire array as one
record. With the -N3 option we have to allocate enough memory in one
contiguous chunk to create this record so that the length information
can be inserted at the beginning and the end. The allocation of this
buffer is what failed.
When the -N3 option is not specified, I/O transfers are performed using
much smaller (4096 byte) buffers since the data is pure binary with
no
record length information.
If you receive this error on the Macintosh, then increase the memory
application size.
index
|
|
Platform:
All
Problem Details:
OS Version: Any
Product Version: Any
Date: 01-Sep-02
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 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:
Windows
Problem Details:
OS Version: any
Product Version: Pro Fortran v8.0
Date: 01-Sep-02
Q. I am trying to use the Microsoft Visual Studio and the
Microsoft debugger does not recognize arrays and certain
other variables. I compiled all of my Fortran source files
with the -g compiler option to include symbolic debugging information?
A.Use the -N102 compiler option which causes the compilers to
generate
debug information that can be interpreted by Visual C++ 5.0/6.0.
Q. How do I use this new option?
A. When compiling your Fortran 77 and Fortran 90 source code,
simply add
the -N102 option along with the -g option. For example:
f77 -c -g -N102 myfile.f
f90 -c -g -N102 myfile.f90
Q. Why is this option necessary?
A. The Microsoft Visual tool kits have no knowledge of Fortran.
This means
that they cannot interpret the debug information that Absoft compilers
generate for certain Fortran language constructs, such as arrays. Note
that there is nothing incorrect about the debug information the Absoft
compilers are generating for these constructs. It is fully conformant
with the Microsoft Codeview debugging format.
Q. What changes when the -N102 option is used?
A. When the compilers see the -N102 option, they generate debug
information
that attempts to describe Fortran language constructs as if they were
C language constructs. For example, arrays are represented as having
a
constant lower bound of 0.
Q. What still doesn't work with the -N102 option?
A. Any Fortran construct that cannot be mapped to C. For example,
adjustable
size arrays, character*(*) strings, and Fortran 90 host associated
local variables.
index
|
|
Platform:
All
Problem Details:
OS Version: Any
Product Version: Any
Date: 01-Sep-02
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: win70tfaq.html#anchor0058
index
|
|
Platform:
All
Problem Details:
OS Version: Any
Product Version: Pro Fortran 8.0
Date: 01-Sep-02
Q. My application compiles and runs fine with small arrays, but
when I increase the array sizes, I get an application error
when I run it. Is there a limit on program or array size?
A. Local variables are allocated on the stack. The default stack
allocation in 1 MB. When the total stack requirements exceed
that, a memory fault will occur. It is not easy to predict
a program's stack requirements, since it depends on the
execution path at any point in time. There are several
solutions:
1. You can increase the stack size with the -stack option
described on page 81 of the Absoft Pro Fortran for Windows
User Guide. This option is entered in the Developer Tools
Interface by clicking on the "Lnk Options..." button.
2. If it is a Fortran program, you can use the "-s" compiler
option (static storage) to move the data from the stack
to the heap.
3. If it is a Fortran program, you can place the arrays in
a COMMON block which allocates them in the heap.
index
|
Platform:
All
Problem Details:
OS Version: Windows
Product Version: Pro Fortran 8.0
Date: 01-Sep-02
Q. When I execute a Console application from the Atools
interface I receive this message:
"Out of environment space"
"Out of environment space"
A. You are receiving the Out of environment space message
because by default the MS-DOS Console window's Initial
Environment is set to Auto. To increase the initial environment
click on the MSDS icon in the upper left corner of the
console window. Select Properties, Memory set the initial
environment to 4096 and click OK.
index
Platform:
All
Problem Details:
OS Version: Windows
Product Version: Any
Date: 01-Sep-02
Q. I am having problems linking the NETCDF libraries.
A. All of the DVF compiled routines will have upper case
names.
For Absoft f77, you will need to use the -N109 (Fold to Upper Case)
option. You will need to declare all of the NEDCDF routines with
the STDCALL declaration. When using Absoft f90, use STDCALL NCAPT
When using Absoft f77, use STDCALL EXTERNAL NCAPT
NOTE: To allow calls to the Windows API, the STDCALL declaration
is case sensitive in Absoft f90. When declaring NETCDF routines,
you must use upper case. DVF handles CHARACTER arguments in a unique
way. The lengths of CHARACTER arguments must be passed to the called
subroutine or function so that CHARACTER*(*) declarations (assumed
length) work.
Absoft follows the UNIX convention of passing CHARACTER lengths
after the end of the formal argument list. DVF passes the length
immediately following the argument. In order to link Absoft compiled
code with NETCDF libraries compiled with DVF, you must both
defeat the Absoft convention as well as simulate the DVF convention.
Consider this subroutine call: call test(a, "hello", i,
n) To call a DVF compiled version of 'test', you would modify the
call as follows: call test(a, VAL(LOC("hello")), VAL(5),
i, n)
VAL(LOC(...)) takes the address of the argument and passes it
by value. In FORTRAN, this simply passes the argument by address,
the default. But, for CHARACTER arguments, it defeats the Absoft
convention of appending the length of the CHARACTER argument to
argument list. The VAL(5) argument is the length of the preceeding
CHARACTER
argument passed in the location where DVF expects to find it.
index
Platform:
All
Problem Details:
OS Version: Any
Product Version: 8.0
Date: 01-Sep-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
F77 has a limit of 2GB for any single array, and 2,000,000,000
bytesfor 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
Platform:
Windows
Problem Details:
OS Version: Any
Product Version: Pro Fortran 8.0
Date: 15-Oct-02
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 IMSLBLAS libraries: Imsl.lib
and imslblas.lib
as an argument to the linker like this from the command line:
f77 imsl.f imsl.lib imslblas.lib -f -N15
f90 imsl.f imsl.lib imslblas.lib -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 IMSLBLAS libraries were compiled with these
options.
From the compiler interface under options, Plug-ins, put a check
in the IMSL Library box.
The complete IMSL documentation including Fortran examples is available
by going to Start, Programs, IMSL Documentation.
index
Platform:
Windows
Problem Details:
OS Version:Windows
Product Version: Pro Fortran 8.0
Date: 15-Oct-02
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 C;\Absoft\lib:
vms.lib VMS compatibility library
unix.lib 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
Also, some of the functions use system API calls.
For these you must also include the alias file "Unicode.als".
This can be done by typing:
f77 test.f -aliases:unicode.als unix.lib
at the command prompt or if you choose to use the
compiler interface, go into "Set Options". Once the
dialog box comes up, click on the "Link" tab and type
"Unicode.als" where it says "Aliases File:"
and click OK.
The VMS and Unix library routines are documented in the
Support Library guide which is available on the Absoft Pro
Fortran, Documentation menu. The complete source code
for the Unix compatibility routines is in:
\Absoft\EXAMPLES\F77\UNIX
and the VMS routines are in:
\Absoft\EXAMPLES\F77\VMS
index
Platform:
Windows
Problem Details:
OS Version: Windows
Product Version: Pro Fortran 8.0
Date: 31-Mar-03
Q. My PLplot application compiles and links fine, but at
execution I see:
*** PLPLOT ERROR ***
Unable to open font file Program aborted
or once I enter the output device number the program exits.
A. The "font files" in question are the six files
ending with either ".fnt"
or ".map" in the directory "C:\Absoft80\EXAMPLES\PLPlot\examples".
If the files are not in the same directory as the executable, these
environment variable "PLPLOT_LIB" is used at runtime to
search for the
files. If you set it to a directory containing these files then
any
applications you run from that command shell session will find them.
Type: "set PLPLOT_LIB=C:\Absoft80\examples\PLPLOT\examples"
Then launch your program from the command shell in any directory
and it will run.
If you wish to set this variable system wide (so you can double
click on
applications using PLPlot), right click on "My Computer"
and select
properties. Locate the "Environment Variables" section
of the
properties window (on the "Advanced" tab on Windows 2000)
and add a new
variable for either your user name or system wide. The variable
name
must be "PLPLOT_LIB" and the value must be a directory
containing the font files.
Windows 98 users add the environment variable to the c:\autoexec.bat
file by adding:
set PLPLOT_LIB=C:\Absoft80\examples\PLPLOT\examples
In order to enable PLplot applications to run properly when they
are double clicked from the Finder, you must link in this
object file. This sets the necessary environment variable automatically
at runtime.
To use it, simply add the file PLplot_font_init.obj to your Compiler
Interface project and do a rebuild
all, or include it on the compiler invocation line if you are compiling
from the Command Shell.
Note, for these solutions to work, the font files must exist in
the directory
"C:\Absoft80\examples\PLPLOT\examples" on the system you
are running the application on.
index
index
Platform:
ALLProblem
Details:
OS Version: all
Product Version: all
Date: 04-March-04
Q. Is it possible to assign a variable the value INF or
NAN? Is
there a built in function to test if a variable is a NAN or
INF?
A. Please see this file for
routines to test real and double values against NaN and INF.
Make sure to see the comments in naninfchk.f and compile
for your system (Big Endian or Little Endian) or your
results will be incorrect.
A test program has also been provided.
index
|