This topic is a follow up on :
that I have opened myself and only partially solved.
Everything I wrote there works at least when I run the executable "from XCODE". (That is when i do a command+R in the xcode project.)
When I find the directory the executable console app is built in, and double click on it there, I receive this message :
Last login: Sun Nov 24 17:05:19 on ttys002
MacBook-Pro-de-MisesEnForce:~ MisesEnForce$ /Users/MisesEnForce/Library/Developer/Xcode/DerivedData/THECONSOLEAPPLICATION-hknajgycvjjcotdtkeeyxbzmtfty/Build/Products/Debug/THECONSOLEAPPLICATION ; exit;
dyld: Library not loaded: libmkl_sequential.dylib
Referenced from: /Users/MisesEnForce/Library/Developer/Xcode/DerivedData/THECONSOLEAPPLICATION-hknajgycvjjcotdtkeeyxbzmtfty/Build/Products/Debug/THECONSOLEAPPLICATION
Reason: image not found
Trace/BPT trap: 5
Any idea is welcome
Thx in advance,
The key problem is that the application requires environment path DYLD_LIBRARAY_PATH. You do the setting in Xcode environment, but not in double click. that is why you can run it from xcode, but can't double click the application directly.
Generally, under command windows, please source intel compiler vars.sh or export DYLD_LIBRARY_PATH=/opt/intel/mkl/xxx first, then go to your application's directory, start it by ./yourapp.exe.
The below article is out of date, but note 1 and note 2 should be helpful on your problem and 494329 ( libxxx. a need the entire path)
First thx a lot because doing :
worked indeed, but... I find it a bit unelegant : I don't want to force the users of my executable doing that export everytime then want to run the executable for a couple of time etc... Is there a way to "pack" that
into the executable, so that it could be done at runtime ? (***) (By the way, if I want to create a dylib linking to the mkl, I think that it must be mandatory to be able to "pack" that export command into the dylib somehow, isn't it ?)
By the way, I must admit that I don't really understand notes 1 & 2 of the link
you have pointed me to. Are these notes solution to my question (***) ?
If you prefer to use the dynamc library (dylib) you may try to edit system environment setting file , for example. http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x, Thus you can launch your exe at any time.
Or use static library, like libmkl_core.a, then you don't need to set the run-time environment variable DYLD_LIBRARY_PATH each times.
When static library link, you need use full path and library name. ( it is not correct syntax, -L -libmkl_core.a )