•A
•
Use the uname
$ uname
Alternatively, you can use the grep command to look up the model number in the file /opt/ langtools/lib/sched.modelsand find its architecture type, as follows:
$ grep 879 /opt/langtools/lib/sched.models
879 | 2.0 | PA8000 |
You can also use the +DSmodeloption to specify an
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 librariesAs mentioned in “Linking to shared libraries” (page 53), many of the
You can make shared versions of your own libraries, using the
Compiling with +pic
The +picoption causes the compiler to generate Position- Independent Code (PIC) for use in a shared library. PIC contains no absolute addresses and can therefore be placed anywhere in a process’s address space without addresses having to be relocated. This characteristic of PIC makes it shareable by multiple processes.
The syntax of the +pic option is:
+pic={shortlongno}
Although compiling with either +pic=short or +pic=longwill generate PIC, in general you should use the +pic=shortoption. If the linker issues an error message saying that the number of referenced symbols in the shared library exceeds its limit, recompile with +pic=long, which will cause the compiler to allocate space for a longer symbol table.
The +pic=no is the default, which causes the compiler to generate absolute code, such as you would want for executable programs.
The following command line creates three object
$ f90
For more information about the +picoption, see the HP Fortran Programmer’s Reference.
59 |