X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FCMakeLists.txt;h=33aa64a83e22261eb66683d83139d39cd8fd2bdd;hb=4c22ba01f2901896d1ec9ca302640f4d7e50d147;hp=2cbd32485a1d5d6495ea5299025c33c4bf222402;hpb=853b5bf36bc92070f6ccca25e8d0cdefcb0a5beb;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/CMakeLists.txt b/src/MEDPartitioner/CMakeLists.txt index 2cbd32485..33aa64a83 100644 --- a/src/MEDPartitioner/CMakeLists.txt +++ b/src/MEDPartitioner/CMakeLists.txt @@ -1,9 +1,9 @@ -# Copyright (C) 2012-2013 CEA/DEN, EDF R&D +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D # # 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. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,11 +19,15 @@ ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML2_DEFINITIONS}) +IF (NOT DEFINED MSVC) + ADD_DEFINITIONS(-Wsign-compare -Wconversion) +ENDIF() + INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR} ${MEDFILE_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} - ${PTHREADS_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL @@ -33,31 +37,42 @@ 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(SALOME_MED_PARTITIONER_METIS) +IF(MEDCOUPLING_PARTITIONER_METIS) ADD_DEFINITIONS(${METIS_DEFINITIONS}) - ADD_DEFINITIONS("-DMED_ENABLE_METIS") + IF(MEDCOUPLING_METIS_V5) + ADD_DEFINITIONS("-DMED_ENABLE_METIS_V5") + ENDIF(MEDCOUPLING_METIS_V5) INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS}) -ENDIF(SALOME_MED_PARTITIONER_METIS) +ENDIF(MEDCOUPLING_PARTITIONER_METIS) + + +######## +# VERY IMPORTANT PUT METIS BEFORE SCOTCH because +# metis.h is also in SCOTCH install dir !!! +######## +IF(MEDCOUPLING_PARTITIONER_PTSCOTCH) + ADD_DEFINITIONS(${PTSCOTCH_DEFINITIONS}) + INCLUDE_DIRECTORIES(${PTSCOTCH_INCLUDE_DIRS}) +ENDIF(MEDCOUPLING_PARTITIONER_PTSCOTCH) -IF(MED_ENABLE_PARMETIS) +IF(MEDCOUPLING_PARTITIONER_SCOTCH) + ADD_DEFINITIONS(${SCOTCH_DEFINITIONS}) + INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS}) +ENDIF(MEDCOUPLING_PARTITIONER_SCOTCH) + +IF(MEDCOUPLING_PARTITIONER_PARMETIS) ADD_DEFINITIONS(${PARMETIS_DEFINITIONS}) INCLUDE_DIRECTORIES(${PARMETIS_INCLUDE_DIRS}) -ENDIF(MED_ENABLE_PARMETIS) +ENDIF(MEDCOUPLING_PARTITIONER_PARMETIS) -IF(SALOME_USE_MPI) +IF(MEDCOUPLING_USE_MPI) ADD_DEFINITIONS(${MPI_DEFINITIONS}) - ADD_DEFINITIONS("-DHAVE_MPI2") INCLUDE_DIRECTORIES(${MPI_INCLUDE_DIRS}) -ENDIF(SALOME_USE_MPI) +ENDIF(MEDCOUPLING_USE_MPI) -IF(SALOME_BUILD_TESTS) +IF(MEDCOUPLING_BUILD_TESTS) ADD_SUBDIRECTORY(Test) -ENDIF(SALOME_BUILD_TESTS) +ENDIF(MEDCOUPLING_BUILD_TESTS) SET(medpartitionercpp_HEADERS_HXX MEDPARTITIONER_MeshCollection.hxx @@ -72,8 +87,8 @@ SET(medpartitionercpp_HEADERS_HXX MEDPARTITIONER.hxx MEDPARTITIONER_ParaDomainSelector.hxx MEDPARTITIONER_ConnectZone.hxx - MEDPARTITIONER_SkyLineArray.hxx MEDPARTITIONER_Topology.hxx + MEDPARTITIONER_MEDPartitioner.hxx ) SET(medpartitionercpp_SOURCES @@ -87,8 +102,8 @@ SET(medpartitionercpp_SOURCES MEDPARTITIONER_Utils.cxx MEDPARTITIONER_ParaDomainSelector.cxx MEDPARTITIONER_ConnectZone.cxx - MEDPARTITIONER_SkyLineArray.cxx MEDPARTITIONER_metis.c + MEDPARTITIONER_MEDPartitioner.cxx ) SET(medpartitionercpp_LDFLAGS @@ -96,49 +111,53 @@ SET(medpartitionercpp_LDFLAGS ${HDF5_LIBRARIES} ${STDLIB} ${LIBXML2_LIBRARIES} - ${MPI_LIBRARIES} interpkernel - medcoupling + medcouplingcpp medloader + -lpthread ) -IF(MED_ENABLE_PARMETIS) +IF(MEDCOUPLING_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) -IF(SALOME_MED_PARTITIONER_METIS) + SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBRARIES}) +ENDIF(MEDCOUPLING_PARTITIONER_PARMETIS) +IF(MEDCOUPLING_PARTITIONER_METIS) SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx) SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx) SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${METIS_DEFINITIONS}") SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBRARIES}) -ENDIF(SALOME_MED_PARTITIONER_METIS) -IF(MED_ENABLE_SCOTCH) +ENDIF(MEDCOUPLING_PARTITIONER_METIS) +IF(MEDCOUPLING_PARTITIONER_SCOTCH) SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ScotchGraph.hxx) SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ScotchGraph.cxx) SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${SCOTCH_DEFINITIONS}") - SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${SCOTCH_LIBS}) -ENDIF(MED_ENABLE_SCOTCH) + SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${SCOTCH_LIBRARIES}) +ENDIF(MEDCOUPLING_PARTITIONER_SCOTCH) +IF(MEDCOUPLING_PARTITIONER_PTSCOTCH) + SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_PTScotchGraph.hxx) + SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_PTScotchGraph.cxx) + SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${PTSCOTCH_DEFINITIONS}") + SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PTSCOTCH_LIBRARIES}) +ENDIF(MEDCOUPLING_PARTITIONER_PTSCOTCH) -IF(SALOME_USE_MPI) - SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} - MEDPARTITIONER_UtilsPara.cxx - MEDPARTITIONER_JointFinder.cxx - ) -ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx) +IF(${MEDCOUPLING_USE_MPI}) + SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_UtilsPara.cxx MEDPARTITIONER_JointFinder.cxx) + ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx) + SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${MPI_LIBRARIES}) 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}") + INSTALL(TARGETS medpartitioner_para DESTINATION ${MEDCOUPLING_INSTALL_BINS}) +ENDIF(${MEDCOUPLING_USE_MPI}) + +ADD_DEFINITIONS(${medpartitionercpp_DEFINITIONS}) + +ADD_LIBRARY(medpartitionercpp ${medpartitionercpp_SOURCES}) TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS} ${PLATFORM_LIBS} ${PTHREAD_LIBS}) -INSTALL(TARGETS medpartitionercpp DESTINATION ${SALOME_INSTALL_LIBS}) +INSTALL(TARGETS medpartitionercpp DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) ADD_EXECUTABLE(medpartitioner medpartitioner.cxx) -SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}") TARGET_LINK_LIBRARIES(medpartitioner medpartitionercpp ${medpartitionercpp_LDFLAGS}) -INSTALL(TARGETS medpartitioner DESTINATION ${SALOME_INSTALL_BINS}) +INSTALL(TARGETS medpartitioner DESTINATION ${MEDCOUPLING_INSTALL_BINS}) -INSTALL(FILES ${medpartitionercpp_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${medpartitionercpp_HEADERS_HXX} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})