Guide and Reference


Compiling and Linking

You can use any procedures you are currently using to link or run your program, as long as you make the necessary modifications for ESSL. This section describes these modifications. For details on the complete procedures, see your operating system and programming language manuals.

Fortran Programs

If you are accessing ESSL from a Fortran program and want to compile and link in one step, you can use the following command:
ESSL Library Name Command
SMP
   xlf_r  -O  -qnosave xyz.f  -lesslsmp

Thread-Safe
   xlf_r  -O -qnosave xyz.f  -lessl_r

POWER2
   xlf  -O  xyz.f  -lesslp2

POWER
   xlf  -O  xyz.f  -lessl

where xyz.f is the name of your Fortran program.

If you want to compile and link your Fortran program in separate steps, you can use the following commands:
ESSL Library Name Command
SMP
   xlf_r  -O  -c  -qnosave  xyz.f
   xlf_r  xyz.o  -lesslsmp

Thread-Safe
   xlf_r  -O  -c  -qnosave  xyz.f
   xlf_r  xyz.o  -lessl_r

POWER2
   xlf  -O  -c  xyz.f
   xlf  xyz.o  -lesslp2

POWER
   xlf  -O  -c  xyz.f
   xlf  xyz.o  -lessl

where xyz.f is the name of your Fortran program, and xyz.O is the name of your object file.

C Programs

If you are accessing ESSL from a C program and want to compile and link in one step, you can use the following command:
ESSL Library Name Command
SMP
   cc_r  -O  xyz.c  -lesslsmp

Thread-Safe
   cc_r  -O  xyz.c  -lessl_r

POWER2
   cc  -O  xyz.c  -lesslp2

POWER
   cc  -O  xyz.c  -lessl

where xyz.c is the name of your C program.

If you want to compile and link your C program in separate steps, you can use the following commands:
ESSL Library Name Command
SMP
   cc_r  -cO  xyz.c
   cc_r  xyz.o  -lesslsmp

Thread-Safe
   cc_r  -cO  xyz.c
   cc_r  xyz.o  -lessl_r

POWER2
   cc  -cO  xyz.c
   cc  xyz.o  -lesslp2

POWER
   cc  -cO  xyz.c
   cc  xyz.o  -lessl

where xyz.c is the name of your C program and xyz.o is the name of your object file.

In the above cases, you automatically use the definitions of short- and long-precision complex data provided in the ESSL header file. If you prefer to specify your own definitions for short- and long-precision complex data, add -D_CMPLX and -D_DCMPLX, respectively, to your commands, as shown here:
ESSL Library Name Command
SMP
   cc_r  -O  -D_CMPLX  -D_DCMPLX  xyz.c  -lesslsmp

Thread-Safe
   cc_r  -O  -D_CMPLX  -D_DCMPLX  xyz.c  -lessl_r

POWER2
   cc  -O  -D_CMPLX  -D_DCMPLX  xyz.c  -lesslp2

POWER
   cc  -O  -D_CMPLX  -D_DCMPLX  xyz.c  -lessl

C++ Programs

If you are accessing ESSL from a C++ program and want to compile and link in one step, you can use the following command:
ESSL Library Name Command
SMP
   xlC_r  -O  xyz.C  -lesslsmp

Thread-Safe
   xlC_r  -O  xyz.C  -lessl_r

POWER2
   xlC  -O  xyz.C  -lesslp2

POWER
   xlC  -O  xyz.C  -lessl

where xyz.C is the name of your C++ program.

If you want to compile and link your C++ program in separate steps, you can use the following commands:
ESSL Library Name Command
SMP
   xlC_r  -cO  xyz.C
   xlC_r  xyz.o  -lesslsmp

Thread-Safe
   xlC_r  -cO  xyz.C
   xlC_r  xyz.o  -lessl_r

POWER2
   xlC  -cO  xyz.C
   xlC  xyz.o  -lesslp2

POWER
   xlC  -cO  xyz.C
   xlC  xyz.o  -lessl

where xyz.C is the name of your C++ program, and xyz.o is the name of your object file.

In the above cases, you automatically use the definition of short-precision complex data provided in the ESSL header file. If you prefer to specify your own definition for short-precision complex data, add -D_CMPLX to your commands, as shown here:
ESSL Library Name Command
SMP
   xlC_r  -O  -D_CMPLX  xyz.C  -lesslsmp

Thread-Safe
   xlC_r  -O  -D_CMPLX  xyz.C  -lessl_r

POWER2
   xlC  -O  -D_CMPLX  xyz.C  -lesslp2

POWER
   xlC  -O  -D_CMPLX  xyz.C  -lessl


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]