Unverified Commit 9ef98fd3 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2592 from peastman/dlopen

Fix error loading CPU PME on Mac
parents d510e164 219361da
...@@ -221,8 +221,12 @@ static void initializePlugins(vector<HMODULE>& plugins) { ...@@ -221,8 +221,12 @@ static void initializePlugins(vector<HMODULE>& plugins) {
static void* loadOneLibrary(const string& file) { static void* loadOneLibrary(const string& file) {
#ifdef __PNACL__ #ifdef __PNACL__
throw OpenMMException("Loading dynamic libraries is not supported on PNaCl"); throw OpenMMException("Loading dynamic libraries is not supported on PNaCl");
#else
#ifdef __APPLE__
void *handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_GLOBAL);
#else #else
void *handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_LOCAL); void *handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_LOCAL);
#endif
if (handle == NULL) { if (handle == NULL) {
throw OpenMMException("Error loading library "+file+": "+dlerror()); throw OpenMMException("Error loading library "+file+": "+dlerror());
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment