Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use project configs from NCEPLIBS #118

Merged
merged 35 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a0f3c54
move cmake to CMakeModules
aerorahul Jun 16, 2020
597f47f
update pointer to CMakeModules
aerorahul Jun 16, 2020
9a6bd56
use imported targets for NCEPLIBS
aerorahul Jun 17, 2020
039d884
update pointer to CMakeModules
aerorahul Jun 17, 2020
15d58e0
update pointer to CMakeModules
aerorahul Jun 17, 2020
08c4475
update gitmodule to point to correct branch of CMakeModules
aerorahul Jun 17, 2020
6c73bff
removed explicit dependency on png, jasper and zlib as they are resol…
aerorahul Jun 17, 2020
f1a4036
ignore exec/ and update build.hera to temporarily point to user test …
aerorahul Jun 19, 2020
4d98f4b
CMakeModules was updated. Update pointer to CMakeModules submoule and…
aerorahul Jun 23, 2020
9b582d0
Merge branch 'develop' into feature/cmakepkgs
aerorahul Jul 28, 2020
a24e981
update modules on hera orion cray and dell to point to cmake libraries
aerorahul Jul 28, 2020
ed48cc1
- utilities linking with nemsio library need to link with bacio_4 and…
aerorahul Jul 28, 2020
75c03de
remove unused modules crtm, nceppost and g2tmpl
aerorahul Jul 28, 2020
45b91de
update intel module on cray. Export esmfmkfile variable
aerorahul Jul 28, 2020
910aaff
update orion paths for netcdf and esmf
aerorahul Jul 28, 2020
a4554c7
update pointer to CMakeModules
aerorahul Jul 31, 2020
1cc4a56
use wgrib2 cmake library
aerorahul Aug 13, 2020
2a52d41
update cmakemodues pointer
aerorahul Aug 18, 2020
8afe499
Merge branch 'develop' into feature/cmakepkgs
aerorahul Aug 19, 2020
69c5282
update modulefile
aerorahul Aug 20, 2020
0087304
fix gfortran issues
aerorahul Aug 20, 2020
bab941e
remove find_package(ip2)
aerorahul Aug 29, 2020
1feec6b
minor cleanup of flags
aerorahul Aug 29, 2020
b410fbe
Merge branch 'develop' into feature/cmakepkgs
aerorahul Sep 8, 2020
d30e435
Update modules and CMakeModules (#2)
kgerheiser Sep 9, 2020
65743fa
Fix synax error in global_equiv_resol.f90 (using gnu compiler) (#1)
DusanJovic-NOAA Sep 9, 2020
511b25e
Update Jet and load wgrib2 instead of manually setting wgrib2_ROOT (#3)
kgerheiser Sep 9, 2020
175e0c7
Fix typos and load PNG for Jet
kgerheiser Sep 9, 2020
0edc764
Load correct wgrib2
kgerheiser Sep 9, 2020
1710db6
Update build.jet to point to OpenMP-enabled sp lib
kgerheiser Sep 10, 2020
cbd3a43
Update build.jet
kgerheiser Sep 10, 2020
c649d9c
Update build.wcoss_cray
kgerheiser Sep 11, 2020
35e03ce
Update module_base.wcoss_dell_p3
kgerheiser Sep 14, 2020
09f1baf
Update build.wcoss_dell_p3
kgerheiser Sep 14, 2020
7e72c57
Revert "Update module_base.wcoss_dell_p3"
kgerheiser Sep 14, 2020
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
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build/
install/
exec/

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

*.swp
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "cmake"]
path = cmake
path = CMakeModules
url = https://github.com/NOAA-EMC/CMakeModules
branch = develop
90 changes: 23 additions & 67 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(
ufs_util
VERSION ${pVersion}
LANGUAGES C Fortran)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/Modules")

if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
message(STATUS "Setting build type to 'Release' as none was specified.")
Expand All @@ -17,96 +17,52 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
"MinSizeRel" "RelWithDebInfo")
endif()

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

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

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "-g -traceback")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
endif()

if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_C_FLAGS "-g -traceback")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -traceback")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0")
elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_C_FLAGS " ")
set(CMAKE_C_FLAGS_RELEASE " ")
set(CMAKE_C_FLAGS_DEBUG " ")
endif()

find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Jasper REQUIRED)
find_package(NetCDF REQUIRED C Fortran)
find_package(MPI REQUIRED )
find_package(MPI REQUIRED)
find_package(ESMF MODULE REQUIRED)
find_package(WGRIB2 REQUIRED)

option(OPENMP "use OpenMP threading" ON)
if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true)

if(NOT TARGET gfsio_4)
find_package(gfsio REQUIRED)
endif()

if(NOT TARGET sfcio_4)
find_package(sfcio REQUIRED)
endif()

if(NOT TARGET w3nco_d)
find_package(w3nco REQUIRED)
endif()

if(NOT TARGET landsfcutil_d)
find_package(landsfcutil REQUIRED)
endif()

if(NOT TARGET bacio_4)
find_package(bacio REQUIRED)
endif()

if(NOT TARGET nemsio)
find_package(nemsio REQUIRED)
endif()

if(NOT TARGET nemsiogfs)
find_package(nemsiogfs REQUIRED)
endif()

if(NOT TARGET sigio_4)
find_package(sigio REQUIRED)
endif()

if(NOT TARGET sp_d)
find_package(sp REQUIRED)
endif()

if(NOT TARGET ip_d)
find_package(ip REQUIRED)
endif()

if(NOT TARGET w3emc_d)
find_package(w3emc REQUIRED)
endif()

if(NOT TARGET g2_d)
find_package(g2 REQUIRED)
endif()
find_package(gfsio REQUIRED)
find_package(sfcio REQUIRED)
find_package(w3nco REQUIRED)
find_package(landsfcutil REQUIRED)
find_package(bacio REQUIRED)
find_package(nemsio REQUIRED)
find_package(nemsiogfs REQUIRED)
find_package(sigio REQUIRED)
find_package(sp REQUIRED)
find_package(ip REQUIRED)
find_package(w3emc REQUIRED)
find_package(g2 REQUIRED)
find_package(wgrib2 REQUIRED)

# EMC requires executables in ./exec
set(exec_dir bin)
Expand Down
1 change: 1 addition & 0 deletions CMakeModules
Submodule CMakeModules added at 3eaddb
18 changes: 12 additions & 6 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,35 @@ set -eux

target=${target:-"NULL"}

if [[ $target == "linux.gnu" || $target == "linux.intel" ]]; then
if [[ "$target" == "linux.gnu" || "$target" == "linux.intel" ]]; then
unset -f module
else
set +x
source ./sorc/machine-setup.sh > /dev/null 2>&1
set -x
fi

export MOD_PATH
set +x
source ./modulefiles/build.$target > /dev/null 2>&1
module list
set -x

#
# --- Build all programs.
#

rm -fr ./build
mkdir ./build
cd ./build

if [[ $target == "wcoss_cray" ]]; then
cmake .. -DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON
else
cmake .. -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=icc -DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON"

if [[ "$target" != "wcoss_cray" ]]; then
CMAKE_FLAGS+=" -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=icc"
fi

cmake .. ${CMAKE_FLAGS}

make -j 8 VERBOSE=1
make install

Expand Down
1 change: 0 additions & 1 deletion cmake
Submodule cmake deleted from ff93c2
33 changes: 17 additions & 16 deletions modulefiles/build.hera
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ module load cmake/3.16.1
module load intel/18.0.5.274
module load impi/2018.0.4

module use -a /scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles
module load prod_util/1.1.0
module load w3nco/2.0.6
module load w3emc/2.3.0
module load nemsio/2.2.3
module load bacio/2.0.2
module load sp/2.0.2
module load ip/3.0.1
module load sfcio/1.1.0
module load sigio/2.1.0
module load gfsio/1.1.0
module load nemsiogfs/2.2.0
module load landsfcutil/2.1.0
module load g2/2.5.0
module use /scratch2/NCEPDEV/nwprod/NCEPLIBS/cmake/install/NCEPLIBS-v1.2.0/modules

module load bacio/2.4.1
module load g2/3.4.1
module load ip/3.3.3
module load nemsio/2.5.2
module load sp/2.3.3
module load w3emc/2.7.3
module load w3nco/2.4.1
module load gfsio/1.4.1
module load sfcio/1.4.1
module load sigio/2.3.2
module load nemsiogfs/2.5.3
module load landsfcutil/2.4.1
module load wgrib2/2.0.8

module use /scratch1/NCEPDEV/nems/emc.nemspara/soft/modulefiles
module load hdf5_parallel/1.10.6
module load netcdf_parallel/4.7.4
module load esmf/8.0.0_ParallelNetCDF

export WGRIB2_ROOT="/scratch1/NCEPDEV/da/George.Gayno/noscrub/wgrib2"
46 changes: 25 additions & 21 deletions modulefiles/build.jet
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
#%Module#####################################################
## Build and run module for Jet
#############################################################

module use /lfs4/HFIP/hfv3gfs/nwprod/NCEPLIBS/modulefiles
module load cmake/3.16.1
module load intel/18.0.5.274
module load impi/2018.4.274
module load szip/2.1
module load hdf5/1.10.4
module load netcdf/4.6.1
export NETCDF="/apps/netcdf/4.6.1/intel/18.0.5.274"
module load w3nco/v2.0.6
module load w3emc/v2.2.0
module load sp/v2.0.2
module load ip/v3.0.0
module load bacio/v2.0.2
module load sigio/v2.1.0
module load sfcio/v1.0.0
module load nemsio/v2.2.3
module load nemsiogfs/v2.0.1
module load gfsio/v1.1.0
module load landsfcutil/v2.1.0
module load g2/v3.1.0
module load hdf5/1.10.5
module load netcdf/4.7.0

export CC=icc
export FC=ifort
export CXX=icpc

export ESMFMKFILE=/lfs4/HFIP/hfv3gfs/software/NCEPLIBS-ufs-v2.0.0beta01/intel-18.0.5.274/impi-2018.4.274/lib64/esmf.mk
export Jasper_ROOT=/lfs4/HFIP/hfv3gfs/software/NCEPLIBS-ufs-v2.0.0beta01/intel-18.0.5.274/impi-2018.4.274

module use /lfs4/HFIP/hfv3gfs/software/NCEPLIBS-ufs-v2.0.0beta01/intel-18.0.5.274/impi-2018.4.274/modules
module load w3nco/2.4.1
module load w3emc/2.7.3
module load sp/2.3.3
module load ip/3.3.3
module load bacio/2.4.1
module load sigio/2.3.2
module load sfcio/1.4.1
module load nemsio/2.5.2
module load nemsiogfs/2.5.3
module load gfsio/1.4.1
module load landsfcutil/2.4.1
module load g2/3.4.1
module load wgrib2/2.0.8


# Use DTCs version of esmf v8. POC Dom H.
module use -a /lfs4/HFIP/hfv3gfs/software/modulefiles/intel-18.0.5.274/impi-2018.4.274
module load esmf/8.0.0

export WGRIB2_ROOT="/lfs4/HFIP/hwrfv3/Jili.Dong/wgrib2-2.0.8/grib2/lib"
29 changes: 15 additions & 14 deletions modulefiles/build.orion
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ module load cmake/3.15.4
module load intel/2020
module load impi/2020

module use -a /apps/contrib/NCEPLIBS/orion/modulefiles
module load w3nco/2.1.0
module load nemsio/2.3.0
module load bacio/2.2.0
module load sfcio/1.2.0
module load sigio/2.2.0
module load gfsio/1.2.0
module load w3emc/2.4.0
module load ip/3.1.0
module load nemsiogfs/2.3.0
module load landsfcutil/2.2.0
module load g2/3.1.1
module load sp/2.0.3
module use /apps/contrib/NCEPLIBS/orion/cmake/install/NCEPLIBS-v1.2.0/modules
module load bacio/2.4.1
module load g2/3.4.1
module load ip/3.3.3
module load nemsio/2.5.2
module load sp/2.3.3
module load w3emc/2.7.3
module load w3nco/2.4.1
module load gfsio/1.4.1
module load sfcio/1.4.1
module load sigio/2.3.2
module load nemsiogfs/2.5.3
module load landsfcutil/2.4.1
module load wgrib2/2.0.8

export Jasper_ROOT="/apps/jasper-1.900.1"

module use -a /apps/contrib/NCEPLIBS/lib/modulefiles
module load netcdfp/4.7.4.release
module load esmflocal/8_0_0.release

export WGRIB2_ROOT="/work/noaa/da/ggayno/save/wgrib2"
32 changes: 18 additions & 14 deletions modulefiles/build.wcoss_cray
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,36 @@ module load cfp-intel-sandybridge/1.1.0
module load cmake/3.16.2
module load PrgEnv-intel/5.2.56
module rm intel
module load intel/16.3.210
module load intel/18.1.163
module load cray-mpich/7.2.0
module load craype-haswell
module load alps/5.2.4-2.0502.9822.32.1.ari
module load cray-netcdf/4.3.3.1
module load cray-hdf5/1.8.14
module load w3nco-intel/2.0.6
module load nemsio-intel/2.2.3
module load bacio-intel/2.0.2
module load sp-intel/2.0.2
module load ip-intel/3.0.0
module load sigio-intel/2.1.0
module load sfcio-intel/1.0.0
module load landsfcutil-intel/2.1.0
module load gfsio-intel/1.1.0
module load w3emc-intel/2.2.0
module load nemsiogfs-intel/2.0.1
module load g2-intel/2.5.0

module use /usrx/local/nceplibs/NCEPLIBS/cmake/install/NCEPLIBS-v1.2.0/modules
module load bacio/2.4.1
module load g2/3.4.1
module load ip/3.3.3
module load nemsio/2.5.2
module load sp/2.3.3
module load w3emc/2.7.3
module load w3nco/2.4.1
module load gfsio/1.4.1
module load sfcio/1.4.1
module load sigio/2.3.2
module load nemsiogfs/2.5.3
module load landsfcutil/2.4.1
module load wgrib2/2.0.8

export ZLIB_ROOT=/usrx/local/prod/zlib/1.2.7/intel/haswell
export PNG_ROOT=/usrx/local/prod//png/1.2.49/intel/haswell
export Jasper_ROOT=/usrx/local/prod/jasper/1.900.1/intel/haswell

module use /gpfs/hps3/emc/nems/noscrub/emc.nemspara/soft/modulefiles
module load esmf/8.0.0
export ESMFMKFILE=/gpfs/hps3/emc/nems/noscrub/emc.nemspara/soft/esmf/8.0.0/lib/esmf.mk
export NETCDF=/opt/cray/netcdf/4.3.3.1/INTEL/14.0
module rm gcc
module load gcc/6.3.0

export WGRIB2_ROOT=/gpfs/hps3/emc/global/noscrub/George.Gayno/wgrib2
Loading