X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParallelContainer%2FSALOME_ParallelContainer_i.cxx;h=63ee3a7aca9c81d92aeb44c5f578be8dacdfd21c;hb=d8edd4804d9e6513a17c497c1a30326d4ba0d677;hp=e4852f4f45e586d43873a19f6164fc068d7fd322;hpb=ebe3541632797c5fad97573b46655718ddd61444;p=modules%2Fkernel.git diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx index e4852f4f4..63ee3a7ac 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -66,7 +66,7 @@ extern "C" {void SigIntHandler( int ) ; } //============================================================================= /*! - * Construtor + * Constructor */ //============================================================================= @@ -282,7 +282,7 @@ void Engines_Parallel_Container_i::Shutdown() * \param componentName like COMPONENT * try to make a Python import of COMPONENT, * then a lib open of libCOMPONENTEngine.so - * \return true if dlopen successfull or already done, false otherwise + * \return true if dlopen successful or already done, false otherwise */ //============================================================================= @@ -295,7 +295,11 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName, bool ret = false; std::string aCompName = componentName; #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 @@ -321,7 +325,7 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName, MESSAGE("Try to load C++ component"); void* handle; #ifndef WIN32 - handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; + handle = dlopen( impl_name.c_str() , RTLD_LAZY | RTLD_GLOBAL ) ; #else handle = dlopen( impl_name.c_str() , 0 ) ; #endif @@ -349,7 +353,7 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName, PyObject *result = PyObject_CallMethod(pyCont, (char*)"import_component", (char*)"s",componentName); - std::string ret_p= PyString_AsString(result); + std::string ret_p= PyUnicode_AsUTF8(result); Py_XDECREF(result); Py_RELEASE_NEW_THREAD; @@ -411,7 +415,11 @@ Engines_Parallel_Container_i::create_component_instance_env(const char*genericRe 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 @@ -424,7 +432,7 @@ Engines_Parallel_Container_i::create_component_instance_env(const char*genericRe void* handle = _library_map[impl_name]; if (handle) type_of_lib = "cpp"; - if (_library_map.count(aCompName) != 0 and !handle) + if (_library_map.count(aCompName) != 0 && !handle) type_of_lib = "python"; if (type_of_lib == "Not Loaded") @@ -609,7 +617,7 @@ Engines_Parallel_Container_i::createFileRef(const char* origFileName) if (origName[0] != '/') { - INFOS("path of file to copy must be an absolute path begining with '/'"); + INFOS("path of file to copy must be an absolute path beginning with '/'"); return Engines::fileRef::_nil(); } @@ -720,7 +728,7 @@ Engines_Parallel_Container_i::find_or_create_instance(std::string genericRegiste } catch (...) { - INFOS( "Container_i::load_impl catched" ) ; + INFOS( "Container_i::load_impl caught" ) ; } return iobject._retn(); } @@ -762,7 +770,7 @@ Engines_Parallel_Container_i::createPythonInstance(std::string genericRegisterNa PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, (char*)"create_component_instance", - (char*)"ssl", + (char*)"ss", genericRegisterName.c_str(), instanceName.c_str()); const char *ior; @@ -848,7 +856,7 @@ Engines_Parallel_Container_i::createCPPInstance(std::string genericRegisterName, std::string component_registerName = _containerName + "/" + instanceName; - // --- Instanciate required CORBA object + // --- Instantiate required CORBA object PortableServer::ObjectId *id; //not owner, do not delete (nore use var) id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str(), @@ -873,7 +881,7 @@ Engines_Parallel_Container_i::createCPPInstance(std::string genericRegisterName, } catch (...) { - INFOS( "Container_i::createInstance exception catched" ); + INFOS( "Container_i::createInstance exception caught" ); } return iobject._retn(); } @@ -889,7 +897,11 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co std::string _proxy_containerName = proxy_containerName; #ifndef WIN32 +#ifdef __APPLE__ + string impl_name = string ("lib") + aCompName + string("Engine.dylib"); +#else string impl_name = string ("lib") + aCompName +string("Engine.so"); +#endif #else string impl_name = aCompName +string("Engine.dll"); #endif @@ -940,7 +952,7 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co std::string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2; std::string component_registerName = _containerName + "/" + instanceName; - // --- Instanciate work node + // --- Instantiate work node PortableServer::ObjectId *id ; //not owner, do not delete (nore use var) id = (Component_factory) (_orb, proxy_ior, getMyRank(), _poa, _id, instanceName.c_str(), componentName); CORBA::string_free(proxy_ior); @@ -963,10 +975,10 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co } catch (...) { - INFOS("Container_i::create_paco_component_node_instance exception catched"); + INFOS("Container_i::create_paco_component_node_instance exception caught"); SALOME::ExceptionStruct es; es.type = SALOME::INTERNAL_ERROR; - es.text = "Container_i::create_paco_component_node_instance exception catched"; + es.text = "Container_i::create_paco_component_node_instance exception caught"; throw SALOME::SALOME_Exception(es); } }