When you compile your DRMAA application, you need to include some additional compiler directives to direct the compiler and linker to use DRMAA. The following directions apply for the Sun Studio Compiler Collection and for gcc. These instructions might not apply for other compilers and linkers. Consult the documentation for your specific compiler and linker products.
You must include two directives:
Tell the compiler to include the DRMAA header file by adding the following statement to the compiler command line:
-I<sge-root>/include
Tell the linker to include the DRMAA library by adding the following statement to the compiler and/or linker command line:
-ldrmaa
You also need to verify that the sge-root/lib/arch directory is included in your library search path (LD_LIBRARY_PATH on the Solaris Operating Environment and Linux). The sge-root/lib/arch directory is not included automatically when you set your environment using the settings.sh or settings.csh files.
The following example shows how you would compile your DRMAA application using the Sun Studio Compiler. The following assumptions apply:
You are using the csh shell on a Solaris host.
N1 Grid Engine is installed in /sge
The DRMAA application is stored in app.c.
Sample commands would look like the following
% source /sge/default/common/settings.csh % cc -I/sge/include -ldrmaa app.c