Skip to content

Commit

Permalink
Feature 3047 dev env seneca oneapi (#3048)
Browse files Browse the repository at this point in the history
* Per #3047, modify the intel oneapi settings for compiler variable

* Per #3047, modifications for ATLAS and ECKIT

* Per 3047, creating a new development environment file for MET for seneca using the necessary values for the Intel oneAPI compilers on seneca

* Per #3047, uploading config file used to install MET on seneca with Intel oneAPI

* Per #3047, updated development file to use appropriate compiler settings

* Per #3047, removing paths to compilers

* Per #3047, removing paths to compilers

* Per #3047, added BUFRLIB_NAME and GRIB2CLIB_NAME

* Per #3047, adding paths back in for now

* Per #3047, removing paths to compilers

* Per #3047, commenting out source of setvars.sh and adding paths to older Intel oneAPI compilers

* Per #2047, updates for compilation however a pb2nc unit test still fails

* Per #3047, updating file for the 2024.2.1.100 compilers

* Per #3047, updating some ADDTL_DIRs

---------

Co-authored-by: Julie Prestopnik <jpresto@seneca.rap.ucar.edu>
  • Loading branch information
jprestop and Julie Prestopnik authored Jan 23, 2025
1 parent 00dd361 commit 8a06acd
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 11 deletions.
84 changes: 84 additions & 0 deletions internal/scripts/environment/development.seneca_intel_oneapi
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Define the development environment for NCAR project machine seneca using the Intel oneAPI compilers
# Based on settings in development.seneca, modified for the Intel oneAPI compilers

# Top-level MET project directory
MET_PROJ_DIR=/d1/projects/MET

# Source the setvars.sh file for updates to the $PATH and $LD_LIBRARY_PATH
source /nrit/ral/intel/setvars.sh

# Set the values for the compilers
export FC=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/compiler/2024.2/bin/ifx
export F77=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/compiler/2024.2/bin/ifx
export F90=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/compiler/2024.2/bin/ifx
export CC=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/compiler/2024.2/bin/icx
export CXX=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/compiler/2024.2/bin/icpx

# Variables required to build MET
export MET_DEVELOPMENT=true
export MET_DST=/d1/projects/MET/intel/external_libs/
export MET_PROJ=${MET_DST}
export MET_NETCDF=${MET_DST}
export MET_HDF5=${MET_DST}
export MET_BUFR=${MET_DST}
export BUFRLIB_NAME=-lbufr_4
export MET_GRIB2C=${MET_DST}
export GRIB2CLIB_NAME=-lg2c
export MET_GSLINC=${MET_DST}
export MET_GSLLIB=${MET_DST}
export MET_CAIROINC=${MET_DST}/include/cairo
export MET_CAIROLIB=${MET_DST}/lib/cairo
export MET_FREETYPEINC=${MET_DST}/include/freetype2
export MET_FREETYPELIB=${MET_DST}/lib
export MET_ATLAS=${MET_DST}
export MET_ECKIT=${MET_DST}
export JASPER=${MET_DST}
#export MET_HDFINC=${MET_DST}
#export MET_HDFLIB=${MET_DST}
#export MET_HDFEOS=${MET_DST}

# For Python 3 in MET 12.0,0
export MET_PYTHON=/nrit/ral/met-python3
export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3.10
export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.10"
export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm"

# -D__64BIT__ is required because we've compiled libgrib2c.a with that flag
export CFLAGS="-O2"
export CXXFLAGS=" -std=c++17"

# Set LDFLAGS to include -rpath settings when compiling MET
export ADDTL_DIR=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/compiler/2024.2/lib
export ADDTL_DIR2=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2024.2.1.100/mkl/2024.2/lib
#export ADDTL_DIR3=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2023.2.0.49397/mpi/2021.10.0/lib
#export ADDTL_DIR4=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2023.2.0.49397/mpi/2021.10.0/lib/release/
export LDFLAGS="-Wl,--disable-new-dtags"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,${MET_DST}/lib:${MET_HDFEOS}/lib:${MET_PROJ}/lib:${MET_NETCDF}/lib:${MET_DST}/zlib-1.2.11/lib:${MET_DST}/szip-2.1.1/lib"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,${MET_HDFLIB}:${MET_HDF5}/lib:${MET_GSL}/lib:${MET_PYTHON}/lib:${JASPER}/lib"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,${ADDTL_DIR}"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,${ADDTL_DIR2}"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,${ADDTL_DIR3}"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,${ADDTL_DIR4}"
export LDFLAGS="${LDFLAGS} -L${ADDTL_DIR} -L${ADDTL_DIR2} -L${ADDTL_DIR3} -L${ADDTL_DIR4} -L${JASPER}/lib -Wl,-rpath,${MET_ATLAS}/lib -Wl,-rpath,${MET_ECKIT}/lib"

# Variables required to run MET
export MET_TEST_INPUT=${MET_PROJ_DIR}/MET_test_data/unit_test
export MET_FONT_DIR=${MET_TEST_INPUT}/fonts

# Define Rscript to use a version with the ncdf4 package 1.17 or later
export MET_TEST_RSCRIPT=/nrit/ral/R-4.4.0/bin/Rscript

# Define runtime Python version
export MET_TEST_MET_PYTHON_EXE=${MET_PYTHON_BIN_EXE}

# This is a cron script -- create the shell environment for this job
# - NCO is for ncdiff
# - NetCDF is for ncdump.
export PATH="/nrit/ral/nco/bin:/nrit/ral/netcdf4/bin:\
/nrit/ral/sbin:/nrit/ral/bin:/usr/sbin:\
/usr/bin:/sbin:/bin:/usr/bin/X11:/opt/bin:$PATH"

# SonarQube
export SONARQUBE_DIR=/d1/projects/SonarQube/
export SONARQUBE_WRAPPER_BIN=$SONARQUBE_DIR/build-wrapper-linux-x86
export SONARQUBE_SCANNER_BIN=$SONARQUBE_DIR/sonar-scanner-linux/bin
18 changes: 9 additions & 9 deletions internal/scripts/installation/compile_MET_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,16 @@ elif [[ ${COMPILER_FAMILY} == *intel* && ${CC} == "icc" ]] || \
if [ -z ${F77} ]; then export F77=`which ifort`; fi
if [ -z ${F90} ]; then export F90=`which ifort`; fi
elif [[ ${COMPILER_FAMILY} == *intel* ]] && [[ ${CC} == *icx* ]]; then
export CXX=`which icpx`
export FC=`which ifx`
export F77=`which ifx`
export F90=`which ifx`
if [ -z ${CXX} ]; then export CXX=`which icpx`; fi
if [ -z ${FC} ]; then export FC=`which ifx`; fi
if [ -z ${F77} ]; then export F77=`which ifx`; fi
if [ -z ${F90} ]; then export F90=`which ifx`; fi
elif [[ ${COMPILER_FAMILY_SUFFIX} == oneapi ]]; then
export CC=`which icx`
export CXX=`which icpx`
export FC=`which ifx`
export F77=`which ifx`
export F90=`which ifx`
if [ -z ${CC} ]; then export CC=`which icc`; fi
if [ -z ${CXX} ]; then export CC=`which icx`; fi
if [ -z ${FC} ]; then export CXX=`which icpx`; fi
if [ -z ${F77} ]; then export FC=`which ifx`; fi
if [ -z ${F90} ]; then export F90=`which ifx`; fi
else
echo "ERROR: \${COMPILER} must start with gnu, intel, ics, ips, intel-classic, PrgEnv-intel, or pgi"
exit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export MAKE_ARGS="-j 5"
# in the external_libs directory, no further edits are needed; however, users
# that have the pre-existing libraries not in the external_libs directory will
# need to update the paths to the appropriate location.
#export EXTERNAL_LIBS=${TEST_BASE}/external_libs
export EXTERNAL_LIBS=${TEST_BASE}/external_libs
#export COMPILE_ECKIT=1
#export COMPILE_ATLAS=1
#export MET_PROJ=${EXTERNAL_LIBS}
#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include
#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export MAKE_ARGS="-j 5"
# in the external_libs directory, no further edits are needed; however, users
# that have the pre-existing libraries not in the external_libs directory will
# need to update the paths to the appropriate location.
#export EXTERNAL_LIBS=${TEST_BASE}/external_libs
export EXTERNAL_LIBS=${TEST_BASE}/external_libs
#export COMPILE_ECKIT=1
#export COMPILE_ATLAS=1
#export MET_PROJ=${EXTERNAL_LIBS}
#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include
#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Find the directory this script is called from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Required
# Directory that is the root of the compile
export TEST_BASE=/d1/projects/MET/intel

# Required
# Format is compiler_version (e.g. gnu_8.3.0)
# Compiler options = gnu, intel, ics, ips, PrgEnv-intel, or pgi
# Version is used for gnu in compilation of BUFRLIB and HDF5
export COMPILER=intel-oneapi_2023.0.0

# Source the setvars.sh file for updates to the $PATH and $LD_LIBRARY_PATH
source /nrit/ral/intel/setvars.sh

# Set the values for the compilers
export FC=ifx
export F77=ifx
export F90=ifx
export CC=icx
export CXX=icpx

# Required
# Root directory for creating/untaring met source code - usually same as TEST_BASE
export MET_SUBDIR=${TEST_BASE}

# Required
# The name of the met tarbal usually downloaded with version from dtcenter.org and includes a version
# example - v12.0.0.tar.gz
export MET_TARBALL=v12.0.0.tar.gz

# Required
# Specify if machine useds modules for loading software
export USE_MODULES=FALSE

# Root directory of your python install, containing the bin, include, lib, and share directories
export MET_DST=/nrit/ral
export MET_PYTHON=${MET_DST}/met-python3

# Python ldflags created using python3-config
export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm"

# Python cflags created using python3-config
export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.10"

export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3.10

# Use MAKE_ARGS to sped up the compilation of the external libaries and/or MET
# MAKE_ARGS can be set "-j #" where # is replaced with the number of
# cores to use (as an integer) or to simply "-j" to use all available cores.
# Recommend setting to "-j 5" as some users have experienced problems with
# higher values or no # specified.
export MAKE_ARGS="-j 5"

# If users have already installed these libraries and would like to make use of
# them, uncomment out the export statements. If those pre-existing libraries are
# in the external_libs directory, no further edits are needed; however, users
# that have the pre-existing libraries not in the external_libs directory will
# need to update the paths to the appropriate location.
#export SKIP_MET=1
export EXTERNAL_LIBS=${TEST_BASE}/external_libs
#export COMPILE_ECKIT=1
#export COMPILE_ATLAS=1
#export COMPILE_HDF=1
#export COMPILE_HDFEOS=1
export COMPILE_CAIRO=1
export COMPILE_FREETYPE=1
export MET_PROJ=${EXTERNAL_LIBS}
export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include
export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib
export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include
export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib
export MET_GSL=${EXTERNAL_LIBS}
export MET_BUFRLIB=${EXTERNAL_LIBS}/lib
export BUFRLIB_NAME=-lbufr_4
export LIB_JASPER=${EXTERNAL_LIBS}/lib
export LIB_LIBPNG=${EXTERNAL_LIBS}/lib
export LIB_Z=${EXTERNAL_LIBS}/lib
export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib
export MET_GRIB2CINC=${EXTERNAL_LIBS}/include
export GRIB2CLIB_NAME=-lg2c
export MET_HDF5=${EXTERNAL_LIBS}
export MET_NETCDF=${EXTERNAL_LIBS}
export MET_ECKIT=${EXTERNAL_LIBS}
export MET_ATLAS=${EXTERNAL_LIBS}
export ADDTL_DIR=/var/autofs/mnt/linux-amd64/debian/bookworm/local/intel-2023.2.0.49397/compiler/2023.2.0/linux/compiler/lib/intel64_lin

# The optional libraries ecKit and atlas offer support for unstructured
# grids. The optional libraries HDF4, HDFEOS, FREETYPE, and CAIRO are
# used for the following, not widely used tools, MODIS-Regrid,
# lidar2nc, and MODE Graphics. To enable building of these libraries,
# set the compile flags for the library (e.g. COMPILE_ECKIT, COMPILE_ATLAS,
# COMPILE_HDF, COMPILE_HDFEOS) to any value in the environment config
# file. If these libraries have already been installed and don't need
# to be reinstalled, please supply values for the following environment
# variables in the input environment configuration file
# (install_met_env.<machine_name>): MET_ECKIT, MET_ATLAS, MET_HDF,
# MET_HDFEOS, MET_FREETYPEINC, MET_FREETYPELIB, MET_CAIROINC,
# MET_CAIROLIB.

0 comments on commit 8a06acd

Please sign in to comment.