Operating System - HP-UX
1825060 Members
5209 Online
109679 Solutions
New Discussion юеВ

System calls from Fortran

 
SOLVED
Go to solution
Cody Godines_1
Occasional Advisor

System calls from Fortran

Hi,

I'm on a HPUX 10.20 and deal with Fortran programs that make system calls to functions like getarg or getenv. When these calls are made within the program, an underscore needs to be added to them, as in...
CALL getarg_(*)
In the man pages, this is not mentioned. This would not really be a problem, except that the original programs come from a machine (not hp) that does not need this underscore. So, all of the original programs need to be changed. Thanks to any words of wisdom.

-Cody
2 REPLIES 2
Gregory Fruth
Esteemed Contributor
Solution

Re: System calls from Fortran

Most FORTRAN environments I've seen DO
require the underscore. HP-UX F77/F90
and Lahey LF95 (on the PC) are the only
ones I've seen that don't.

On HP-UX, the F77 and F90 compilers
behave differently wrt the underscore.
Furthermore, the F90 compiler behaves
differently depending on whether you're
in a 32-bit or a 64-bit environment.
Check the F77 or F90 man page for
the "+ppu" or "+noppu" option. If
you're using gcc, check out the
-fno-underscoring option.

This topic is covered in some detail in the online
documentation:

http://www.docs.hp.com/hpux/dev/index.html#Fortran
Gregory Fruth
Esteemed Contributor

Re: System calls from Fortran

Most FORTRAN environments I've seen DO
require the underscore. HP-UX F77/F90
and Lahey LF95 (on the PC) are the only
ones I've seen that don't.

On HP-UX, the F77 and F90 compilers
behave differently wrt the underscore.
Furthermore, the F90 compiler behaves
differently depending on whether you're
in a 32-bit or a 64-bit environment.
Check the F77 or F90 man page for
the "+ppu" or "+noppu" option. If
you're using gcc, check out the
-fno-underscoring option.

This topic is covered in some detail in
the online documentation:

http://www.docs.hp.com/hpux/dev/index.html#Fortran