Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/metis-5.1.0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8)
project(METIS)
cmake_minimum_required(VERSION 3.2)
project(METIS VERSION 5.1.0)

#set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
#set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/lib/metis-5.1.0/GKlib" CACHE PATH "path to GKlib")
Expand All @@ -26,4 +26,4 @@ include_directories(include)
# Recursively look for CMakeLists.txt in subdirs.
add_subdirectory("include")
add_subdirectory("libmetis")
add_subdirectory("programs")
add_subdirectory("programs")
13 changes: 9 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.25)

project(fesom LANGUAGES C CXX Fortran VERSION 2.0.0)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake ${CMAKE_MODULE_PATH})
Expand Down Expand Up @@ -88,7 +88,7 @@ option(USE_ICEPACK "Use ICEPACK" OFF)
message(STATUS "USE_ICEPACK: ${USE_ICEPACK}")


option(BUILD_MESHPARTITIONER "build mesh partitioner" ON)
option(BUILD_MESHPARTITIONER "build mesh partitioner" OFF)
message(STATUS "BUILD_MESHPARTITIONER: ${BUILD_MESHPARTITIONER}")


Expand Down Expand Up @@ -447,10 +447,14 @@ message(STATUS " --> Final Compile options for ${PROJECT_NAME}: ${FLAGS}")




set(additional_targets)
# mesh partitioner

if(BUILD_MESHPARTITIONER)
if(NOT (${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL IntelLLVM))
message(WARNING "Mesh partitioner is only supported for GNU and Intel compilers. Please use -DBUILD_MESHPARTITIONER=OFF when configuring with ${CMAKE_Fortran_COMPILER_ID} compiler.")
endif()
message(STATUS "Building mesh partitioner...")
block()
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/module/fesom_meshpart)
set(fesom_meshpart_sources_Fortran ${src_home}/MOD_MESH.F90 ${src_home}/oce_modules.F90 ${src_home}/gen_modules_config.F90 ${src_home}/gen_modules_partitioning.F90 ${src_home}/gen_modules_rotate_grid.F90 ${src_home}/fvom_init.F90 ${src_home}/oce_local.F90 ${src_home}/gen_comm.F90 ${src_home}/MOD_READ_BINARY_ARRAYS.F90 ${src_home}/MOD_WRITE_BINARY_ARRAYS.F90 ${src_home}/MOD_PARTIT.F90)
Expand All @@ -476,9 +480,10 @@ set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/module/fesom_meshpart)
endif()
target_link_libraries(fesom_meshpart fesom_meshpart_C MPI::MPI_Fortran)
set_target_properties(fesom_meshpart PROPERTIES LINKER_LANGUAGE Fortran)
list(APPEND additional_targets fesom_meshpart)
endblock()
endif()

### Export and installation

fesom_export(TARGETS ${PROJECT_NAME} fesom.x fesom_meshpart)
fesom_export(TARGETS ${PROJECT_NAME} fesom.x ${additional_targets})