OMP: Error #15: Initializing libguide.dylib, but found libiomp5.dylib already initialized

"OMP: Error #15: Initializing libguide.dylib, but found libiomp5.dylib already initialized" is a linker error generated when different parts of a program try to link both static and dynamic verions of the OpenMP runtime.  The solution is to explicitly call out either a dynamic or static link.  The Intel compiler options for specifying the OpenMP library to be linked on Mac OS X* is -openmp-link static and -openmp-link dynamic.

This error has also been reported when two or more versions of MKL were installed.  Under this scenario, some files were being linked from one MKL version and some were being linked from another MKL version.  Setting the dynamic library enviornment variable DYLD_LIBRARY_PATH to include a path to only one MKL version resolved this issue.

A related article for Windows* developers can be found here.

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