From bc1c11968c5f3d3e61064a34d3ec6f519c21d2e9 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 9 Jul 2013 12:37:50 +0000 Subject: [PATCH] Addition of SCOTCH in MEDPartitioner. --- CMakeLists.txt | 3 ++ adm_local/cmake_files/CMakeLists.txt | 6 +-- adm_local/cmake_files/FindMED.cmake | 44 ------------------ ...{FindRENUMBER.cmake => FindParMetis.cmake} | 33 +++++--------- adm_local/cmake_files/FindSPLITTER.cmake | 45 ------------------- .../cmake_files/FindSalomeParMetis.cmake | 28 ++++++++++++ src/MEDPartitioner/CMakeLists.txt | 14 +++--- src/MEDPartitioner/MEDPARTITIONER_metis.c | 2 +- src/MEDPartitioner/Test/CMakeLists.txt | 4 +- 9 files changed, 56 insertions(+), 123 deletions(-) delete mode 100644 adm_local/cmake_files/FindMED.cmake rename adm_local/cmake_files/{FindRENUMBER.cmake => FindParMetis.cmake} (53%) delete mode 100644 adm_local/cmake_files/FindSPLITTER.cmake create mode 100644 adm_local/cmake_files/FindSalomeParMetis.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 52524ead8..8bd649d63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,9 @@ ENDIF(SALOME_BUILD_TESTS) IF(SALOME_USE_MPI) FIND_PACKAGE(SalomeMPI REQUIRED) + IF(SALOME_MED_PARTITIONER_PARMETIS) + FIND_PACKAGE(SalomeParMetis REQUIRED) + ENDIF(SALOME_MED_PARTITIONER_PARMETIS) ENDIF(SALOME_USE_MPI) IF(SALOME_BUILD_DOC) diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt index 9b0f47f19..1a69921e0 100644 --- a/adm_local/cmake_files/CMakeLists.txt +++ b/adm_local/cmake_files/CMakeLists.txt @@ -18,15 +18,13 @@ # SET(admlocal_cmake_DATA - FindMED.cmake FindXDR.cmake FindMetis.cmake FindSalomeMetis.cmake - FindPARMETIS.cmake - FindRENUMBER.cmake + FindParMetis.cmake + FindSalomeParMetis.cmake FindScotch.cmake FindSalomeScotch.cmake - FindSPLITTER.cmake ) INSTALL(FILES ${admlocal_cmake_DATA} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL}) diff --git a/adm_local/cmake_files/FindMED.cmake b/adm_local/cmake_files/FindMED.cmake deleted file mode 100644 index cca55f724..000000000 --- a/adm_local/cmake_files/FindMED.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# 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 -# - -SET(MED_CXXFLAGS -I${MED_ROOT_DIR}/include/salome) - -FIND_LIBRARY(interpkernel interpkernel ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(InterpKernelTest InterpKernelTest ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MEDClientcmodule MEDClientcmodule ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medcouplingclient medcouplingclient ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medcouplingcorba medcouplingcorba ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medcouplingremapper medcouplingremapper ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medcoupling medcoupling ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MEDEngine MEDEngine ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medloader medloader ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MEDMEMCppTest MEDMEMCppTest ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MEDMEMImpl MEDMEMImpl ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medmem medmem ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MED MED ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(medsplitter medsplitter ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MEDSPLITTERTest MEDSPLITTERTest ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(med_V2_1 med_V2_1 ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(paramedcouplingcorba paramedcouplingcorba ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(paramedloader paramedloader ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(paramedmemcompo paramedmemcompo ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(paramedmem paramedmem ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(ParaMEDMEMTest ParaMEDMEMTest ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(SalomeIDLMED SalomeIDLMED ${MED_ROOT_DIR}/lib/salome) -FIND_LIBRARY(SalomeIDLMEDTests SalomeIDLMEDTests ${MED_ROOT_DIR}/lib/salome) diff --git a/adm_local/cmake_files/FindRENUMBER.cmake b/adm_local/cmake_files/FindParMetis.cmake similarity index 53% rename from adm_local/cmake_files/FindRENUMBER.cmake rename to adm_local/cmake_files/FindParMetis.cmake index 09a4202ca..1ed7ad1d4 100644 --- a/adm_local/cmake_files/FindRENUMBER.cmake +++ b/adm_local/cmake_files/FindParMetis.cmake @@ -19,27 +19,18 @@ # ------ -MESSAGE(STATUS "Check for renumber activation ...") +MESSAGE(STATUS "Check for parmetis ...") -# ------ - -IF(RENUMBER_IS_MANDATORY STREQUAL 0) - SET(RENUMBER_IS_MANDATORY 0) - SET(RENUMBER_IS_OPTIONAL 1) -ENDIF(RENUMBER_IS_MANDATORY STREQUAL 0) -IF(RENUMBER_IS_OPTIONAL STREQUAL 0) - SET(RENUMBER_IS_MANDATORY 1) - SET(RENUMBER_IS_OPTIONAL 0) -ENDIF(RENUMBER_IS_OPTIONAL STREQUAL 0) -IF(NOT RENUMBER_IS_MANDATORY AND NOT RENUMBER_IS_OPTIONAL) - SET(RENUMBER_IS_MANDATORY 0) - SET(RENUMBER_IS_OPTIONAL 1) -ENDIF(NOT RENUMBER_IS_MANDATORY AND NOT RENUMBER_IS_OPTIONAL) +SET(PARMETIS_ROOT_DIR $ENV{PARMETIS_ROOT_DIR} CACHE PATH "Path to the PARMETIS.") +IF(PARMETIS_ROOT_DIR) + LIST(APPEND CMAKE_LIBRARY_PATH "${PARMETIS_ROOT_DIR}") + LIST(APPEND CMAKE_INCLUDE_PATH "${PARMETIS_ROOT_DIR}/Lib") +ENDIF(PARMETIS_ROOT_DIR) -# ------ +FIND_LIBRARY(PARMETIS_LIBRARIES parmetis) +FIND_LIBRARY(PARMETIS_SEQ_LIBRARIES metis) +SET(PARMETIS_LIBRARIES ${PARMETIS_LIBRARIES} ${PARMETIS_SEQ_LIBRARIES}) +FIND_PATH(PARMETIS_INCLUDE_DIRS parmetis.h) -SET(MED_ENABLE_RENUMBER 1) -IF(WITHOUT_RENUMBER OR WITH_RENUMBER STREQUAL 0) - SET(MED_ENABLE_RENUMBER 0) - MESSAGE(STATUS "renumber disabled from command line.") -ENDIF(WITHOUT_RENUMBER OR WITH_RENUMBER STREQUAL 0) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ParMetis REQUIRED_VARS PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES) diff --git a/adm_local/cmake_files/FindSPLITTER.cmake b/adm_local/cmake_files/FindSPLITTER.cmake deleted file mode 100644 index 4f9fadc55..000000000 --- a/adm_local/cmake_files/FindSPLITTER.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# 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 splitters activation ...") - -# ------ - -IF(SPLITTER_IS_MANDATORY STREQUAL 0) - SET(SPLITTER_IS_MANDATORY 0) - SET(SPLITTER_IS_OPTIONAL 1) -ENDIF(SPLITTER_IS_MANDATORY STREQUAL 0) -IF(SPLITTER_IS_OPTIONAL STREQUAL 0) - SET(SPLITTER_IS_MANDATORY 1) - SET(SPLITTER_IS_OPTIONAL 0) -ENDIF(SPLITTER_IS_OPTIONAL STREQUAL 0) -IF(NOT SPLITTER_IS_MANDATORY AND NOT SPLITTER_IS_OPTIONAL) - SET(SPLITTER_IS_MANDATORY 0) - SET(SPLITTER_IS_OPTIONAL 1) -ENDIF(NOT SPLITTER_IS_MANDATORY AND NOT SPLITTER_IS_OPTIONAL) - -# ------ - -SET(MED_ENABLE_SPLITTER 1) -IF(WITHOUT_SPLITTER OR WITH_SPLITTER STREQUAL 0) - SET(MED_ENABLE_SPLITTER 0) - MESSAGE(STATUS "splitter disabled from command line.") -ENDIF(WITHOUT_SPLITTER OR WITH_SPLITTER STREQUAL 0) diff --git a/adm_local/cmake_files/FindSalomeParMetis.cmake b/adm_local/cmake_files/FindSalomeParMetis.cmake new file mode 100644 index 000000000..f6e9d2cff --- /dev/null +++ b/adm_local/cmake_files/FindSalomeParMetis.cmake @@ -0,0 +1,28 @@ +# 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: Adrien Bruneton +# + +# Medfile detection dor Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParMetis METIS_ROOT_DIR_EXP 0) +#MARK_AS_ADVANCED() diff --git a/src/MEDPartitioner/CMakeLists.txt b/src/MEDPartitioner/CMakeLists.txt index 0e13e49f1..4cc5bf5dc 100644 --- a/src/MEDPartitioner/CMakeLists.txt +++ b/src/MEDPartitioner/CMakeLists.txt @@ -45,10 +45,12 @@ IF(SALOME_MED_PARTITIONER_METIS) INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS}) ENDIF(SALOME_MED_PARTITIONER_METIS) -IF(MED_ENABLE_PARMETIS) +IF(SALOME_MED_PARTITIONER_PARMETIS) ADD_DEFINITIONS(${PARMETIS_DEFINITIONS}) + ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS") + ADD_DEFINITIONS("-DMED_ENABLE_METIS") INCLUDE_DIRECTORIES(${PARMETIS_INCLUDE_DIRS}) -ENDIF(MED_ENABLE_PARMETIS) +ENDIF(SALOME_MED_PARTITIONER_PARMETIS) IF(SALOME_USE_MPI) ADD_DEFINITIONS(${MPI_DEFINITIONS}) @@ -101,12 +103,12 @@ SET(medpartitionercpp_LDFLAGS medcoupling medloader ) -IF(MED_ENABLE_PARMETIS) +IF(SALOME_MED_PARTITIONER_PARMETIS) SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ParMetisGraph.hxx) - SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx) + SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx MEDPARTITIONER_MetisGraph.cxx) SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${PARMETIS_DEFINITIONS}") - SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBS}) -ENDIF(MED_ENABLE_PARMETIS) + SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBRARIES}) +ENDIF(SALOME_MED_PARTITIONER_PARMETIS) IF(SALOME_MED_PARTITIONER_METIS) SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx) SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx) diff --git a/src/MEDPartitioner/MEDPARTITIONER_metis.c b/src/MEDPartitioner/MEDPARTITIONER_metis.c index 98ef41eee..86dc83a49 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_metis.c +++ b/src/MEDPartitioner/MEDPARTITIONER_metis.c @@ -26,7 +26,7 @@ #include "MEDPARTITIONER_metis.h" -#if defined(MED_ENABLE_METIS) +#if defined(MED_ENABLE_METIS) & !defined(MED_ENABLE_PARMETIS) #include "defs.h" #include "struct.h" #include "metis.h" diff --git a/src/MEDPartitioner/Test/CMakeLists.txt b/src/MEDPartitioner/Test/CMakeLists.txt index b7ed8a65a..f981249c8 100644 --- a/src/MEDPartitioner/Test/CMakeLists.txt +++ b/src/MEDPartitioner/Test/CMakeLists.txt @@ -36,9 +36,9 @@ SET(MEDPARTITIONERTest_SOURCES SET(MEDPARTITIONERTest_LDFLAGS medpartitionercpp ${CPPUNIT_LIBRARIES}) IF(SALOME_USE_MPI) - IF(MED_ENABLE_PARMETIS) + IF(SALOME_MED_PARTITIONER_PARMETIS) SET(MEDPARTITIONERTest_SOURCES ${MEDPARTITIONERTest_SOURCES} MEDPARTITIONERTestPara.cxx) - ENDIF(MED_ENABLE_PARMETIS) + ENDIF(SALOME_MED_PARTITIONER_PARMETIS) ENDIF(SALOME_USE_MPI) ADD_LIBRARY(MEDPARTITIONERTest SHARED ${MEDPARTITIONERTest_SOURCES}) -- 2.39.2