24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

However, the libmassvp4.a library provides newer, consistent versions of certain<br />

functions. These consistent functions are: vsqrt, vssqrt, vlog, vrec, vdiv, vexp, vsin,<br />

vcos, vacos, vasin, vatan2, vrsqrt, vscos, vsdiv, vsrec, vssin.<br />

The accuracy of the vector functions is comparable to that of the corresponding<br />

scalar functions in libmass.a, though results may not be bit-wise identical.<br />

For more in<strong>for</strong>mation on consistency and avoiding inconsistency with the vector<br />

libraries, as well as per<strong>for</strong>mance and accuracy data, see the MASS Web site at URL<br />

http://www.ibm.com/software/awdtools/<strong>for</strong>tran/xl<strong>for</strong>tran/mass.<br />

Compiling and Linking a Program with MASS<br />

To compile an application that calls the routines in these libraries, specify mass<br />

and massv (or massvp3 or massvp4) on the -l linker option. For example, if the<br />

MASS libraries are installed in the default directory, you could specify:<br />

xlf progf.f -o progf -lmass -lmassv<br />

The MASS functions must run in the round-to-nearest rounding mode and with<br />

floating-point exception trapping disabled. (These are the default compilation<br />

settings.)<br />

Using libmass.a with the Standard Intrinsic Functions<br />

If you wish to use the libmass.a scalar library <strong>for</strong> some functions and the normal<br />

intrinsic functions, follow this procedure to compile and link your program:<br />

1. Create an export list (this can be a flat text file) containing the names of the<br />

desired functions. For example, to select only the fast tangent function from<br />

libmass.a <strong>for</strong> use with the program sample.f, create a file called fast_tan.exp<br />

with the following line:<br />

tan<br />

2. Create a shared object from the export list with the ld command, linking with<br />

the libmass.a library. For example:<br />

ld -bexport:fast_tan.exp -o fast_tan.o -bnoentry -lmass -bmodtype:SRE<br />

3. Archive the shared object into a library with the ar command. For example:<br />

ar -q libfasttan.a fast_tan.o<br />

4. Create the final executable using xlf. This links only the functions specified in<br />

the object file (in this example, the tan function) and the remainder of the math<br />

functions from the standard system library. For example:<br />

xlf -o sample sample.f -Ldir_containing_libfasttan.a -lfasttan<br />

Note: The MASS cos function is automatically linked if you export MASS sin;<br />

MASS atan2 is automatically linked if you export MASS atan.<br />

Related In<strong>for</strong>mation<br />

v ld and ar in <strong>AIX</strong> Commands Reference<br />

Appendix C. Using the Mathematical Acceleration Subsystem (MASS) 423

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!