Platform: Windows
Problem Details:
OS Version: 95/98 and NT/2000
Product Version: any
Date: 19-Aug-97
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: 95/98 and NT/2000
Product Version: any
Date: 26-Aug-97
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: 95/98 and NT/2000
Product Version: any
Date: 08-Sep-97
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: 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: Windows
Problem Details:
OS Version: 95/98 and NT/2000
Product Version: any
Date: 22-Sep-97
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: 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: Windows
Problem Details:
OS Version: any
Product Version: any
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: Windows
Problem Details:
OS Version: 95/98 and NT/2000
Product Version: any
Date: 08-Oct-97
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: 95/98 and NT/2000
Product Version: Any
Date: 16-Oct-97
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: 95/98 and NT/2000
Product Version: any
Date: 22-Oct-97
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: 95/98 and NT/2000
Product Version: any
Date: 31-Oct-97
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. Is 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: 95/98 and NT/2000
Product Version: any
Date: 11-Dec-97
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: 95/98 and NT/2000
Product Version: any
Date: 15-Dec-97
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 WindowsNT use:
call SYSTEM("command /c dir")
index
|
Platform: Windows
Problem Details:
OS Version: 95/98 and NT/2000
Product Version: any
Date: 03-Mar-98
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: 95/98 and NT/2000
Product Version: any
Date: 29-May-98
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
Date: 04-Sep-98
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.
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: 95/98 and NT/2000
Product Version: any
Date: 15-Sep-98
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: 14-Jan-1999
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>
index
|
Platform: Windows
Problem Details:
OS Version: 95/98 and NT/2000
Product Version: Pro Fortran 6.0 and later
Date: 03-Feb-1999
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: 95/98 and NT/2000
Product Version: any
Date: 25-Feb-1999
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: 17-Jun-2002
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-Jun-99
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: 17-Nov-1999
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: 17-Dec-1999
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:Windows
Product Version: Pro Fortran 7.0
Date: 21-Mar-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 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.
index
|
Platform: Windows
Problem Details:
OS Version: any
Product Version: Pro Fortran v7.0
Date: 31-Aug-00
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.
How do I use this new option?
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
Why is this option necessary?
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.
What changes when the -N102 option is used?
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.
What still doesn't work with the -N102 option?
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: 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:
win70tfaq.html#anchor0058
index
|
Platform: Windows
Problem Details:
OS Version: Any
Product Version: Pro Fortran 7.0
Date: 06-Oct-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 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.
index
|
Platform: All
Problem Details:
OS Version: Any
Product Version: Pro Fortran 7.0
Date: 06-Oct-00
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: Any
Product Version: Pro Fortran 7.0
Date: 02-Jan-01
Q. Is it possible to use routines created with Absoft Pro Fortran
with the Microsoft Developer Studio environment?
A. It's definitely do-able and it's pretty easy. You can even perform
mixed language debugging from within Developer Studio and the
Microsoft debugger will step through the FORTRAN code and
display most of the variables.
1. Compile your FORTRAN code to object files.
2. Put them in a library if you wish. During development it may
simplify management to leave them as individual object files to
avoid rebuilding the library every time you make a change.
3. Select the 'Project' menu in Developer Studio. Choose the
'Add to Project' command and select 'Files...'.
4. Set 'Files of Type' as appropriate.
That's it.
As far as wrappers are concerned, there's no need, unless you'll be
doing something out of the ordinary with character case. All Absoft
languages can be case sensitive, all lower, or all upper. It's your
choice. All Absoft languages conform to the Microsoft Win32 API, so
they can be called directly.
There are two considerations:
1. If the routines will be called from C++ code, you'll need to
prototype them as C externs:
extern "C" {functions, ... };
2. You'll need to be careful which API you specify. Microsoft has two:
CDECL normal C declaration; caller pop
STDCALL anything but standard; callee pop
Absoft defaults to CDECL, but declarations are available to
specify STDCALL.
index
|
Platform: All
Problem Details:
OS Version: Any
Product Version: Pro Fortran 7.0
Date: 02-Jan-01
Q. Is it possible to use Absoft Pro Fortran with Matlab V6R12?
A. It is possible to use Absoft Pro Fortran with Matlab V6R12 by
using a batch file that configures the Matlab environment
and creates a DLL that links in the Absoft compilers.
Everything that you need is here:
ftp://ftp.absoft.com/pub/windows/profortran7.0/MatlabV6R12.zip
index
|