Skip to content

Commit

Permalink
Release/1.1.0 (#5)
Browse files Browse the repository at this point in the history
* Feature/ecbuild35 (#2)

* ecbuild 3.5 update

* openmp already linked to target

* export fortran modules

* enable omp

* fix for ecbuild 3.6

* Prefer jedicmake for find modules and link against NetCDF::NetCDF_Fortran (#3)

Co-authored-by: Mark J Olah <[email protected]>

* bump release number

Co-authored-by: Mark J Olah <[email protected]>
  • Loading branch information
Mark Miesch and markjolah authored Jun 11, 2021
1 parent fa04429 commit 8a9bfd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

cmake_minimum_required( VERSION 3.3.2 FATAL_ERROR )

project( fv3jedilm VERSION 1.0.0 LANGUAGES Fortran C )
project( fv3jedilm VERSION 1.1.0 LANGUAGES Fortran C )

set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH} )

Expand Down Expand Up @@ -50,20 +50,17 @@ else()
endif()

#openMP
find_package( OpenMP COMPONENTS Fortran )
ecbuild_enable_omp()

# MPI
ecbuild_add_option( FEATURE MPI DEFAULT ON
DESCRIPTION "Support for MPI distributed parallelism"
REQUIRED_PACKAGES "MPI COMPONENTS Fortran" )
ecbuild_find_mpi( COMPONENTS Fortran REQUIRED )
ecbuild_include_mpi()
link_libraries(${MPI_Fortran_LIBRARIES})

# NetCDF
set( NETCDF_F90 ON CACHE BOOL "Compile with Fortran NetCDF" )
find_package( jedicmake QUIET )
find_package( NetCDF REQUIRED COMPONENTS Fortran )
include_directories( ${NETCDF_INCLUDE_DIRS} )

# Set default model
if (NOT FV3_FORECAST_MODEL MATCHES "GEOS" AND NOT FV3_FORECAST_MODEL MATCHES "UFS")
Expand All @@ -72,7 +69,7 @@ endif()

# fms
if (FV3_FORECAST_MODEL MATCHES "FV3CORE")
ecbuild_use_package( PROJECT fms REQUIRED )
find_package( fms REQUIRED )
include_directories( ${FMS_INCLUDE_DIRS} )
list( APPEND FV3JEDILM_TPLS fms )
endif()
Expand All @@ -95,7 +92,6 @@ if(FV3_FORECAST_MODEL MATCHES "UFS")
find_package(fv3atm REQUIRED )
find_package(ufs REQUIRED )
link_libraries(fms)
link_libraries(NetCDF::NetCDF_Fortran)
# Install includes
get_target_property(fmsinc fms INTERFACE_INCLUDE_DIRECTORIES)
include_directories( ${fmsinc} )
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ endif()

ecbuild_add_library( TARGET fv3jedilm
SOURCES ${fv3jedilm_src_files}
LIBS ${FV3JEDILM_LIB_DEP}
PUBLIC_LIBS NetCDF::NetCDF_Fortran
PRIVATE_LIBS ${FV3JEDILM_LIB_DEP}
INSTALL_HEADERS LISTED )

if(OpenMP_Fortran_FOUND)
target_link_libraries(fv3jedilm OpenMP::OpenMP_Fortran)
endif()
target_include_directories( fv3jedilm INTERFACE $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>)

if(CMAKE_Fortran_COMPILER_ID MATCHES GNU AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
target_compile_options(fv3jedilm PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-fallow-argument-mismatch>)
Expand Down

0 comments on commit 8a9bfd8

Please sign in to comment.