HP Fortran Programmer Guide HP-UX 11i v1, HP-UX 11i v2, and HP-UX 11i v3 (B3908-90032,December 2012)

Contents
1 An overview of HP Fortran...........................................................................7
The HP Fortran compiler environment...........................................................................................7
Driver......................................................................................................................................8
C preprocessor.........................................................................................................................9
Front-end...............................................................................................................................10
Back-end...............................................................................................................................12
Linker....................................................................................................................................14
Tools.....................................................................................................................................15
HP-UX operating system...........................................................................................................16
2 Compiling and linking..............................................................................17
Compiling with the f90 command.............................................................................................17
f90 command syntax..........................................................................................................17
Command-line options............................................................................................................18
Commonly-used options......................................................................................................19
Command-line options by category......................................................................................19
Option descriptions............................................................................................................20
Symbol binding options...........................................................................................................35
Using optimization options.......................................................................................................36
Reviewing general optimization options.....................................................................................37
Fine-tuning optimization options...............................................................................................39
Filenames..............................................................................................................................48
Linking HP Fortran programs....................................................................................................48
Linking with f90 vs. ld.........................................................................................................48
Linking to libraries..............................................................................................................49
Linking to nondefault libraries.........................................................................................50
Linking HP Fortran 90 routines........................................................................................51
Additional HP Fortran libraries........................................................................................51
Linking to shared libraries...............................................................................................52
Library search rules.......................................................................................................52
Special-purpose compilations...................................................................................................53
Compiling programs with modules.......................................................................................53
Examples.....................................................................................................................54
Compiling with make.....................................................................................................55
Managing .mod files.....................................................................................................56
Compiling for different PA-RISC machines..............................................................................56
Creating shared libraries....................................................................................................57
Compiling with +pic......................................................................................................57
Linking with -b..............................................................................................................58
Examples.....................................................................................................................58
Using the C preprocessor........................................................................................................58
Processing cpp directives....................................................................................................59
Saving the cpp output file...................................................................................................60
Creating demand-loadable executables.....................................................................................60
Creating shared executables....................................................................................................60
Compiling in 64-bit mode........................................................................................................61
Using environment variables.....................................................................................................61
F90ROOT environment variable...........................................................................................62
ST_F90COM[64] environment variable.................................................................................62
HP_F90OPTS environment variable......................................................................................62
LPATH environment variable.................................................................................................63
MP_NUMBER_OF_THREADS environment variable.................................................................63
Contents 3