Reputation: 21
To give context (Unix MacOSX) I'm trying to link MKL with Eigen3. Everything works except for the fact that Clion can't run the executable that it builds, but I can manually run the Clion built exe in the terminal (./my_exe) (bash shell).
The error given is
"dyld: Library not loaded: @rpath/libiomp5.dylib" Referenced from: /Users/MyUser/Desktop/ClionProjects/MyProject/cmake-build-debug/my_exe Reason: image not found
I've tried setting the working directory to cmake-build-debug because that is where I am when manually running the exe through the terminal, no succes yet. I've checked the paths of the libraries and they seems fine (the ${DYLD_LIBRARY_PATH} does contain multiple paths, but one of them is the correct path, however if that was the issue why would it run fine in the terminal-shell?)
Additionally my unit tests support by BOOST won't run either.
Upvotes: 1
Views: 1156
Reputation: 21
Issue is solved! How (someone, not me) fixed it. CLion DYLD_LIBRARY_PATH was not set (all other environment variables were). When looking at the configuration of your target you can look at the list of environment variables. ->Edit configurations, click the ... next to Environment variables, you can then add one by clicking the + and you can see the current set for your target build by clicking show for me the DYLD_LIBRARY_PATH was not in this list, so we manually added DYLD_LIBRARY_PATH : /opt/intel/compilers_and_libraries_2018.1.126/mac/tbb/lib:/opt/intel/compilers_and_libraries_2018.1.126/mac/compiler/lib:/opt/intel/compilers_and_libraries_2018.1.126/mac/mkl/lib:/opt/local/lib:
To the executables environment variables when running the exe.
Upvotes: 1