Skip to content

Commit

Permalink
Add pnetcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanJovic-NOAA committed Aug 31, 2024
1 parent 9cbc473 commit 8dd084a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
35 changes: 29 additions & 6 deletions libs/ufslibs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,25 @@ ExternalProject_Add(cmake_fortran_utils
LOG_INSTALL ON
)

##
## pnetcdf
##
ExternalProject_Add(pnetcdf
URL ${downloads_prefix}/pnetcdf.tar.gz
URL_HASH MD5=31b94d39462b1f1f2293f735c9819bf2
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND env "MPICC=${MPI_C_COMPILER}"
env "MPICXX=${MPI_CXX_COMPILER}"
env "MPIF90=${MPI_Fortran_COMPILER}"
./configure --prefix=${install_prefix}/pnetcdf
--disable-shared
--enable-static
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
)

##
## PIO
##
Expand All @@ -246,14 +265,15 @@ ExternalProject_Add(pio
-DUSER_CMAKE_MODULE_PATH=${install_prefix}/cmake_fortran_utils
-DGENF90_PATH=${install_prefix}/genf90/bin
-DNetCDF_PATH=${install_prefix}/netcdf
-DPnetCDF_PATH=${install_prefix}/pnetcdf
-DHDF5_PATH=${install_prefix}/hdf5
-DLIBZ_PATH=${install_prefix}/zlib
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
)
ExternalProject_Add_StepDependencies(pio build netcdf_fortran genf90 cmake_fortran_utils)
ExternalProject_Add_StepDependencies(pio build netcdf_fortran pnetcdf genf90 cmake_fortran_utils)

##
## FMS
Expand Down Expand Up @@ -339,17 +359,20 @@ message(STATUS "Set ESMF_COMM to ${ESMF_COMM}")

list(APPEND esmf_env ESMF_COMM=${ESMF_COMM})
list(APPEND esmf_env ESMF_BOPT=O)
# list(APPEND esmf_env ESMF_OPTLEVEL=2)
list(APPEND esmf_env ESMF_F90COMPILEOPTS=${FCFLAGS_esmf})
list(APPEND esmf_env ESMF_CXXCOMPILEOPTS=${CXXFLAGS_esmf})
list(APPEND esmf_env ESMF_MPIRUN=mpiexec)
list(APPEND esmf_env ESMF_NETCDF_INCLUDE=${install_prefix}/netcdf/include)
list(APPEND esmf_env ESMF_NETCDF_LIBPATH=${install_prefix}/netcdf/lib)

list(APPEND esmf_env ESMF_NETCDF=split)
list(APPEND esmf_env "ESMF_NETCDF_LIBS=-lnetcdff -lnetcdf -L${install_prefix}/hdf5/lib -lhdf5_hl -lhdf5 -L${install_prefix}/zstd/lib -lzstd -L${install_prefix}/zlib/lib -lz -ldl -lm")
list(APPEND esmf_env ESMF_NETCDF_INCLUDE=${install_prefix}/netcdf/include)
list(APPEND esmf_env "ESMF_NETCDF_LIBPATH=${install_prefix}/netcdf/lib ${install_prefix}/hdf5/lib ${install_prefix}/zstd/lib ${install_prefix}/zlib/lib")
list(APPEND esmf_env "ESMF_NETCDF_LIBS=-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lzstd -lz -ldl -lm")

list(APPEND esmf_env ESMF_PIO=external)
list(APPEND esmf_env ESMF_PIO_INCLUDE=${install_prefix}/pio/include)
list(APPEND esmf_env ESMF_PIO_LIBPATH=${install_prefix}/pio/lib)
list(APPEND esmf_env "ESMF_PIO_LIBPATH=${install_prefix}/pio/lib -L${install_prefix}/pnetcdf/lib")
list(APPEND esmf_env "ESMF_PIO_LIBS=-lpioc -lpnetcdf")

list(APPEND esmf_env ESMF_SHARED_LIB_BUILD=OFF)
list(APPEND esmf_env ESMF_INSTALL_PREFIX=${install_prefix}/esmf)
list(APPEND esmf_env ESMF_INSTALL_HEADERDIR=include)
Expand Down
1 change: 1 addition & 0 deletions libs/ufslibs/fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ download_and_check_md5sum 84acd096ab4f3300c20db862eecdf7c7 https://github.com/U
download_and_check_md5sum 8c200fcf7d9d2761037dfd2dabe2216b https://github.com/Unidata/netcdf-fortran/archive/v4.6.1.tar.gz netcdf_fortran.tar.gz

download_and_check_md5sum a3c39f002a7a81882b65b7eb8c9a7d91 https://github.com/CESM-Development/CMake_Fortran_utils/archive/refs/tags/CMake_Fortran_utils_150308.tar.gz cmake_fortran_utils.tar.gz
download_and_check_md5sum 31b94d39462b1f1f2293f735c9819bf2 https://parallel-netcdf.github.io/Release/pnetcdf-1.13.0.tar.gz pnetcdf.tar.gz
download_and_check_md5sum 7f3504dfb5aab846f4a9018dda7bb8ad https://github.com/PARALLELIO/genf90/archive/refs/tags/genf90_200608.tar.gz genf90.tar.gz
download_and_check_md5sum 171ee9a2b31a73108314a35b4db1dfaa https://github.com/NCAR/ParallelIO/archive/refs/tags/pio2_5_10.tar.gz pio.tar.gz

Expand Down

0 comments on commit 8dd084a

Please sign in to comment.