From 19658ff1a41b7ad696ef686596acb542b6a64633 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 11 Dec 2012 11:39:10 +0000 Subject: [PATCH] Merge from V6_6_BR (V6_6_0rc2) 11/12/2012 --- CMakeLists.txt | 2 +- bin/killSalomeWithPort.py | 32 +++- bin/salome_utils.py | 7 +- bin/setenv.py | 3 +- bin/shutdownSalome.py | 11 +- configure.ac | 2 +- doc/docutils/CMakeLists.txt | 132 +++++++-------- doc/salome/gui/CMakeLists.txt | 2 +- doc/salome/tui/CMakeLists.txt | 2 +- salome_adm/cmake_files/FindPLATFORM.cmake | 13 +- salome_adm/cmake_files/am2cmake.py | 165 +++++++++---------- salome_adm/unix/config_files/check_cas.m4 | 4 +- src/Container/SALOME_ContainerManager.cxx | 16 +- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 3 + 14 files changed, 220 insertions(+), 174 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80dd89acf..61bf57ba7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ SET(WITH_LOCAL 1) SET(WITH_BATCH 1) ENABLE_TESTING() -SET(VERSION "6.5.0") +SET(VERSION "6.6.0") SET(VERSION_DEV "1") INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 705c8e3ca..c6c128b23 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -137,7 +137,7 @@ def appliCleanOmniOrbConfig(port): ########## kills all salome processes with the given port ########## -def shutdownMyPort(port): +def shutdownMyPort(port, cleanup=True): """ Shutdown SALOME session running on the specified port. Parameters: @@ -162,18 +162,25 @@ def shutdownMyPort(port): with_port=port, **kwargs) os.environ['OMNIORB_CONFIG'] = omniorb_config + os.environ['NSPORT'] = str(port) # give the chance to the servers to shutdown properly try: import time - import salome_kernel - orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init() + from omniORB import CORBA + from LifeCycleCORBA import LifeCycleCORBA # shutdown all + orb = CORBA.ORB_init([''], CORBA.ORB_ID) + lcc = LifeCycleCORBA(orb) lcc.shutdownServers() # give some time to shutdown to complete time.sleep(1) # shutdown omniNames and notifd - salome_kernel.LifeCycleCORBA.killOmniNames() + if cleanup: + lcc.killOmniNames() + time.sleep(1) + pass + pass except: pass pass @@ -188,7 +195,7 @@ def killMyPort(port): # try to shutdown session nomally import threading, time - threading.Thread(target=shutdownMyPort, args=(port,)).start() + threading.Thread(target=shutdownMyPort, args=(port,False)).start() time.sleep(3) # wait a little, then kill processes (should be done if shutdown procedure hangs up) # new-style dot-prefixed pidict file @@ -355,10 +362,19 @@ def killMyPortSpy(pid, port): return if __name__ == "__main__": + if len(sys.argv) < 2: + print "Usage: " + print " %s " % os.path.basename(sys.argv[0]) + print + print "Kills SALOME session running on specified ." + sys.exit(1) + pass if sys.argv[1] == "--spy": - pid = sys.argv[2] - port = sys.argv[3] - killMyPortSpy(pid, port) + if len(sys.argv) > 3: + pid = sys.argv[2] + port = sys.argv[3] + killMyPortSpy(pid, port) + pass sys.exit(0) pass for port in sys.argv[1:]: diff --git a/bin/salome_utils.py b/bin/salome_utils.py index 95e87f42c..295b05d24 100644 --- a/bin/salome_utils.py +++ b/bin/salome_utils.py @@ -194,8 +194,11 @@ def getPortNumber(use_default=True): return int( os.getenv( "NSPORT" ) ) except: pass - port = getPortFromORBcfg() - if port is not None: return port + try: + port = int( getPortFromORBcfg() ) + if port is not None: return port + except: + pass if use_default: return 2809 # '2809' is default port number return None diff --git a/bin/setenv.py b/bin/setenv.py index 44ac6dbe7..46bc337be 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -172,7 +172,8 @@ def set_env(args, modules_list, modules_root_dir, silent=False): for module in modules_list : if modules_root_dir.has_key(module): module_root_dir = modules_root_dir[module] - modules_root_dir_list[:0] = [module_root_dir] + if module_root_dir not in modules_root_dir_list: + modules_root_dir_list[:0] = [module_root_dir] if sys.platform == "win32": add_path(os.path.join(module_root_dir,get_lib_dir(),salome_subdir), "PATH") diff --git a/bin/shutdownSalome.py b/bin/shutdownSalome.py index b7d319696..ed81e00e8 100755 --- a/bin/shutdownSalome.py +++ b/bin/shutdownSalome.py @@ -27,9 +27,12 @@ # import time -import salome_kernel -orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init() +from omniORB import CORBA +from LifeCycleCORBA import * + +orb = CORBA.ORB_init([''], CORBA.ORB_ID) +lcc = LifeCycleCORBA(orb) lcc.shutdownServers() -#give some time to shutdown to complete time.sleep(1) -salome_kernel.LifeCycleCORBA.killOmniNames() +LifeCycleCORBA.killOmniNames() +time.sleep(1) diff --git a/configure.ac b/configure.ac index e8d2e1458..65af95169 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ # ================================================================ #AC_PREREQ(2.59) # -AC_INIT([Salome2 Project], [6.5.0], [paul.rascle@edf.fr], [SalomeKERNEL]) +AC_INIT([Salome2 Project], [6.6.0], [paul.rascle@edf.fr], [SalomeKERNEL]) # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary # scripts such as config.guess, install-sh, ... diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt index 652bf863b..71b6d67fb 100755 --- a/doc/docutils/CMakeLists.txt +++ b/doc/docutils/CMakeLists.txt @@ -1,66 +1,66 @@ -# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -SET(SPHINXOPTS -) -SET(SOURCEDIR - ${CMAKE_CURRENT_SOURCE_DIR} -) -SET(PAPEROPT_a4 - -D - latex_paper_size=a4 -) -SET(ALLSPHINXOPTS - -d - doctrees - ${PAPEROPT_a4} - ${SPHINXOPTS} - ${SOURCEDIR} -) - -SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py") - -IF(WINDOWS) - STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=%KERNEL_ROOT_DIR%/lib/python2.6/site-packages/salome\;%PYTHONPATH% - @SET PYTHONPATH=%KERNEL_ROOT_DIR%/bin/salome\;%PYTHONPATH% - @SET PATH=%KERNEL_ROOT_DIR%/lib/salome\;%PATH% - @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PYTHONPATH% - @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python\;%PYTHONPATH% - @SET PATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PATH% - ") - SET(EXT "bat") - SET(CALL_STR "call") -ELSE(WINDOWS) - SET(SCR "export PYTHONPATH=\${KERNEL_ROOT_DIR}/lib/python2.6/site-packages/salome:\${PYTHONPATH} - export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PYTHONPATH} - export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH} - export PYTHONPATH=\${OMNIORB_ROOT_USER}/omniORB-4.1.5/lib:\${PYTHONPATH} - export PYTHONPATH=\${OMNIORB_ROOT_USER}/omniORB-4.1.5/lib/python2.6/site-packages:\${PYTHONPATH} - export LD_LIBRARY_PATH=\${INST_ROOT}/omniORB-4.1.5/lib:\${LD_LIBRARY_PATH} - ") - SET(EXT "sh") - SET(CALL_STR ".") -ENDIF(WINDOWS) - -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}") - -ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -Q -c ${CMAKE_BINARY_DIR}/doc/docutils -W -b html ${ALLSPHINXOPTS} html - COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''')\" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) +# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +SET(SPHINXOPTS +) +SET(SOURCEDIR + ${CMAKE_CURRENT_SOURCE_DIR} +) +SET(PAPEROPT_a4 + -D + latex_paper_size=a4 +) +SET(ALLSPHINXOPTS + -d + doctrees + ${PAPEROPT_a4} + ${SPHINXOPTS} + ${SOURCEDIR} +) + +SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py") + +IF(WINDOWS) + STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\python2.6\\site-packages\\salome\;%PYTHONPATH% + @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH% + @SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH% + @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PYTHONPATH% + @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\python\;%PYTHONPATH% + @SET PATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PATH% + ") + SET(EXT "bat") + SET(CALL_STR "call") +ELSE(WINDOWS) + SET(SCR "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python2.6/site-packages/salome:\${PYTHONPATH} + export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH} + export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH} + export PYTHONPATH=${OMNIORB_ROOT_USER}/lib:\${PYTHONPATH} + export PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python2.6/site-packages:\${PYTHONPATH} + export LD_LIBRARY_PATH=${OMNIORB_ROOT_USER}/lib:\${LD_LIBRARY_PATH} + ") + SET(EXT "sh") + SET(CALL_STR ".") +ENDIF(WINDOWS) + +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}") + +ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html + COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''')\" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 0d0992e38..8bd8df903 100755 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -32,4 +32,4 @@ ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE} VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - +ADD_DEPENDENCIES(usr_docs html_docs) diff --git a/doc/salome/tui/CMakeLists.txt b/doc/salome/tui/CMakeLists.txt index ae05910b6..51ce739b3 100755 --- a/doc/salome/tui/CMakeLists.txt +++ b/doc/salome/tui/CMakeLists.txt @@ -25,7 +25,7 @@ SET(datadir ${CMAKE_INSTALL_PREFIX}/share) SET(docdir ${datadir}/doc/salome) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_SOURCE_DIR}/static/header.html) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html) ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u COMMAND ${DOXYGEN_EXECUTABLE} diff --git a/salome_adm/cmake_files/FindPLATFORM.cmake b/salome_adm/cmake_files/FindPLATFORM.cmake index 9266320ac..fa06d0ec3 100644 --- a/salome_adm/cmake_files/FindPLATFORM.cmake +++ b/salome_adm/cmake_files/FindPLATFORM.cmake @@ -107,6 +107,10 @@ IF(WINDOWS) SET(PLATFORM_LIBS ${PLATFORM_LIBS} Ws2_32.lib) SET(PLATFORM_LIBS ${PLATFORM_LIBS} Userenv.lib) # At least for GEOM suit + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") # if platform is Windows 64 bit + SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0 -D_HAS_ITERATOR_DEBUGGING=0") # To avoid runtime error during checking iterators # to be removed + SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0 -D_HAS_ITERATOR_DEBUGGING=0") # To avoid runtime error during checking iterators + ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") ELSE(WINDOWS) # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses) # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type) @@ -117,8 +121,13 @@ ELSE(WINDOWS) SET(PLATFORM_LIBS ${PLATFORM_LIBS} -ldl) ENDIF(WINDOWS) -SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4") # to be removed -SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4") +SET(SIZE_OF_LONG ${CMAKE_SIZEOF_VOID_P}) # set sizeof(long) the same as size of pointers, because on all memory models (EXCLUDING WINDOWS 64 bit) it is equivalent values +IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND WINDOWS) # if it platform Windows 64 bit + SET(SIZE_OF_LONG "4") # set sizeof(long) to 4 byte +ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND WINDOWS) + +SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${SIZE_OF_LONG} -DSIZEOF_INT=4") # to be removed +SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${SIZE_OF_LONG} -DSIZEOF_INT=4") SET(COMPILATION_WITH_CMAKE ON) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 3a1a89a76..a20dd27e5 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -619,7 +619,7 @@ class CMakeFile(object): INCLUDE(${GEOM_ROOT_DIR}/adm_local/cmake_files/FindGEOM.cmake) INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake) INCLUDE(${SMESH_ROOT_DIR}/adm_local/cmake_files/FindSMESH.cmake) - INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindBLSURF.cmake) + INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindCADSURF.cmake) """) pass if self.module in ["ghs3dplugin", "hexoticplugin"]: @@ -656,6 +656,11 @@ class CMakeFile(object): INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake) """) pass + if self.module == "jobmanager": + newlines.append(""" + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake) + """) + pass if self.module == "hxx2salome": newlines.append(""" SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR}) @@ -797,9 +802,9 @@ class CMakeFile(object): pass # -- newlines.append(""" - set(VERSION 6.5.0) - set(SHORT_VERSION 6.5) - set(XVERSION 0x060500) + set(VERSION 6.6.0) + set(SHORT_VERSION 6.6) + set(XVERSION 0x060600) set(VERSION_DEV 1) """) pass @@ -1114,7 +1119,7 @@ class CMakeFile(object): ) ''') self.files.append("static/header.html.in") - elif self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['kernel', 'gui', 'geom', 'med', 'smesh', 'visu'] and self.root[-len('tui'):] == 'tui': + elif self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['kernel', 'gui', 'geom', 'med', 'smesh', 'visu', 'blsurfplugin'] and self.root[-len('tui'):] == 'tui' or operator.contains(self.root, 'doc') and mod in ['pyhello']: newlines.append(r''' SET(top_builddir ${CMAKE_BINARY_DIR} @@ -1135,7 +1140,8 @@ class CMakeFile(object): ${datadir}/doc/salome ) ''') - self.files.append("static/header.html.in") + if mod not in ['blsurfplugin']: + self.files.append("static/header.html.in") if mod in ['geom', 'smesh', 'visu','netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin',"ghs3dprlplugin"] and self.root[-len(mod):] == upmod: self.files.append("static/header_py.html.in") @@ -1214,7 +1220,7 @@ class CMakeFile(object): WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )"""%(input, doc_gui_destination, doc_source, doc_gui_destination, head_source, doc_gui_destination)) from os import path - if mod in ['geom', 'smesh', 'visu', 'netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin','ghs3dprlplugin'] and self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc'): + if mod in ['geom', 'smesh', 'visu', 'netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin','ghs3dprlplugin','pyhello'] and self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['pyhello'] and operator.contains(self.root, 'doc'): ign = r"""'*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*'""" if mod in ['geom', 'smesh']: if mod == 'geom': @@ -1237,19 +1243,20 @@ class CMakeFile(object): VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )"""%(prepare_generating_doc_src, prepare_generating_doc_src, tmp, upmod, tmp, tmp, input, tmp, doc_gui_destination, doc_gui_destination, ign, head_source, doc_gui_destination)) + newlines.append(r"""ADD_DEPENDENCIES(usr_docs html_docs)""") else: config_f = "" if mod in ['netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin', "ghs3dprlplugin"] : - config_f = "doxyfile_py" - else: - config_f = "doxyfile_idl" - newlines.append("""\t ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE} %s + config_f = "${DOXYGEN_EXECUTABLE} doxyfile_py" + elif mod not in ['pyhello']: + config_f = "${DOXYGEN_EXECUTABLE} doxyfile_idl" + newlines.append("""\t ADD_CUSTOM_TARGET(usr_docs %s COMMAND ${DOXYGEN_EXECUTABLE} doxyfile COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''',True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''',r'''%s''', ignore=shutil.ignore_patterns(%s)); shutil.copy(r'''%s''',r'''%s''')" VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )"""%(config_f, doc_gui_destination, doc_gui_destination, ign, head_source, doc_gui_destination)) - elif mod == 'yacs' and operator.contains(self.root, upmod + '_SRC'+path.sep+'doc'): + elif mod in ['yacs', 'jobmanager'] and operator.contains(self.root, upmod + '_SRC'+path.sep+'doc'): from sys import platform params = ''; if platform == "win32": @@ -1267,21 +1274,19 @@ class CMakeFile(object): params = '-Q'; ext = "bat" prf = "call" + cmd = "STRING(REPLACE \"/\" \"\\\\\" SCR" else: ext = "sh" prf = ". " + cmd = "SET(SCR" doc_gui_destination = "${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/%s/docutils"%(upmod) scr = self.writeEnvScript(upmod) newlines.append(r""" - IF(WINDOWS) - STRING(REPLACE "/" "\\" SCR "%s") - ELSE(WINDOWS) - SET(SCR "%s") - ENDIF(WINDOWS) + %s "%s") FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s "${SCR}") - ADD_CUSTOM_TARGET(html_docs %s ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s && ${SPHINX_EXECUTABLE} %s -c ${CMAKE_BINARY_DIR}/doc/docutils -W -b html ${ALLSPHINXOPTS} html + ADD_CUSTOM_TARGET(html_docs %s ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s && ${SPHINX_EXECUTABLE} %s -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''%s''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''%s''')\" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"""%(scr,scr,ext,prf,ext,params, doc_gui_destination, doc_gui_destination)) + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"""%(cmd, scr, ext, prf, ext, params, doc_gui_destination, doc_gui_destination)) @@ -1291,7 +1296,7 @@ class CMakeFile(object): # -- upmod = self.module.upper() - if mod in ['kernel', 'gui', 'med', 'smesh', 'visu'] and self.root[-len('tui'):] == 'tui': + if mod in ['kernel', 'gui', 'med', 'smesh', 'visu', 'blsurfplugin'] and self.root[-len('tui'):] == 'tui': if mod == 'kernel': tmp = """\tADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u COMMAND ${DOXYGEN_EXECUTABLE} @@ -1302,14 +1307,15 @@ class CMakeFile(object): if mod == 'visu': tmp1= r"""\n COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/visuscreen.png''', r'''%s''')" """%(doc_tui_destination) elif mod == 'smesh': - extra_srcdir = "${CMAKE_CURRENT_SOURCE_DIR}/extra" - tmp1= """\n COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/smeshscreen.png''', r'''%s'''); copy(r'''%s/AddNetgenInSalome2.pdf''', r'''%s'''); copy(r'''%s/PluginMeshers.html''', r'''%s''')" - COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''%s/AddNetgenInSalome2.ps''', r'''%s'''); copy(r'''%s/AddNetgenInSalome2.sxw''', r'''%s''')" """%(doc_tui_destination, extra_srcdir,doc_destination, extra_srcdir,doc_destination, extra_srcdir,doc_destination,extra_srcdir,doc_destination) + tmp1= """\n COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/smeshscreen.png''', r'''%s''')" """%(doc_tui_destination) else: tmp1="" doc_source = "${CMAKE_CURRENT_BINARY_DIR}/%s"%(upmod) + inst_head_command="" + if mod not in ['blsurfplugin']: + inst_head_command = "; shutil.copy(r'''%s''', r'''%s''')"%(head_source, doc_tui_destination) newlines.append(tmp + """ - COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''', True); shutil.copytree(r'''%s''', r'''%s'''); shutil.copy(r'''%s''', r'''%s''')" """%(doc_tui_destination, doc_source, doc_tui_destination, head_source, doc_tui_destination) + tmp1 + """ + COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''', True); shutil.copytree(r'''%s''', r'''%s''')%s" """%(doc_tui_destination, doc_source, doc_tui_destination, inst_head_command) + tmp1 + """ VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )""") @@ -2444,70 +2450,61 @@ class CMakeFile(object): f.close() return - def writeEnvScript(self, upmod): - from sys import platform, version_info - p_version = """%s.%s"""%(version_info[0],version_info[1]) - python_path ="PYTHONPATH" - path = "" - begin = "" - end = "" - delim = "" - cmd = "" - pdir = "" - omni = "" - omni_py = "" - if platform == "win32" : - path = "PATH" - begin = "%" - end = "%" - delim = ";" - cmd = "@SET " - omni = "/x86_win32" - omni_py = "/python" - pdir = "PDIR" + def writeEnvScript(self, upmod, buildmod=True): + import os, sys + p_version = sys.version[:3] + python_path = "PYTHONPATH" + root_dir = "%s_ROOT_DIR" % upmod + if sys.platform == "win32": + script_line = '@SET %(var)s=%(val)s;%%%(var)s%%\n' + var_line = '%%%s%%' + lib_path = "PATH" + omni = "x86_win32" + omni_py = "python" + pass else: - path = "LD_LIBRARY_PATH" - begin = "\${" - end = "}" - delim = ":" - cmd = "export " - omni_py = "/python" + p_version + "/" + "site-packages" - pdir = "INST_ROOT" - - - path_ = begin + path + end - root_dir_ = begin + upmod + "_ROOT_DIR" + end - python_path_ = begin + python_path + end - _python_path_ = delim + python_path_+ "\n" - _path_ = delim + path_+ "\n" - _pdir = begin + pdir + end - - - script = cmd + " " + python_path + "=" + root_dir_+"/lib/python" + p_version \ - + "/site-packages/salome" + _python_path_ - - script = script + cmd + " " + python_path + "=" + root_dir_+"/bin/salome" + \ - _python_path_ - - script = script + cmd + " "+ path + "=" + root_dir_+"/lib/salome"+ _path_ - + script_line = 'export %(var)s=%(val)s:\$%(var)s\n' + var_line = '\${%s}' + lib_path = "LD_LIBRARY_PATH" + omni = "" + omni_py = "/".join( ["python%s"%p_version , "site-packages"] ) + pass + # + script = "" + # + if buildmod: + script += script_line % { 'var':python_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "lib", "python%s"%p_version, "site-packages", "salome"] ) } + script += script_line % { 'var':python_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "bin", "salome"] ) } + script += script_line % { 'var':lib_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "lib", "salome"] ) } + pass + else: + script += script_line % { 'var':python_path, 'val':"/".join( [var_line % root_dir, "lib", "python%s"%p_version, "site-packages", "salome"] ) } + script += script_line % { 'var':python_path, 'val':"/".join( [var_line % root_dir, "bin", "salome"] ) } + script += script_line % { 'var':lib_path, 'val':"/".join( [var_line % root_dir, "lib", "salome"] ) } + pass + # if upmod == "KERNEL" : - script = script + cmd + " " + python_path + "=" + _pdir + \ - "/omniORB-4.1.5/lib" + omni + _python_path_ - - script = script + cmd + " " + python_path + "=" + _pdir + \ - "/omniORB-4.1.5/lib" + omni_py + _python_path_ - - script = script + cmd + " "+ path + "=" + _pdir+ "/omniORB-4.1.5/lib" + \ - omni + _path_ - + script += "\n" + if omni: + script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni] ) } + script += script_line % { 'var':lib_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni] ) } + pass + else: + script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib"] ) } + script += script_line % { 'var':lib_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib"] ) } + pass + script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni_py] ) } + pass + # if upmod == "GEOM" : - script = self.writeEnvScript("KERNEL") + script - script = self.writeEnvScript("GUI") + script - + script = self.writeEnvScript("KERNEL", False) + "\n" + script + script = self.writeEnvScript("GUI", False) + "\n" + script + pass + # if upmod == "SMESH" : - script = self.writeEnvScript("GEOM") + script - + script = self.writeEnvScript("GEOM", False) + "\n" + script + pass + return script pass diff --git a/salome_adm/unix/config_files/check_cas.m4 b/salome_adm/unix/config_files/check_cas.m4 index 7646fd377..98fa0bc5d 100644 --- a/salome_adm/unix/config_files/check_cas.m4 +++ b/salome_adm/unix/config_files/check_cas.m4 @@ -240,11 +240,11 @@ else CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKernel -lTKCDF -lTKLCAF -lTKPCAF -lTKStdSchema" CAS_OCAFVIS="$CAS_LDPATH -lTKCAF -lTKPLCAF -lTKPShape -lTKStdLSchema -lTKShapeSchema" - if test -f $CASROOT/$casdir/lib/libStdPlugin.so ; then + if test -f ${CAS_LIBDIR}/libStdPlugin.so ; then # standard plugin library libStdPlugin has been added in CASCADE 5.2.3 CAS_STDPLUGIN="StdPlugin" CAS_OCAFVIS="$CAS_OCAFVIS -lStdPlugin -lStdLPlugin" - elif test -f $CASROOT/$casdir/lib/libTKStdSchema.so ; then + elif test -f ${CAS_LIBDIR}/libTKStdSchema.so ; then # standard plugin has been renamed in CASCADE 6.5 CAS_STDPLUGIN=TKStdSchema CAS_OCAFVIS="$CAS_OCAFVIS -lTKStdSchema -lTKStdLSchema" diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index a513af413..3a6cebdf7 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -36,6 +36,9 @@ #include #include +#include +#include CORBA_CLIENT_HEADER(SALOME_Session) + #ifdef WNT #include #define getpid _getpid @@ -187,6 +190,17 @@ void SALOME_ContainerManager::Shutdown() void SALOME_ContainerManager::ShutdownContainers() { MESSAGE("ShutdownContainers"); + + SALOME::Session_var session = SALOME::Session::_nil(); + CORBA::Long pid = 0; + CORBA::Object_var objS = _NS->Resolve("/Kernel/Session"); + if (!CORBA::is_nil(objS)) + { + session = SALOME::Session::_narrow(objS); + if (!CORBA::is_nil(session)) + pid = session->getPID(); + } + bool isOK; isOK = _NS->Change_Directory("/Containers"); if( isOK ){ @@ -199,7 +213,7 @@ void SALOME_ContainerManager::ShutdownContainers() try { Engines::Container_var cont=Engines::Container::_narrow(obj); - if(!CORBA::is_nil(cont)) + if(!CORBA::is_nil(cont) && pid != cont->getPID()) lstCont.push_back((*iter)); } catch(const CORBA::Exception& e) diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 2afca3b7f..afd7e6f63 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -550,6 +550,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() if (!CORBA::is_nil(session)) { pid = session->getPID(); + session->Shutdown(); } } @@ -644,6 +645,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() // ignore and continue } + /* // 6) Session if ( !CORBA::is_nil( session ) ) { try @@ -655,6 +657,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() // ignore and continue } } + */ // 7) Logger int argc = 0; -- 2.39.2