HP Fortran Programmer's Guide (September 2007)
Compiling and linking
Special-purpose compilations
Chapter 2 87
• A PA-RISC version number—1.1, 2.0, or 2.0W. Use +DA2.0W to compile in 64-bit mode;
see “Compiling in 64-bit mode” on page 93.
• A model number—for example, 750 or 870.
• A PA-RISC processor name—for example, PA7100 or PA8000.
• portable—code that is compatible across all models. Use +DAportable only if you want
to ensure that your program will run on different models.
Use the uname -m command to learn the model of your machine, as follows:
$ uname -m
9000/879
Alternatively, you can use the grep command to look up the model number in the file
/opt/langtools/lib/sched.models and find its architecture type, as follows:
$ grep 879 /opt/langtools/lib/sched.models
879 2.0 PA8000
You can also use the +DS
model
option to specify an architecture-specific instruction scheduler,
where
model
has the same meaning as it does for the +DA option. Like the +DA option, the +DS
option is unnecessary if the program will run on the same machine as you use to compile it.
Also, if you compile with +DA
model
, the compiler will select the scheduling algorithm based on
the same architecture—unless you use the +DS option to specify a different architecture.
NOTE Code generated for PA1.1 systems will execute on PA2.0 systems, but the
reverse is not true: the loader will not allow PA2.0 code to run on a PA1.1
system.
Creating shared libraries
As mentioned in “Linking to shared libraries” on page 80, many of the HP-UX as well as
HP Fortran libraries are available in shared as well as archive versions. Linking with shared
libraries can make the executable program smaller and can ensure that it always has the
most current version of the library.
You can make shared versions of your own libraries, using the +pic command-line option and
the -b linker option. The following sections describe how to use these options and show an
example of how to create a shared library.