From: barate Date: Tue, 23 Jul 2013 09:23:14 +0000 (+0000) Subject: Enable KERNEL compilation with PACO X-Git-Tag: begin_agr_portmanager_branch_131004~80 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2e1b544d56e4c289b3969f061628990912af1438;p=modules%2Fkernel.git Enable KERNEL compilation with PACO --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 586f02bbc..52dbf3d51 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) +INCLUDE(CMakeDependentOption) + PROJECT(SalomeKERNEL C CXX) # Ensure a proper linker behavior: @@ -55,14 +57,15 @@ ADD_DEFINITIONS(-DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_INT=4) # User options # ============ -OPTION(SALOME_USE_MPI "Use MPI containers" OFF) +CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" OFF + "NOT SALOME_PACO_PARALLEL" ON) OPTION(SALOME_BUILD_DOC "Generate SALOME KERNEL documentation" ON) OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) # Advanced: OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF) OPTION(SALOME_USE_LIBBATCH "Use LibBatch in KERNEL" ON) -OPTION(SALOME_PACO_PARALLEL "Build with PACO in parallel" OFF) +OPTION(SALOME_PACO_PARALLEL "Build with PACO (implies SALOME_USE_MPI)" OFF) OPTION(SALOME_LAUNCHER_ONLY "Build only the Launcher part" OFF) MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_PACO_PARALLEL SALOME_LAUNCHER_ONLY) @@ -94,6 +97,9 @@ ENDIF() IF(SALOME_USE_MPI) FIND_PACKAGE(SalomeMPI REQUIRED) ENDIF() +IF(SALOME_PACO_PARALLEL) + FIND_PACKAGE(SalomePaco REQUIRED) +ENDIF() IF(SALOME_BUILD_TESTS) ENABLE_TESTING() FIND_PACKAGE(SalomeCppUnit REQUIRED) diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt index 6165dcd1d..ece384e80 100755 --- a/doc/docutils/CMakeLists.txt +++ b/doc/docutils/CMakeLists.txt @@ -68,6 +68,11 @@ ELSE(WINDOWS) export PYTHONPATH=${DOCUTILS_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH} export PYTHONPATH=${SPHINX_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH}" ) + IF(SALOME_PACO_PARALLEL) + SET(SCR "${SCR} + export LD_LIBRARY_PATH=${PACO_ROOT_DIR}/lib:\${LD_LIBRARY_PATH} + export PYTHONPATH=${PACO_ROOT_DIR}/lib/${_pydir}:\${PYTHONPATH}") + ENDIF() SET(EXT "sh") SET(CALL_STR ".") ENDIF(WINDOWS) diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 2b8a793b0..3ca0b8e87 100755 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -80,16 +80,114 @@ TARGET_LINK_LIBRARIES(SalomeIDLKernel ${OMNIORB_LIBRARIES}) INSTALL(TARGETS SalomeIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) IF(SALOME_PACO_PARALLEL) - SET(SalomeParallelIDLKernel_IDLSOURCES - SALOME_ComponentPaCO.idl - SALOME_PortsPaCO.idl - DSC_EnginesPaCO.idl - SALOME_ParamPortsPaCO.idl - SALOME_PACOExtensionPaCO.idl - SALOME_GenericObjPaCO.idl + + SET(SalomeParallelIDLKernel_PACO_XML_FILES + SALOME_Component.xml + SALOME_Ports.xml + DSC_Engines.xml + SALOME_PACOExtension.xml + SALOME_ParamPorts.xml + SALOME_GenericObj.xml + ) + + SET(SalomeParallelIDLKernel_SALOME_Component_GEN_PACO_SOURCES + SALOME_ComponentPaCO_Engines_Container_server.cxx + SALOME_ComponentPaCO_Engines_Container_client.cxx + SALOME_ComponentPaCO_Engines_EngineComponent_server.cxx + SALOME_ComponentPaCO_Engines_EngineComponent_client.cxx + SALOME_ComponentPaCO_Engines_fileTransfer_server.cxx + SALOME_ComponentPaCO_Engines_fileTransfer_client.cxx + SALOME_ComponentPaCO_Engines_Salome_file_server.cxx + SALOME_ComponentPaCO_Engines_Salome_file_client.cxx + ) + + SET(SalomeParallelIDLKernel_SALOME_Ports_GEN_PACO_SOURCES + SALOME_PortsPaCO_Ports_Port_server.cxx + SALOME_PortsPaCO_Ports_Port_client.cxx + SALOME_PortsPaCO_Ports_Data_Port_server.cxx + SALOME_PortsPaCO_Ports_Data_Port_client.cxx + ) + + SET(SalomeParallelIDLKernel_DSC_Engines_GEN_PACO_SOURCES + DSC_EnginesPaCO_Engines_DSC_server.cxx + DSC_EnginesPaCO_Engines_DSC_client.cxx + DSC_EnginesPaCO_Engines_Superv_Component_server.cxx + DSC_EnginesPaCO_Engines_Superv_Component_client.cxx + ) + + SET(SalomeParallelIDLKernel_SALOME_PACOExtension_GEN_PACO_SOURCES + SALOME_PACOExtensionPaCO_Engines_Parallel_Component_server.cxx + SALOME_PACOExtensionPaCO_Engines_Parallel_Component_client.cxx + SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.cxx + SALOME_PACOExtensionPaCO_Engines_PACO_Container_client.cxx + SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_server.cxx + SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_client.cxx + SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.cxx + SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_client.cxx + ) + + SET(SalomeParallelIDLKernel_SALOME_ParamPorts_GEN_PACO_SOURCES + SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.cxx + SALOME_ParamPortsPaCO_Ports_Param_Double_Port_client.cxx + ) + + SET(SalomeParallelIDLKernel_SALOME_GenericObj_GEN_PACO_SOURCES + SALOME_GenericObjPaCO_SALOME_GenericObj_server.cxx + SALOME_GenericObjPaCO_SALOME_GenericObj_client.cxx + ) + + SET(SalomeParallelIDLKernel_PAR_SOURCES) + SET(SalomeParallelIDLKernel_GEN_PACO_SOURCES) + FOREACH(input ${SalomeParallelIDLKernel_PACO_XML_FILES}) + GET_FILENAME_COMPONENT(base ${input} NAME_WE) + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) + SET(baseidl ${CMAKE_CURRENT_SOURCE_DIR}/${base}.idl) + SET(basehdr ${CMAKE_CURRENT_BINARY_DIR}/${base}.hxx) + SET(genidl ${CMAKE_CURRENT_BINARY_DIR}/${base}PaCO.idl) + SET(parsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}PaCO.cxx) + SET(parhdr ${CMAKE_CURRENT_BINARY_DIR}/${base}PaCO.hxx) + SET(genpacosrc) + SET(genpacohdr) + FOREACH(genpacosrcname ${SalomeParallelIDLKernel_${base}_GEN_PACO_SOURCES}) + GET_FILENAME_COMPONENT(genpacobase ${genpacosrcname} NAME_WE) + LIST(APPEND genpacosrc ${CMAKE_CURRENT_BINARY_DIR}/${genpacosrcname}) + LIST(APPEND genpacohdr ${CMAKE_CURRENT_BINARY_DIR}/${genpacobase}.hxx) + ENDFOREACH(genpacosrcname ${SalomeParallelIDLKernel_${base}_GEN_PACO_SOURCES}) + LIST(APPEND SalomeParallelIDLKernel_PAR_SOURCES ${parsrc}) + LIST(APPEND SalomeParallelIDLKernel_GEN_PACO_SOURCES ${genpacosrc}) + ADD_CUSTOM_COMMAND(OUTPUT ${genidl} ${parsrc} ${parhdr} ${genpacosrc} ${genpacohdr} + COMMAND ${OMNIORB_IDL_COMPILER} -p${PACO_ROOT_DIR}/lib/python -bpaco -Wb${input},${CMAKE_CURRENT_SOURCE_DIR}:${PACO_ROOT_DIR}/idl ${baseidl} + DEPENDS ${input} ${baseidl}) + INSTALL(FILES ${input} ${genidl} DESTINATION idl/salome) + INSTALL(FILES ${basehdr} ${parhdr} ${genpacohdr} DESTINATION include/salome) + IF(OMNIORB_PYTHON_BACKEND) + SET(IDLPYFLAGS "-bpython -p${OMNIORB_PYTHON_BACKEND} -I${CMAKE_CURRENT_SOURCE_DIR} -I${PACO_ROOT_DIR}/idl") + INSTALL(CODE "OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL( \"${OMNIORB_IDL_COMPILER}\" \"${IDLPYFLAGS}\" \"${genidl}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_PYIDL_DIR}\" )") + ENDIF(OMNIORB_PYTHON_BACKEND) + ENDFOREACH(input ${SalomeParallelIDLKernel_PACO_XML_FILES}) + + SET(SalomeParallelIDLKernel_PAR_INCLUDES + SALOME_Exception.hxx + SALOME_GenericObj.hxx + SALOMEDS.hxx + SALOME_PyNode.hxx + ) + + FOREACH(output ${SalomeParallelIDLKernel_PAR_INCLUDES}) + GET_FILENAME_COMPONENT(base ${output} NAME_WE) + SET(baseidl ${CMAKE_CURRENT_SOURCE_DIR}/${base}.idl) + ADD_CUSTOM_COMMAND(OUTPUT ${output} + COMMAND ${OMNIORB_IDL_COMPILER} -bcxx -Wbh=.hxx -Wbs=.cxx ${baseidl} + DEPENDS ${baseidl}) + ENDFOREACH(output ${SalomeParallelIDLKernel_PAR_INCLUDES}) + ADD_CUSTOM_TARGET(BUILD_PAR_INCLUDES DEPENDS ${SalomeParallelIDLKernel_PAR_INCLUDES}) + + INCLUDE_DIRECTORIES(${PACO_INCLUDE_DIRS}) + ADD_LIBRARY(SalomeParallelIDLKernel + ${SalomeParallelIDLKernel_PAR_SOURCES} + ${SalomeParallelIDLKernel_GEN_PACO_SOURCES} ) - OMNIORB_ADD_MODULE(SalomeParallelIDLKernel "${SalomeIDLKernel_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" ${TYPE}) - TARGET_LINK_LIBRARIES(SalomeParallelIDLKernel ${OMNIORB_LIBRARIES}) + ADD_DEPENDENCIES(SalomeParallelIDLKernel BUILD_PAR_INCLUDES) INSTALL(TARGETS SalomeParallelIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) ENDIF() diff --git a/salome_adm/cmake_files/FindPaco.cmake b/salome_adm/cmake_files/FindPaco.cmake new file mode 100644 index 000000000..a1b287a89 --- /dev/null +++ b/salome_adm/cmake_files/FindPaco.cmake @@ -0,0 +1,58 @@ +# Copyright (C) 2007-2013 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 +# + +# ------ + +MESSAGE(STATUS "Check for Paco ...") + +# ------ + +SET(PACO_ROOT_DIR $ENV{PACO_ROOT_DIR} CACHE PATH "Path to Paco.") +IF(PACO_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${PACO_ROOT_DIR}") +ENDIF(PACO_ROOT_DIR) + +FIND_PATH(PACO_INCLUDE_DIRS PaCO++_InterfaceManager_impl.h) + +FIND_LIBRARY(PACO_LIBRARY_PaCO PaCO) +FIND_LIBRARY(PACO_LIBRARY_GaBro GaBro) +FIND_LIBRARY(PACO_LIBRARY_BasicBC BasicBC) +FIND_LIBRARY(PACO_LIBRARY_PaCO_dummy PaCO_dummy) +FIND_LIBRARY(PACO_LIBRARY_PaCO_mpi PaCO_mpi) +FIND_LIBRARY(PACO_LIBRARY_PaCO_omnithread PaCO_omnithread) + +FIND_PROGRAM(PACO_IDL PaCOIdlTool.sh) + +MARK_AS_ADVANCED(PACO_INCLUDE_DIRS PACO_LIBRARY_PaCO PACO_LIBRARY_GaBro + PACO_LIBRARY_BasicBC PACO_LIBRARY_PaCO_dummy + PACO_LIBRARY_PaCO_mpi PACO_LIBRARY_PaCO_omnithread PACO_IDL) + +SET(PACO_LIBRARIES + ${PACO_LIBRARY_PaCO} + ${PACO_LIBRARY_GaBro} + ${PACO_LIBRARY_BasicBC} + ${PACO_LIBRARY_PaCO_dummy} + ${PACO_LIBRARY_PaCO_mpi} + ${PACO_LIBRARY_PaCO_omnithread}) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Paco + REQUIRED_VARS PACO_INCLUDE_DIRS PACO_LIBRARY_PaCO PACO_LIBRARY_GaBro + PACO_LIBRARY_BasicBC PACO_LIBRARY_PaCO_dummy + PACO_LIBRARY_PaCO_mpi PACO_LIBRARY_PaCO_omnithread PACO_IDL) diff --git a/salome_adm/cmake_files/FindSalomePaco.cmake b/salome_adm/cmake_files/FindSalomePaco.cmake new file mode 100644 index 000000000..b47bf8ebf --- /dev/null +++ b/salome_adm/cmake_files/FindSalomePaco.cmake @@ -0,0 +1,27 @@ +# Copyright (C) 2013 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 +# +# Author: Renaud Barate +# + +# Paco detection for SALOME +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Paco PACO_INCLUDE_DIRS 1) +#MARK_AS_ADVANCED() diff --git a/src/Container/CMakeLists.txt b/src/Container/CMakeLists.txt index d046b1831..b11ecbbc4 100755 --- a/src/Container/CMakeLists.txt +++ b/src/Container/CMakeLists.txt @@ -68,11 +68,9 @@ IF(WITH_MPI_SEQ_CONTAINER) ENDIF(WITH_MPI_SEQ_CONTAINER) IF(SALOME_PACO_PARALLEL) - ADD_DEFINITIONS(-DWITH_PACO_PARALLEL ${PACO_DEFINITIONS}) - SET(COMMON_LIBS - ${COMMON_LIBS} - ${PACO_LIBS} - ) + INCLUDE_DIRECTORIES(${PACO_INCLUDE_DIRS}) + ADD_DEFINITIONS(-DWITH_PACO_PARALLEL) + LIST(APPEND COMMON_LIBS ${PACO_LIBRARIES}) ENDIF() SET(SalomeContainer_SOURCES diff --git a/src/DSC/ParallelDSC/CMakeLists.txt b/src/DSC/ParallelDSC/CMakeLists.txt index 14c62f33f..8e8469308 100755 --- a/src/DSC/ParallelDSC/CMakeLists.txt +++ b/src/DSC/ParallelDSC/CMakeLists.txt @@ -39,7 +39,6 @@ INCLUDE_DIRECTORIES( SET(COMMON_FLAGS ${OMNIORB_DEFINITIONS} ${MPI_CXX_COMPILE_FLAGS} - ${PACO_DEFINITIONS} ) SET(SalomeParallelDSCContainer_SOURCES ParallelDSC_i.cxx @@ -49,6 +48,7 @@ SET(SalomeParallelDSCContainer_SOURCES ADD_LIBRARY(SalomeParallelDSCContainer ${SalomeParallelDSCContainer_SOURCES}) SET_TARGET_PROPERTIES(SalomeParallelDSCContainer PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}") +ADD_DEPENDENCIES(SalomeParallelDSCContainer SalomeParallelIDLKernel) INSTALL(TARGETS SalomeParallelDSCContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/src/ParallelContainer/CMakeLists.txt b/src/ParallelContainer/CMakeLists.txt index 390d8d1a8..d614713ba 100755 --- a/src/ParallelContainer/CMakeLists.txt +++ b/src/ParallelContainer/CMakeLists.txt @@ -34,7 +34,6 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../HDFPersist ${PROJECT_BINARY_DIR}/idl ${PROJECT_SOURCE_DIR}/src/SALOMETraceCollector - ${PACOPATH}/lib ) # This local variable defines the list of dependant libraries common to all target in this package. @@ -47,7 +46,7 @@ SET(COMMON_LIBS SalomeParallelIDLKernel SalomeIDLKernel ${OMNIORB_LIBRARIES} - ${PACO_LIBS} + ${PACO_LIBRARIES} ${PYTHON_LIBRARIES} ) @@ -59,7 +58,7 @@ SET(SalomeParallelContainer_SOURCES SALOME_ParallelGlobalProcessVar_i.cxx ) -ADD_DEFINITIONS(${ONMIORB_DEFINITIONS} ${MPI_CXX_COMPILE_FLAGS} ${PACO_DEFINITIONS}) +ADD_DEFINITIONS(${ONMIORB_DEFINITIONS} ${MPI_CXX_COMPILE_FLAGS}) ADD_LIBRARY(SalomeParallelContainer ${SalomeParallelContainer_SOURCES}) TARGET_LINK_LIBRARIES(SalomeParallelContainer ${COMMON_LIBS} ${MPI_CXX_LIBRARIES}) @@ -68,9 +67,6 @@ INSTALL(TARGETS SalomeParallelContainer EXPORT ${PROJECT_NAME}TargetGroup DESTIN IF(SALOME_USE_MPI) SET(SALOME_ParallelContainerProxyMpi_LIBS SalomeParallelContainer - ${PaCO_dummy} - ${PaCO_mpi} - ${PaCO_omnithread} ${MPI_CXX_LIBRARIES} ${COMMON_LIBS} ) @@ -87,8 +83,6 @@ ENDIF(SALOME_USE_MPI) SET(SALOME_ParallelContainerProxyDummy_LIBS SalomeParallelContainer - ${PaCO_dummy} - ${PaCO_omnithread} ${COMMON_LIBS} )