This section describes the math libraries that are included with the Oracle Developer Studio compilers.
The default base installation directory for Oracle Developer Studio 12.6 is /opt/developerstudio12.6 on Oracle Solaris and /opt/oracle/developerstudio12.6 on Linux. However, you can specify a different base installation directory install-dir during installation.
Oracle Developer Studio static 32-bit libraries are installed by default in the directory install-dir/lib/compilers and its subdirectories. Static 64-bit libraries are installed in install-dir/lib/compilers/sparcv9 on SPARC and install-dir/lib/compilers/amd64 on x86.
This Numerical Computation Guide also describes the shared libm and libmvec libraries, which are available for Oracle Solaris only and are installed in /usr/lib for 32-bit versions and /usr/lib/64 for 64-bit versions.
The math.h and sunmath.h library header files are installed in /usr/include for Oracle Solaris. The math.h library header file is installed in install-dir/lib/compilers/include/cc for Linux.
The subdirectories of your Oracle Developer Studio install-dir for static archives, shared objects, and include files are subject to change from release to release.
The libsunmath math library contains functions that are not specified by any standard but are useful in numerical software. It also contains many of the functions that are in libm.so.2 but not in libm.so.1. libsunmath is provided as both a shared object and a static archive.
Table 16 lists the functions in libsunmath that are not in libm.so.2. For each mathematical function, the table gives only the name of the double precision version of the function as it would be called from a C program.
|
The libmopt libraries provide alternate versions of some of the functions in libm and libsunmath. Generally, the libmopt versions use different algorithms, and the code is optimized for each of the several different instruction sets corresponding to different hardware platforms. As a result, the functions in libmopt are typically faster than the corresponding functions in libm and libsunmath. Unlike the libm functions, however, which support any of ANSI/POSIX, SVID, X/Open, or C99/IEEE-style treatment of exceptional cases, the libmopt functions only support C99/IEEE-style handling of these cases. (See Standards Compliance.) Also, the libmopt functions may deliver slightly different numerical results than their libm counterparts, and while all mathematical functions in libm deliver results with reasonable accuracy regardless of the floating-point rounding direction mode, the result of calling any function in libmopt with a rounding direction other than round-to-nearest is undefined. A program that uses libmopt must ensure that the default round-to-nearest mode is in effect whenever any standard math function is called.
On Oracle Solaris, the libmopt libraries are provided in two forms, a set of static archives and a shared object. Each static archive contains functions compiled to use a particular instruction set. When a program is linked with libmopt in static archive form, the compiler selects the instruction set variant based on the value of the –xarch option specified at link time, thereby conferring the best performance on hardware platforms to which that instruction set is best suited, but possibly giving suboptimal performance on other platforms. To link with libmopt in static archive form, use the -xlibmopt=archive option.
The shared object form of libmopt contains all of the instruction set variants of each function in a single object. This library uses the Oracle Solaris linker's symbol capability feature to select the most appropriate instruction set at run time based on the hardware platform on which the program is running. Thus, linking with libmopt in shared object form offers good performance on any platform albeit with a risk that the same program may compute slightly different results when run on different platforms due to differences in the instruction sets such as, using fused multiply-add on the systems that support it. To link with libmopt in shared object form, use the -xlibmopt=shared option.
On Linux, the libmopt libraries are only provided as static archives.