| United States-English |
|
|
|
![]() |
HP-UX Floating-Point Guide: HP 9000 Computers > Chapter 1 IntroductionOverview of HP-UX Math Libraries |
|
Basic operations such as addition and multiplication are specified by the IEEE standard. More complex mathematical operations such as logarithmic and trigonometric functions are provided by math library routines. The high-level operations of math library routines are specified not by the IEEE standard but by individual language standards (such as ISO/ANSI C) and by programming environment specifications (such as X/Open and SVID). C math library functions are located in the libm math library. The libm functions operate according to the C standard and the latest versions of the System V Interface Definition (currently SVID3) and of the X/Open Portability Guide (currently XPG4.2). The XPG4.2 specification is a superset of the POSIX.1 standard (IEEE Std 1003.1-1990). The SVID3 and XPG4.2 specifications are compatible. The libm library also supports some functions and macros approved by the ISO/ANSI C committee for inclusion in the C9X draft standard.
Fortran and Pascal intrinsic functions are located in the libcl library. In addition, Basic Linear Algebra Subroutine (BLAS) library routines are provided in the libblas library (provided with the HP Fortran 90 and HP FORTRAN/9000 products only). Table 1-1 “HP-UX Math Libraries” lists the math libraries available on HP-UX systems and shows the option you specify to the compiler or linker in order to link in each library. Table 1-1 HP-UX Math Libraries
The libm and libcl math libraries on HP-UX operating system at Release 10.30 and later are targeted primarily to the PA-RISC 1.1 architecture (PA1.1). They also run well on PA-RISC 2.0 (PA2.0) systems. The libraries will execute on all HP 9000 systems that run HP-UX Release 10.30 and later. The HP Fortran 90 and HP FORTRAN/9000 products supply two versions of the BLAS library, one specially tuned for PA1.1 systems and the other specially tuned for PA2.0 systems.
All HP 9000 systems except the oldest Series 800 systems are PA1.1-based or PA2.0-based. If you do not know your system's architecture type, see “Determining Your System's Architecture Type”. For complete information about the math libraries, see Chapter 4 “HP-UX Math Libraries on HP 9000 Systems”. There are two main ways to find the architecture type of your system. To do it from the command line:
You can also learn the system architecture type at run time at HP-UX Release 10.x. A simple program that gives you useful information follows. Example 1-1 Sample Program: get_arch.c
The uts.release is the release of HP-UX on the system where you run the program. The _SYSTEM_ID is the kind of code the compiler generated. The _CPU_REVISION is the architecture type. If you compile this program on a PA1.1 system, then run it on a PA2.0 system running HP-UX Release 10.30, you get results like the following:
The release, 10.30, is easy to decipher. To decode the other results, search the file /usr/include/sys/unistd.h:
The compiler generated PA1.1 code, which is running on a PA2.0 system. If you use a compilation command (f90, cc, and so on) to invoke the link editor (ld), the selection of math libraries is driven by the +DA compiler option, which allows you to generate PA1.1 code (+DA1.1) or PA2.0 code (+DA2.0). By default, the compiler generates code for the kind of system on which you are running the compiler. This ensures the best possible performance on that system. If your application must run on both PA1.1 and PA2.0 systems, compile with +DA1.1. Code compiled with +DA2.0 will run only on PA2.0 systems. When you select +DA1.1 or +DA2.0, the compilation command invokes ld with a library search path that begins with the PA1.1 library directories. Again, the search path may vary from compiler to compiler. For example, if you invoke the HP Fortran 90 compiler with +DA2.0, it contains the following:
At Release 10.30, the main HP-UX math libraries are in the directory /usr/lib. The BLAS library is in both /opt/fortran90/lib and /opt/fortran/lib. The obsolete vector library exists only in /opt/fortran/old/lib.
Table 1-2 “Math Library Path Names” shows the math library path names. Table 1-2 Math Library Path Names
Figure 1-1 “Math Library Directory Hierarchy at Release 10.30” illustrates the directory hierarchy for the math libraries. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||