From c8dc401a83f86ecc28681bda2f540528f64cc79a Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 8 Jul 2013 15:11:06 +0000 Subject: [PATCH] Enable Partitioner --- CMakeLists.txt | 12 ++++-- src/CMakeLists.txt | 3 ++ src/MEDPartitioner/CMakeLists.txt | 51 ++++++++++++++++---------- src/MEDPartitioner/Test/CMakeLists.txt | 31 +--------------- 4 files changed, 46 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd1b65d7c..959fc7ca5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,6 @@ #INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARMETIS.cmake) #INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindMETIS.cmake) #INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSCOTCH.cmake) -#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSPLITTER.cmake) -#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindRENUMBER.cmake) #IF(WIN32) # INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake) #ENDIF(WIN32) @@ -51,14 +49,19 @@ SET(VERSION_DEV "0") # # User options # ============ +INCLUDE(CMakeDependentOption) OPTION(SALOME_MED_STANDALONE "Build MED without CORBA bindings. When OFF, exchange to PARAVIS is disabled." OFF) OPTION(SALOME_MED_MICROMED "Build MED without MED file dependancy." OFF) OPTION(SALOME_MED_ENABLE_PYTHON "Build PYTHON bindings." ON) +OPTION(SALOME_MED_ENABLE_PARTITIONER "Build MEDPartitioner." ON) OPTION(SALOME_USE_MPI "To build ParaMEDMEM." OFF) OPTION(SALOME_BUILD_GUI "Build GUI of MED." ON) OPTION(SALOME_BUILD_TESTS "Build MED tests." ON) OPTION(SALOME_BUILD_DOC "Build MED doc." ON) - +CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF) +CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF) +CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF) +# # # Set list of prerequisites # ========================= @@ -82,6 +85,9 @@ ENDIF(NOT SALOME_MED_STANDALONE) IF(NOT SALOME_MED_MICROMED) FIND_PACKAGE(SalomeHDF5 REQUIRED) FIND_PACKAGE(SalomeMEDFile REQUIRED) + IF(SALOME_MED_ENABLE_PARTITIONER) + FIND_PACKAGE(SalomeLibXml2 REQUIRED) + ENDIF(SALOME_MED_ENABLE_PARTITIONER) ENDIF(NOT SALOME_MED_MICROMED) IF(SALOME_BUILD_GUI) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c85e3a3b9..834518d3f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,6 +28,9 @@ ENDIF(SALOME_MED_ENABLE_PYTHON) IF(NOT SALOME_MED_MICROMED) ADD_SUBDIRECTORY(MEDLoader) ADD_SUBDIRECTORY(RENUMBER) + IF(SALOME_MED_ENABLE_PARTITIONER) + ADD_SUBDIRECTORY(MEDPartitioner) + ENDIF(SALOME_MED_ENABLE_PARTITIONER) IF(SALOME_BUILD_TESTS) ADD_SUBDIRECTORY(INTERP_KERNELTest) ENDIF(SALOME_BUILD_TESTS) diff --git a/src/MEDPartitioner/CMakeLists.txt b/src/MEDPartitioner/CMakeLists.txt index d70a5dcd6..19461e290 100644 --- a/src/MEDPartitioner/CMakeLists.txt +++ b/src/MEDPartitioner/CMakeLists.txt @@ -17,21 +17,12 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML_DEFINITIONS} ${MPI_DEFINITIONS}) - -IF(SALOME_BUILD_TESTS) - ADD_SUBDIRECTORY(Test) -ENDIF(SALOME_BUILD_TESTS) +ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML2_DEFINITIONS}) INCLUDE_DIRECTORIES( - ${PARMETIS_INCLUDE_DIRS} - ${METIS_INCLUDE_DIRS} - ${SCOTCH_INCLUDE_DIRS} - ${METIS_INCLUDE_DIRS} - ${LIBXML_INCLUDE_DIRS} + ${LIBXML2_INCLUDE_DIR} ${MEDFILE_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} - ${MPI_INCLUDE_DIRS} ${PTHREADS_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling @@ -42,6 +33,31 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints ) +IF(MED_ENABLE_SCOTCH) + ADD_DEFINITIONS(${SCOTCH_DEFINITIONS}) + INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS}) +ENDIF(MED_ENABLE_SCOTCH) + +IF(MED_ENABLE_METIS) + ADD_DEFINITIONS(${METIS_DEFINITIONS}) + INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS}) +ENDIF(MED_ENABLE_METIS) + +IF(MED_ENABLE_PARMETIS) + ADD_DEFINITIONS(${METIS_DEFINITIONS}) + INCLUDE_DIRECTORIES(${PARMETIS_INCLUDE_DIRS}) +ENDIF(MED_ENABLE_PARMETIS) + +IF(SALOME_USE_MPI) + ADD_DEFINITIONS(${MPI_DEFINITIONS}) + ADD_DEFINITIONS("-DHAVE_MPI2") + INCLUDE_DIRECTORIES(${MPI_INCLUDE_DIRS}) +ENDIF(SALOME_USE_MPI) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF(SALOME_BUILD_TESTS) + SET(medpartitionercpp_HEADERS_HXX MEDPARTITIONER_MeshCollection.hxx MEDPARTITIONER_MeshCollectionDriver.hxx @@ -78,7 +94,7 @@ SET(medpartitionercpp_LDFLAGS ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${STDLIB} - ${LIBXML_LIBRARIES} + ${LIBXML2_LIBRARIES} ${MPI_LIBRARIES} interpkernel medcoupling @@ -108,19 +124,16 @@ IF(SALOME_USE_MPI) MEDPARTITIONER_UtilsPara.cxx MEDPARTITIONER_JointFinder.cxx ) +ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx) + SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}") + TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp ${medpartitionercpp_LDFLAGS}) + INSTALL(TARGETS medpartitioner_para DESTINATION ${SALOME_INSTALL_BINS}) ENDIF(SALOME_USE_MPI) ADD_LIBRARY(medpartitionercpp SHARED ${medpartitionercpp_SOURCES}) SET_TARGET_PROPERTIES(medpartitionercpp PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}") TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS} ${PLATFORM_LIBS} ${PTHREAD_LIBS}) INSTALL(TARGETS medpartitionercpp DESTINATION ${SALOME_INSTALL_LIBS}) - -IF(MED_ENABLE_PARMETIS) - ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx) - SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}") - TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp ${medpartitionercpp_LDFLAGS}) - INSTALL(TARGETS medpartitioner_para DESTINATION ${SALOME_INSTALL_BINS}) -ENDIF(MED_ENABLE_PARMETIS) ADD_EXECUTABLE(medpartitioner medpartitioner.cxx) SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}") diff --git a/src/MEDPartitioner/Test/CMakeLists.txt b/src/MEDPartitioner/Test/CMakeLists.txt index b443a826c..b7ed8a65a 100644 --- a/src/MEDPartitioner/Test/CMakeLists.txt +++ b/src/MEDPartitioner/Test/CMakeLists.txt @@ -20,23 +20,8 @@ ADD_DEFINITIONS(${BOOST_DEFINITIONS} ${CPPUNIT_DEFINITIONS}) INCLUDE_DIRECTORIES( - ${PARMETIS_INCLUDE_DIRS} - ${METIS_INCLUDE_DIRS} - ${SCOTCH_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS} - ${METIS_INCLUDE_DIRS} - ${LIBXML_INCLUDE_DIRS} - ${MEDFILE_INCLUDE_DIRS} - ${HDF5_INCLUDE_DIRS} - ${MPI_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader - ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Geometric2D - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/ExprEval - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/GaussPoints ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNELTest # for BasicMainTest.hxx ) @@ -48,31 +33,19 @@ SET(MEDPARTITIONERTest_SOURCES MEDPARTITIONERTest.cxx ) -SET(MEDPARTITIONERTest_DEFINITIONS "") SET(MEDPARTITIONERTest_LDFLAGS medpartitionercpp ${CPPUNIT_LIBRARIES}) -IF(MED_ENABLE_SCOTCH) - SET(MEDPARTITIONERTest_DEFINITIONS "${MEDPARTITIONERTest_DEFINITIONS} ${SCOTCH_DEFINITIONS}") -ENDIF(MED_ENABLE_SCOTCH) - -IF(MPI_IS_OK) +IF(SALOME_USE_MPI) IF(MED_ENABLE_PARMETIS) SET(MEDPARTITIONERTest_SOURCES ${MEDPARTITIONERTest_SOURCES} MEDPARTITIONERTestPara.cxx) - SET(MEDPARTITIONERTest_DEFINITIONS "${MEDPARTITIONERTest_DEFINITIONS} ${MPI_DEFINITIONS} ${PARMETIS_DEFINITIONS}") ENDIF(MED_ENABLE_PARMETIS) -ENDIF(MPI_IS_OK) - -IF(MED_ENABLE_METIS) - SET(MEDPARTITIONERTest_DEFINITIONS "${MEDPARTITIONERTest_DEFINITIONS} ${METIS_DEFINITIONS}") -ENDIF(MED_ENABLE_METIS) +ENDIF(SALOME_USE_MPI) ADD_LIBRARY(MEDPARTITIONERTest SHARED ${MEDPARTITIONERTest_SOURCES}) -SET_TARGET_PROPERTIES(MEDPARTITIONERTest PROPERTIES COMPILE_FLAGS "${MEDPARTITIONERTest_DEFINITIONS}") TARGET_LINK_LIBRARIES(MEDPARTITIONERTest ${MEDPARTITIONERTest_LDFLAGS}) INSTALL(TARGETS MEDPARTITIONERTest DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(TestMEDPARTITIONER TestMEDPARTITIONER.cxx) -SET_TARGET_PROPERTIES(TestMEDPARTITIONER PROPERTIES COMPILE_FLAGS "${MEDPARTITIONERTest_DEFINITIONS}") TARGET_LINK_LIBRARIES(TestMEDPARTITIONER MEDPARTITIONERTest) INSTALL(TARGETS TestMEDPARTITIONER DESTINATION ${SALOME_INSTALL_BINS}) -- 2.39.2