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

release/public-v2: turn option DEPLOY on by default, update documentation #80

Merged
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=install -DBUILD_MPI=OFF
make -j4
cat install/share/nceplibs-external.cmake.config
cat install/modules/esmf/8.0.0
2 changes: 1 addition & 1 deletion .github/workflows/macos-clanggfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=install -DBUILD_MPI=OFF
make -j4
cat install/share/nceplibs-external.cmake.config
cat install/modules/esmf/8.0.0
2 changes: 1 addition & 1 deletion .github/workflows/macos-gccgfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=install -DBUILD_MPI=OFF
make -j4
cat install/share/nceplibs-external.cmake.config
cat install/modules/esmf/8.0.0
36 changes: 12 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if(POLICY CMP0074)
endif(POLICY CMP0074)

# Tell cmake what to build
option(BUILD_MPI "Build MPI" ON )
option(BUILD_ESMF "Build ESMF" ON )
option(BUILD_NETCDF "Build NetCDF" ON )
option(BUILD_JASPER "Build Jasper" ON )
option(BUILD_PNG "Build libpng" ON )
option(DEPLOY "Deploy modulefiles" OFF)
option(BUILD_MPI "Build MPI" ON)
option(BUILD_ESMF "Build ESMF" ON)
option(BUILD_NETCDF "Build NetCDF" ON)
option(BUILD_JASPER "Build Jasper" ON)
option(BUILD_PNG "Build libpng" ON)
option(DEPLOY "Deploy modulefiles" ON)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

Expand All @@ -43,12 +43,6 @@ set(install_path ${CMAKE_INSTALL_PREFIX})
include(ExternalProject)
include(GNUInstallDirs)

if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR})
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR})
endif()
set(CMAKE_CONFIG_FILE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/nceplibs-external.cmake.config")
file(WRITE ${CMAKE_CONFIG_FILE} "# CMake configuration file for NCEPLIBS-external\n")

if(BUILD_MPI)
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER 9.9)
set(MPICH_FORTRAN_FLAGS "-w -fallow-argument-mismatch")
Expand All @@ -70,7 +64,6 @@ if(BUILD_MPI)
set(MPI_ROOT ${CMAKE_INSTALL_PREFIX})
set(MPI_C_LIBRARY_VERSION_STRING "MPICH")
set(MPI_C_VERSION_MAJOR "3")
file(APPEND ${CMAKE_CONFIG_FILE} "set(MPI_ROOT \"${CMAKE_INSTALL_PREFIX}\")\n")
else()
set(MPI_DETERMINE_LIBRARY_VERSION true)
find_package(MPI REQUIRED)
Expand Down Expand Up @@ -105,8 +98,6 @@ if(BUILD_NETCDF OR BUILD_PNG)
TEST_COMMAND cd ${PROJECT_BINARY_DIR}/zlib/build && make test
INSTALL_COMMAND $(MAKE) install
)

file(APPEND ${CMAKE_CONFIG_FILE} "set(ZLIB_ROOT \"${CMAKE_INSTALL_PREFIX}\")\n")
endif()

if(BUILD_NETCDF)
Expand Down Expand Up @@ -186,9 +177,6 @@ if(BUILD_NETCDF)
TEST_COMMAND cd ${PROJECT_BINARY_DIR}/netcdf-fortran && $(MAKE) check
DEPENDS netcdf
)

file(APPEND ${CMAKE_CONFIG_FILE} "set(HDF5_ROOT \"${CMAKE_INSTALL_PREFIX}\")\n")
file(APPEND ${CMAKE_CONFIG_FILE} "set(NETCDF \"${CMAKE_INSTALL_PREFIX}\")\n")
else()
# Find NetCDF
add_custom_target(netcdf-fortran)
Expand Down Expand Up @@ -216,7 +204,6 @@ if(BUILD_PNG)
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DEPENDS zlib
)
file(APPEND ${CMAKE_CONFIG_FILE} "set(PNG_ROOT \"${CMAKE_INSTALL_PREFIX}\")\n")
else()
# Find PNG
add_custom_target(libpng)
Expand Down Expand Up @@ -250,9 +237,6 @@ if(BUILD_JASPER)
INSTALL_COMMAND cd ${PROJECT_BINARY_DIR}/jasper && $(MAKE) install
DEPENDS libjpeg
)

file(APPEND ${CMAKE_CONFIG_FILE} "set(JPEG_ROOT \"${CMAKE_INSTALL_PREFIX}\")\n")
file(APPEND ${CMAKE_CONFIG_FILE} "set(Jasper_ROOT \"${CMAKE_INSTALL_PREFIX}\")\n")
else()
# Find JPEG and Jasper
add_custom_target(libjpeg)
Expand Down Expand Up @@ -312,8 +296,6 @@ if(BUILD_ESMF)
#TEST_BEFORE_INSTALL TRUE
INSTALL_COMMAND ${CMAKE_COMMAND} -E env PATH=${ESMF_PATH} ESMF_DIR=${PROJECT_SOURCE_DIR}/esmf ESMF_COMM=${MPITYPE} ESMF_COMPILER=${comp} ESMF_NETCDF=1 ESMF_NETCDF_INCLUDE=${NETCDF_INCLUDE_DIRS} ESMF_NETCDF_LIBS=${NETCDF_LIBRARIES} ESMF_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ESMF_INSTALL_HEADERDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} ESMF_INSTALL_MODDIR=${CMAKE_INSTALL_PREFIX}/mod ESMF_INSTALL_LIBDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} ESMF_INSTALL_BINDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR} ESMF_BOPT=${ESMF_BOPT} ESMF_OPTLEVEL=${ESMF_OPTLEVEL} ESMF_F90COMPILEOPTS=${ESMF_F90COMPILEOPTS} ESMF_CXXCOMPILEOPTS=${ESMF_CXXCOMPILEOPTS} $(MAKE) install
DEPENDS mpi netcdf-fortran)

file(APPEND ${CMAKE_CONFIG_FILE} "set(ESMFMKFILE \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/esmf.mk\")\n")
endif()

# Install modules (if DEPLOY = ON)
Expand All @@ -323,6 +305,12 @@ if(DEPLOY)
set(PNG_VERSION "1.6.35")
configure_file(${PROJECT_SOURCE_DIR}/tmplModulefiles/libpng ${CMAKE_INSTALL_PREFIX}/modules/libpng/${PNG_VERSION})
endif()
if(BUILD_JASPER)
set(JPEG_VERSION "9.1.0")
configure_file(${PROJECT_SOURCE_DIR}/tmplModulefiles/libjpeg ${CMAKE_INSTALL_PREFIX}/modules/libjpeg/${JPEG_VERSION})
set(JASPER_VERSION "1.900.1")
configure_file(${PROJECT_SOURCE_DIR}/tmplModulefiles/jasper ${CMAKE_INSTALL_PREFIX}/modules/jasper/${JASPER_VERSION})
endif()
if(BUILD_NETCDF)
set(NETCDF_VERSION "4.7.4")
configure_file(${PROJECT_SOURCE_DIR}/tmplModulefiles/netcdf ${CMAKE_INSTALL_PREFIX}/modules/netcdf/${NETCDF_VERSION})
Expand Down
29 changes: 4 additions & 25 deletions doc/README_cheyenne_gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS-external
cd NCEPLIBS-external
mkdir build && cd build
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEPLOY=ON .. 2>&1 | tee log.cmake
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} .. 2>&1 | tee log.cmake
make VERBOSE=1 -j2 2>&1 | tee log.make

cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS
cd NCEPLIBS
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DOPENMP=ON -DDEPLOY=ON .. 2>&1 | tee log.cmake
export ESMFMKFILE=${INSTALL_PREFIX}/lib64/esmf.mk
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DOPENMP=ON .. 2>&1 | tee log.cmake
make VERBOSE=1 -j2 2>&1 | tee log.make
make deploy 2>&1 | tee log.deploy

Expand Down Expand Up @@ -59,30 +60,8 @@ module load mpt/2.19
module load ncarcompilers/0.5.0
module load cmake/3.16.4

export CC=mpicc
export FC=mpif90
export CXX=mpicxx

module use /glade/p/ral/jntp/GMTB/tools/NCEPLIBS-ufs-v2.0.0/gnu-9.1.0/mpt-2.19/modules

module load libpng/1.6.35
module load netcdf/4.7.4
module load esmf/8.0.0

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.1
module load g2tmpl/1.9.1
module load ip/3.3.3
module load nceppost/dceca26
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 NCEPLIBS/2.0.0

export CMAKE_Platform=cheyenne.gnu
./build.sh 2>&1 | tee build.log
29 changes: 4 additions & 25 deletions doc/README_cheyenne_intel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS-external
cd NCEPLIBS-external
mkdir build && cd build
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEPLOY=ON .. 2>&1 | tee log.cmake
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} .. 2>&1 | tee log.cmake
make VERBOSE=1 -j2 2>&1 | tee log.make

cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS
cd NCEPLIBS
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DOPENMP=ON -DDEPLOY=ON .. 2>&1 | tee log.cmake
export ESMFMKFILE=${INSTALL_PREFIX}/lib64/esmf.mk
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DOPENMP=ON .. 2>&1 | tee log.cmake
make VERBOSE=1 -j2 2>&1 | tee log.make
make deploy 2>&1 | tee log.deploy

Expand Down Expand Up @@ -59,30 +60,8 @@ module load mpt/2.19
module load ncarcompilers/0.5.0
module load cmake/3.16.4

export CC=mpicc
export FC=mpif90
export CXX=mpicxx

module use /glade/p/ral/jntp/GMTB/tools/NCEPLIBS-ufs-v2.0.0/intel-19.1.1/mpt-2.19/modules

module load libpng/1.6.35
module load netcdf/4.7.4
module load esmf/8.0.0

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.1
module load g2tmpl/1.9.1
module load ip/3.3.3
module load nceppost/dceca26
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 NCEPLIBS/2.0.0

export CMAKE_Platform=cheyenne.intel
./build.sh 2>&1 | tee build.log
31 changes: 4 additions & 27 deletions doc/README_gaea_intel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS-external
cd NCEPLIBS-external
mkdir build && cd build
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEPLOY=ON .. 2>&1 | tee log.cmake
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} .. 2>&1 | tee log.cmake
make VERBOSE=1 -j8 2>&1 | tee log.make

cd ${INSTALL_PREFIX}/src
Expand All @@ -48,13 +48,11 @@ rm -fr tmp
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS
cd NCEPLIBS
mkdir build && cd build
export ESMFMKFILE=${INSTALL_PREFIX}/lib64/esmf.mk
# Tell CMake to use the previously downloaded packages
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEPLOY=ON -DOPENMP=ON -DUSE_LOCAL=ON .. 2>&1 | tee log.cmake
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DOPENMP=ON -DUSE_LOCAL=ON .. 2>&1 | tee log.cmake
make VERBOSE=1 -j8 2>&1 | tee log.make
make deploy 2>&1 | tee log.deploy
cd ..
# Convert lua modulefiles into tcl modulefiles
./lua2tcl.py ${INSTALL_PREFIX}/modules


- END OF THE SETUP INSTRUCTIONS -
Expand All @@ -78,30 +76,9 @@ module load cray-mpich/7.7.11
module unload cray-netcdf
module load cmake/3.17.0

export CC=cc
export FC=ftn
export CXX=CC

module use /lustre/f2/pdata/esrl/gsd/ufs/NCEPLIBS-ufs-v2.0.0/intel-19.0.5.281/cray-mpich-7.7.11/modules

module load libpng/1.6.35
module load netcdf/4.7.4
module load esmf/8.0.0

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.1
module load g2tmpl/1.9.1
module load ip/3.3.3
module load nceppost/dceca26
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 NCEPLIBS/2.0.0

export CMAKE_C_COMPILER=cc
export CMAKE_CXX_COMPILER=CC
Expand Down
29 changes: 4 additions & 25 deletions doc/README_hera_gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS-external
cd NCEPLIBS-external
mkdir build && cd build
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEPLOY=ON .. 2>&1 | tee log.cmake
cmake -DBUILD_MPI=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} .. 2>&1 | tee log.cmake
make VERBOSE=1 -j8 2>&1 | tee log.make

cd ${INSTALL_PREFIX}/src
git clone -b ufs-v2.0.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS
cd NCEPLIBS
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEPLOY=ON -DOPENMP=ON .. 2>&1 | tee log.cmake
export ESMFMKFILE=${INSTALL_PREFIX}/lib64/esmf.mk
cmake -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DOPENMP=ON .. 2>&1 | tee log.cmake
make VERBOSE=1 -j8 2>&1 | tee log.make
make deploy 2>&1 | tee log.deploy

Expand All @@ -55,30 +56,8 @@ module use -a /scratch1/BMC/gmtb/software/modulefiles/gnu-9.2.0/mpich-3.3.2
module load mpich/3.3.2
module load cmake/3.16.1

export CC=gcc
export CXX=g++
export FC=gfortran

module use /scratch1/BMC/gmtb/software/NCEPLIBS-ufs-v2.0.0/gnu-9.2.0/mpich-3.3.2/modules

module load libpng/1.6.35
module load netcdf/4.7.4
module load esmf/8.0.0

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.1
module load g2tmpl/1.9.1
module load ip/3.3.3
module load nceppost/dceca26
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 NCEPLIBS/2.0.0

export CMAKE_C_COMPILER=mpicc
export CMAKE_CXX_COMPILER=mpicxx
Expand Down
Loading