For example, to compile an LSF API program on a Solaris 2.x 32 bit machine, you will have a compilation statement similar to the following:
% cc -o simbhosts simbhosts.c -I$LSF_ENVDIR/../include $LSF_LIBDIR/libbat.a $LSF_LIBDIR/liblsf.a -lnsl -lelf ‑lsocket -lrpcsvc -lgen -ldl -lresolv -lm
The flag -I$LSF_ENVDIR/../include specifies the location of the LSF include directory.
$LSF_LIBDIR/libbat.a and $LSF_LIBDIR/liblsf.a are the locations of the LSLIB and LSBLIB.
We include the following extra compilation flags as given from the above chart:
The resulting executable of the program simbhosts.c is called simbhosts.
/opt/SUNWspro/bin/cc obj.c -R/usr/dt/lib:/usr/openwin/lib -DSVR4 -DSOLARIS-DSOLARIS64 -xs -xarch=amd64 -D_TS_ERRNO -Dx86_64 -DSOLARIS2_5 -DSOLARIS2_7-DI18N_COMPILE -DSOLARIS2_8 -DSOLARIS2_10 -DSTD_SHARED_OBJ -lbat -llsf -lnsl-lelf -lsocket -lrpcsvc -lgen -ldl -lresolv -o obj_name
where obj.c is the name of the program you want to compile and obj_name is the name of the binary you can run after compiling the program.