Skip to content

Commit

Permalink
Feature/cleanup (#95)
Browse files Browse the repository at this point in the history
* cleanup post

Change-Id: Ie52af5ff79ac4122e79d7a46e89ee2077188b0a4

* we dont depend on C HDF5 library. remove.

Change-Id: I26aa7c0bf7ed2783de1a9967d961d0260dee8b54

* use transitive properties. apply OpenMP flags if OpenMP is found. Formatting using cmake-format

Change-Id: Ic08ce6bc85a7d949c779ec597241c8cb4c20db86

* add debug gnu flags. compile_definitions does not like the quotes around long long, remove

Change-Id: Iccd5bb496944f75a79500729051dd571303cb50f

* Update CMakeLists.txt

* EMC_post is a Fortran only project. blockIO.c is not used, so do not include in building

* Update version

@fossell says post is at version 8.0.0
  • Loading branch information
aerorahul authored Feb 27, 2020
1 parent 653cdc3 commit 7e9797b
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 231 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build/
install/

*.[ao]
*.mod
*.so
*.exe
*.x

*.swp
63 changes: 31 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
cmake_minimum_required(VERSION 3.15)
project(ncep_post VERSION 1.1.1)
set(${PROJECT_NAME}_VERSION ${PROJECT_VERSION} CACHE INTERNAL "${PROJECT_NAME} version number")

enable_language (Fortran)
file(STRINGS "VERSION" pVersion)

option(OPENMP "use OpenMP threading" OFF)

if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: PRODUCTION Debug Release."
FORCE)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(IntelComp true )
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU*" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang*")
set(GNUComp true )
elseif(CMAKE_CXX_COMPILER_ID MATCHES "pgc*")
set(PGIComp true )
endif()
project(
ncep_post
VERSION ${pVersion}
LANGUAGES Fortran)

STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "RelWithDebInfo" BUILD_RELEASE)
if(NOT BUILD_RELEASE )
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "RELEASE" BUILD_RELEASE)
endif()
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "PRODUCTION" BUILD_PRODUCTION)
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "DEBUG" BUILD_DEBUG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
Expand All @@ -35,15 +16,33 @@ if(POLICY CMP0012)
cmake_policy(SET CMP0012 NEW)
endif()

find_package(MPI REQUIRED)
if(OPENMP)
find_package(OpenMP)
option(OPENMP "use OpenMP threading" OFF)

if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE
"Release"
CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()

if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU|Clang|AppleClang)$")
message(WARNING "Compiler not officially supported: ${CMAKE_Fortran_COMPILER_ID}")
endif()

find_package(MPI REQUIRED)
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(HDF5 COMPONENTS C Fortran HL REQUIRED)
find_package(NetCDF REQUIRED)
find_package(Jasper REQUIRED)
find_package(HDF5 COMPONENTS Fortran HL REQUIRED)
find_package(NetCDF REQUIRED)

if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true)

if(NOT TARGET sigio_4)
find_package(sigio REQUIRED)
Expand Down Expand Up @@ -93,6 +92,6 @@ if(NOT TARGET crtm)
find_package(crtm REQUIRED)
endif()

add_subdirectory(sorc/ncep_post.fd)
add_subdirectory(sorc)

install(FILES parm/postxconfig-NT-GFS.txt parm/postxconfig-NT-GFS-F00.txt DESTINATION share)
install(FILES parm/postxconfig-NT-GFS.txt parm/postxconfig-NT-GFS-F00.txt DESTINATION share)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.0.0
1 change: 1 addition & 0 deletions sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(ncep_post.fd)
Loading

0 comments on commit 7e9797b

Please sign in to comment.