diff --git a/.gitignore b/.gitignore index 9fdd0cfe..46f89c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .DS_Store build playground -dependencies .vscode dump *.msh diff --git a/dependencies/FindMETIS.cmake b/dependencies/FindMETIS.cmake new file mode 100644 index 00000000..dfae35a3 --- /dev/null +++ b/dependencies/FindMETIS.cmake @@ -0,0 +1,79 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindMETIS +------- +Michael Hirsch, Ph.D. + +Finds the METIS library. +NOTE: If libparmetis used, libmetis must also be linked. + +Imported Targets +^^^^^^^^^^^^^^^^ + +METIS::METIS + +Result Variables +^^^^^^^^^^^^^^^^ + +METIS_LIBRARIES + libraries to be linked + +METIS_INCLUDE_DIRS + dirs to be included + +#]=======================================================================] + + +if("parallel" IN_LIST METIS_FIND_COMPONENTS) + find_library(PARMETIS_LIBRARY + NAMES parmetis + PATH_SUFFIXES METIS libmetis + DOC "ParMETIS library" + ) + if(PARMETIS_LIBRARY) + set(METIS_parallel_FOUND true) + endif() +endif() + +find_library(METIS_LIBRARY + NAMES metis + PATH_SUFFIXES METIS libmetis + DOC "METIS library" + ) + +if(parallel IN_LIST METIS_FIND_COMPONENTS) + set(metis_inc parmetis.h) +else() + set(metis_inc metis.h) +endif() + +find_path(METIS_INCLUDE_DIR +NAMES ${metis_inc} +PATH_SUFFIXES METIS openmpi-x86_64 mpich-x86_64 +DOC "METIS include directory" +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(METIS +REQUIRED_VARS METIS_LIBRARY METIS_INCLUDE_DIR +HANDLE_COMPONENTS +) + +if(METIS_FOUND) + +set(METIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY}) +set(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR}) + +message(VERBOSE "METIS libraries: ${METIS_LIBRARIES} +METIS include directories: ${METIS_INCLUDE_DIRS}") + +if(NOT TARGET METIS::METIS) + add_library(METIS::METIS INTERFACE IMPORTED) + set_property(TARGET METIS::METIS PROPERTY INTERFACE_LINK_LIBRARIES "${METIS_LIBRARIES}") + set_property(TARGET METIS::METIS PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${METIS_INCLUDE_DIR}") +endif() +endif(METIS_FOUND) + +mark_as_advanced(METIS_INCLUDE_DIR METIS_LIBRARY PARMETIS_LIBRARY) diff --git a/docker/Dockerfile b/docker/Dockerfile index 045bfa1e..54872169 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,8 +13,10 @@ WORKDIR $LIB_DIR RUN sudo git clone https://github.com/scivision/mumps.git WORKDIR ./mumps RUN sudo git checkout v5.6.2.1 +RUN sudo wget -O cmake/FindMETIS.cmake https://github.com/LLNL/scaleupROM/raw/install/dependencies/FindMETIS.cmake +# RUN sudo sed -i 's/if(parallel IN_LIST METIS_FIND_COMPONENTS)/if("parallel" IN_LIST METIS_FIND_COMPONENTS)/g' cmake/FindMETIS.cmake + # RUN sudo sed -i 's/option(CMAKE_TLS_VERIFY "Verify TLS certificates" ON)/option(CMAKE_TLS_VERIFY "Verify TLS certificates" OFF)/g' options.cmake -RUN sudo sed -i 's/if(parallel IN_LIST METIS_FIND_COMPONENTS)/if("parallel" IN_LIST METIS_FIND_COMPONENTS)/g' cmake/FindMETIS.cmake # # RUN sudo sed -i 's/TLS_VERIFY true/TLS_VERIFY false/g' cmake/mumps_src.cmake # RUN sudo sed -i '/NAMES parmetis/a PATHS "$ENV{PARMETIS_DIR}/lib"' cmake/FindMETIS.cmake # RUN sudo sed -i '/NAMES metis/a PATHS "$ENV{METIS_DIR}/lib"' cmake/FindMETIS.cmake