#ifndef WIN32
void* handle;
- handle = dlopen( impl_name.c_str() , RTLD_NOW ) ;
+ handle = dlopen( impl_name.c_str() , RTLD_NOW | RTLD_GLOBAL ) ;
if ( !handle )
- {
- //not loadable. Try to find the lib file in LD_LIBRARY_PATH
- std::string path;
+ {
+ //not loadable. Try to find the lib file in LD_LIBRARY_PATH
+ std::string path;
- char* p=getenv("LD_LIBRARY_PATH");
- if(p)path=p;
- path=path+SEP+"/usr/lib"+SEP+"/lib";
-
- std::string pth;
- if(findpathof(path, pth, impl_name))
- {
- //found but not loadable
- reason="Component ";
- reason+=aCompName;
- reason+=": C++ implementation found ";
- reason+=pth;
- reason+=" but it is not loadable. Error:\n";
- reason+=dlerror();
- std::cerr << reason << std::endl;
- return false;
- }
- else
- {
- //not found
- //continue with other implementation
- reason="ImplementationNotFound";
- return false;
+#ifdef __APPLE__
+ char* p=getenv("DYLD_LIBRARY_PATH");
+#else
+ char* p=getenv("LD_LIBRARY_PATH");
+#endif
+ if(p)path=p;
+ path=path+SEP+"/usr/lib"+SEP+"/lib";
+
+ std::string pth;
+ if(findpathof(path, pth, impl_name))
+ {
+ //found but not loadable
+ reason="Component ";
+ reason+=aCompName;
+ reason+=": C++ implementation found ";
+ reason+=pth;
+ reason+=" but it is not loadable. Error:\n";
+ reason+=dlerror();
+ std::cerr << reason << std::endl;
+ return false;
+ }
+ else
+ {
+ //not found
+ //continue with other implementation
+ reason="ImplementationNotFound";
+ return false;
- }
}
+ }
#else
HINSTANCE handle;
handle = LoadLibrary( impl_name.c_str() );
MESSAGE("Begin of create_component_instance in node : " << getMyRank());
reason=CORBA::string_dup("");
- if (studyId < 0)
- {
- INFOS("studyId must be > 0 for mono study instance, =0 for multiStudy");
- return Engines::EngineComponent::_nil() ;
- }
-
std::string aCompName = genericRegisterName;
#ifndef WIN32
+#ifdef __APPLE__
+ std::string impl_name = string ("lib") + aCompName + string("Engine.dylib");
+#else
std::string impl_name = string ("lib") + aCompName +string("Engine.so");
+#endif
#else
std::string impl_name = aCompName +string("Engine.dll");
#endif