Passing Linker Options with Multiple Arguments using -Xlinker,-Wl, or -Qoption,link

When using the compiler driver (icc/icpc/ifort) of Intel® C++ Compiler or Intel Fortran Compiler for Linux to link together object files, you may have a need to pass a linker option directly to "ld" that contains multiple parts, such as "-rpath <dir>".  There are several ways to do this:

Method # 1:

-Xlinker -rpath -Xlinker <dir>

Method # 2:


Method # 3:

For more complete information about compiler optimizations, see our Optimization Notice.