The Cray wrapper scripts include the necessary compiler and linker options for the executables to be run on the CNL nodes. These include the header files and system libraries such as libc, libmpich for MPI-2 of HP-MPI, libsci, liblustre, libcatamount, libsysio, libportals and the header files and libraries of the used compilers (e.g., libpgf90 or libgcc) and additionally loaded modules, e.g., ACML: libacml and FFTW3: libfftw3 and libfftw3f. The libraries of additionally loaded module of FFTW2 must be linked explicitly, see Mathematical libraries.
Only those functions and parts of the libraries that are needed are linked to the executable statically, even though all these libraries are loaded into memory in the linking phase. Because there are many libraries that are linked either automatically by the wrapper scripts or by the user's request, there may be functions and procedures with an identical name in two or more libraries. Normally the linker notifies the user if this happens. A bug may also cause these error messages (see PathScale Compiler Suite). This can be prevented by giving the option -z muldefs for the linker using the option -Wl which is available for all compilers:
ftn -Wl,-z,muldefs -o prog prog.f90
You can check from which library a particular procedure is linked by printing a link map. For PGI compilers, the option -m does this. You can also pass the request directly to linker by the PGI, PathScale, GCC and Intel compiler option -Wl,option[,option...], where option is a linker (ld, see man ld) option. The linker option for the link map is --print-map or shortly -M. The link map is printed to the standard output and because it is rather long you should redirect it to a file (in the following example, linkmap):
ftn -Wl,-M -o prog prog.f90 > linkmap
In addition, the normal PGI, PathScale, GCC or Intel compiler flags can be given to the drivers. Here you can add options for the header files and libraries of your application.