From: rnv Date: Wed, 7 Jun 2017 11:24:09 +0000 (+0300) Subject: Merge multi-study removal branch. X-Git-Tag: Before_python3_27062017~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b7e1322de9ff9e2947d1a914d4bc20c2cb395cb5;p=modules%2Fkernel.git Merge multi-study removal branch. --- b7e1322de9ff9e2947d1a914d4bc20c2cb395cb5 diff --cc src/Container/Container_i.cxx index b681a0124,06cd2c382..05ca69454 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@@ -518,40 -514,36 +518,40 @@@ Engines_Container_i::load_component_Cpp #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() ); diff --cc src/ParallelContainer/SALOME_ParallelContainer_i.cxx index 14a612934,c6f041c81..9ec140d57 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx @@@ -419,19 -409,9 +413,13 @@@ Engines_Parallel_Container_i::create_co 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