diff --git a/.github/workflows/ubuntu-ci-x86_64.yaml b/.github/workflows/ubuntu-ci-x86_64.yaml index 5afece5c1..912c9da95 100644 --- a/.github/workflows/ubuntu-ci-x86_64.yaml +++ b/.github/workflows/ubuntu-ci-x86_64.yaml @@ -145,6 +145,7 @@ jobs: # Next steps: synchronize source and build cache to a central/combined mirror? echo "Next steps ..." + ${SPACK_STACK_DIR}/util/ldd_check.py $SPACK_ENV 2>&1 | tee log.ldd_check spack clean -a spack module tcl refresh -y spack stack setup-meta-modules diff --git a/configs/common/modules_lmod.yaml b/configs/common/modules_lmod.yaml index ef895fb34..d8b853121 100644 --- a/configs/common/modules_lmod.yaml +++ b/configs/common/modules_lmod.yaml @@ -129,20 +129,15 @@ modules: 'MADIS_ROOT': '{prefix}' mapl: suffixes: - ^esmf@8.2.0~debug snapshot=none: 'esmf-8.2.0' - ^esmf@8.2.0+debug snapshot=none: 'esmf-8.2.0-debug' - ^esmf@8.3.0b09~debug snapshot=b09: 'esmf-8.3.0b09' - ^esmf@8.3.0b09+debug snapshot=b09: 'esmf-8.3.0b09-debug' - ^esmf@8.3.0~debug snapshot=none: 'esmf-8.3.0' - ^esmf@8.3.0+debug snapshot=none: 'esmf-8.3.0-debug' - ^esmf@8.4.0~debug snapshot=none: 'esmf-8.4.0' - ^esmf@8.4.0+debug snapshot=none: 'esmf-8.4.0-debug' - ^esmf@8.4.1~debug snapshot=none: 'esmf-8.4.1' - ^esmf@8.4.1+debug snapshot=none: 'esmf-8.4.1-debug' + # Keeping this as a reminder how to do snapshots + #^esmf@8.3.0b09~debug snapshot=b09: 'esmf-8.3.0b09' + #^esmf@8.3.0b09+debug snapshot=b09: 'esmf-8.3.0b09-debug' ^esmf@8.4.2~debug snapshot=none: 'esmf-8.4.2' ^esmf@8.4.2+debug snapshot=none: 'esmf-8.4.2-debug' ^esmf@8.5.0~debug snapshot=none: 'esmf-8.5.0' ^esmf@8.5.0+debug snapshot=none: 'esmf-8.5.0-debug' + ^esmf@8.6.0~debug snapshot=none: 'esmf-8.6.0' + ^esmf@8.6.0+debug snapshot=none: 'esmf-8.6.0-debug' openmpi: environment: set: diff --git a/configs/common/modules_tcl.yaml b/configs/common/modules_tcl.yaml index b9f43301d..9a8affb11 100644 --- a/configs/common/modules_tcl.yaml +++ b/configs/common/modules_tcl.yaml @@ -131,20 +131,15 @@ modules: 'MADIS_ROOT': '{prefix}' mapl: suffixes: - ^esmf@8.2.0~debug snapshot=none: 'esmf-8.2.0' - ^esmf@8.2.0+debug snapshot=none: 'esmf-8.2.0-debug' - ^esmf@8.3.0b09~debug snapshot=b09: 'esmf-8.3.0b09' - ^esmf@8.3.0b09+debug snapshot=b09: 'esmf-8.3.0b09-debug' - ^esmf@8.3.0~debug snapshot=none: 'esmf-8.3.0' - ^esmf@8.3.0+debug snapshot=none: 'esmf-8.3.0-debug' - ^esmf@8.4.0~debug snapshot=none: 'esmf-8.4.0' - ^esmf@8.4.0+debug snapshot=none: 'esmf-8.4.0-debug' - ^esmf@8.4.1~debug snapshot=none: 'esmf-8.4.1' - ^esmf@8.4.1+debug snapshot=none: 'esmf-8.4.1-debug' + # Keeping this as a reminder how to do snapshots + #^esmf@8.3.0b09~debug snapshot=b09: 'esmf-8.3.0b09' + #^esmf@8.3.0b09+debug snapshot=b09: 'esmf-8.3.0b09-debug' ^esmf@8.4.2~debug snapshot=none: 'esmf-8.4.2' ^esmf@8.4.2+debug snapshot=none: 'esmf-8.4.2-debug' ^esmf@8.5.0~debug snapshot=none: 'esmf-8.5.0' ^esmf@8.5.0+debug snapshot=none: 'esmf-8.5.0-debug' + ^esmf@8.6.0~debug snapshot=none: 'esmf-8.6.0' + ^esmf@8.6.0+debug snapshot=none: 'esmf-8.6.0-debug' openmpi: environment: set: diff --git a/configs/common/packages.yaml b/configs/common/packages.yaml index 86479ba50..05f1a946f 100644 --- a/configs/common/packages.yaml +++ b/configs/common/packages.yaml @@ -27,18 +27,15 @@ variants: +python cairo: variants: +pic - # Newer versions of CDO require the C++-17 standard, which doesn't - # work with all compilers that are currently in use in spack-stack - # When making changes here, also check Hercules/Casper site configs cdo: - version: ['2.0.5'] + version: ['2.2.0'] variants: ~openmp cmake: version: ['3.23.1'] variants: +ownlibs # Attention - when updating also check the various jcsda-emc-bundles env packages crtm: - version: ['2.4.0'] + version: ['2.4.0.1'] variants: +fix ecbuild: version: ['3.7.2'] @@ -49,10 +46,10 @@ version: ['5.11.4'] variants: +ui eckit: - version: ['1.24.4'] + version: ['1.24.5'] variants: linalg=eigen,lapack compression=lz4,bzip2 ecmwf-atlas: - version: ['0.35.0'] + version: ['0.35.1'] variants: +fckit +trans +tesselation +fftw ectrans: version: ['1.2.0'] @@ -80,9 +77,7 @@ fiat: version: ['1.2.0'] fms: - #version: ['2023.01'] - #variants: precision=32,64 +quad_precision +gfs_phys +openmp +pic constants=GFS build_type=Release - version: ['2023.02.01'] + version: ['2023.04'] variants: precision=32,64 +quad_precision +gfs_phys +openmp +pic constants=GFS build_type=Release +deprecated_io fontconfig: variants: +pic @@ -178,9 +173,8 @@ netcdf-cxx4: version: ['4.3.1'] netcdf-fortran: - version: ['4.6.0'] - # ninja - when adding information here, also check Cheyenne - # and Discover site configs + version: ['4.6.1'] + # ninja - when adding information here, also check Discover site config nlohmann-json: version: ['3.10.5'] nlohmann-json-schema-validator: diff --git a/configs/containers/specs/jedi-ci.yaml b/configs/containers/specs/jedi-ci.yaml index c97f23e5e..2483b8a2f 100644 --- a/configs/containers/specs/jedi-ci.yaml +++ b/configs/containers/specs/jedi-ci.yaml @@ -1,14 +1,14 @@ - ### spack-stack-1.5.1 / skylab-6.1.0 containers for fv3-jedi and mpas-jedi (but not for ufs-jedi) + ### spack-stack-1.6.0 / skylab-7.0.0 containers for fv3-jedi and mpas-jedi (but not for ufs-jedi) specs: [base-env@1.0.0, jedi-base-env@1.0.0, ewok-env@1.0.0, jedi-fv3-env@1.0.0, jedi-mpas-env@1.0.0, bacio@2.4.1, bison@3.8.2, bufr@12.0.1, ecbuild@3.7.2, eccodes@2.27.0, ecflow@5, - eckit@1.24.4, ecmwf-atlas@0.35.0 +fckit +trans +tesselation +fftw, fiat@1.2.0, ectrans@1.2.0 +fftw, + eckit@1.24.5, ecmwf-atlas@0.35.1 +fckit +trans +tesselation +fftw, fiat@1.2.0, ectrans@1.2.0 +fftw, eigen@3.4.0, fckit@0.11.0, fms@release-jcsda, g2@3.4.5, g2tmpl@1.10.2, gftl-shared@1.6.1, gsibec@1.1.3, hdf@4.2.15, hdf5@1.14.0, ip@4.3.0, jasper@2.0.32, jedi-cmake@1.4.0, libpng@1.6.37, nccmp@1.9.0.1, netcdf-c@4.9.2, netcdf-cxx4@4.3.1, - netcdf-fortran@4.6.0, nlohmann-json@3.10.5, nlohmann-json-schema-validator@2.1.0, + netcdf-fortran@4.6.1, nlohmann-json@3.10.5, nlohmann-json-schema-validator@2.1.0, parallelio@2.5.10, parallel-netcdf@1.12.2, py-eccodes@1.4.2, py-f90nml@1.4.3, py-gitpython@3.1.27, py-h5py@3.7.0, py-numpy@1.22.3, - py-pandas@1.5.3, py-pip, py-pyyaml@5.4.1, py-scipy@1.9.3, py-shapely@1.8.0, py-xarray@2022.3.0, + py-pandas@1.5.3, py-pip, py-pyyaml@6.0, py-scipy@1.9.3, py-shapely@1.8.0, py-xarray@2023.7.0, sp@2.5.0, udunits@2.2.28, w3nco@2.4.1, w3emc@2.10.0, nco@5.0.6, esmf@8.5.0, mapl@2.40.3, zlib@1.2.13, zstd@1.5.2, odc@1.4.6, shumlib@macos_clang_linux_intel_port, awscli-v2@2.13.22, py-globus-cli@3.16.0] @@ -17,4 +17,3 @@ # 2. Comment out for now until build problems are solved # https://github.com/jcsda/spack-stack/issues/522 # py-mysql-connector-python@8.0.32 - # 3. Need to update bufr@12.0.0 to 12.0.1! diff --git a/configs/sites/casper/packages.yaml b/configs/sites/casper/packages.yaml index af221309e..6468964f4 100644 --- a/configs/sites/casper/packages.yaml +++ b/configs/sites/casper/packages.yaml @@ -17,9 +17,6 @@ packages: - cuda/12.2.1 ### Modifications of common packages - # Version 2.0.5 doesn't compile on Casper with gcc - cdo: - version:: ['2.2.0'] ### All other external packages listed alphabetically autoconf: diff --git a/configs/sites/hercules/packages.yaml b/configs/sites/hercules/packages.yaml index 4322b61e5..c71b30cf1 100644 --- a/configs/sites/hercules/packages.yaml +++ b/configs/sites/hercules/packages.yaml @@ -22,12 +22,9 @@ packages: - mvapich2/2.3.7 ### Modifications of common packages - # Version 2.0.5 doesn't compile on Hercules with gcc - cdo: - version:: ['2.2.0'] - # Version 2.0.8 doesn't compile on Hercules - wgrib2: - version:: ['3.1.1'] + # DH* TRY IF THIS IS STILL TRUE # Version 2.0.8 doesn't compile on Hercules + # DH* TRY IF THIS IS STILL TRUE wgrib2: + # DH* TRY IF THIS IS STILL TRUE version:: ['3.1.1'] ### All other external packages listed alphabetically autoconf: diff --git a/configs/sites/noaa-aws/README.md b/configs/sites/noaa-aws/README.md index 887c69a9c..254f1db76 100644 --- a/configs/sites/noaa-aws/README.md +++ b/configs/sites/noaa-aws/README.md @@ -1,6 +1,6 @@ This README provides step by step instructions for installing the basic packages (OS packages, external packages) for spack-stack. Following these steps ensures -that the site configuration files in `configs/sites/noaa-*` work out of the box. +that the site configuration files in `configs/sites/noaa-aws` work out of the box. # Basic system packages (need to be installed each time a cluster is spun up) @@ -124,3 +124,14 @@ make install 2>&1 | tee log.install cd /contrib/spack-stack/modulefiles mkdir ecflow # Create the modulefile from the template in doc/modulefile_templates + +############## Steps to perform when starting a new cluster ############## +source /contrib/admin/basic_setup.sh # sudo privileges requred to install packages +module unuse /opt/cray/craype/default/modulefiles +module unuse /opt/cray/modulefiles +module use /contrib/spack-stack/modulefiles +module load cmake/3.27.2 +module load ecflow/5.8.4 +module load mysql/8.0.31 +module load git-lfs/2.4.1 + diff --git a/configs/sites/noaa-azure/README.md b/configs/sites/noaa-azure/README.md new file mode 100644 index 000000000..600c61a61 --- /dev/null +++ b/configs/sites/noaa-azure/README.md @@ -0,0 +1,143 @@ +This README provides step by step instructions for installing the basic packages +(OS packages, external packages) for spack-stack. Following these steps ensures +that the site configuration files in `configs/sites/noaa-azure` work out of the box. + +# Basic system packages (need to be installed each time a cluster is spun up) + +sudo su +chmod 777 /contrib +yum install -y m4 +yum install -y qt5-qtbase-devel +yum install -y qt5-qtsvg-devel +yum install -y xorg-x11-xauth +yum install -y xorg-x11-apps +yum install -y perl-IPC-Cmd +yum install -y gettext-devel +yum install -y ncurses-devel +yum install -y ncurses-static +exit + +# Create a script that can be added to the cluster resource config so that these packages get installed automatically + +mkdir -p /contrib/admin +cat < /contrib/admin/basic_setup.sh +#!/bin/bash + +chmod 777 /contrib +yum install -y qt5-qtbase-devel +yum install -y qt5-qtsvg-devel +yum install -y xorg-x11-xauth +yum install -y xorg-x11-apps +yum install -y perl-IPC-Cmd +yum install -y gettext-devel +yum install -y ncurses-devel +yum install -y ncurses-static +yum install -y m4 +EOF + +chmod a+x /contrib/admin/basic_setup.sh + +# Create a mysql config for local R2D2 use (if applicable) + +sudo su +cat < /contrib/admin/my.cnf +[mysqld] +datadir=/mysql_local/data +socket=/mysql_local/data/mysql.sock +symbolic-links=0 +default-authentication-plugin=mysql_native_password + +[mysqld_safe] +log-error=/mysql_local/log/mariadb.log +pid-file=/mysql_local/run/mariadb.pid +EOF +chmod 644 /contrib/admin/my.cnf +exit + +# Build external packages for spack-stack + +mkdir -p /contrib/spack-stack +mkdir /contrib/spack-stack/modulefiles +cd /contrib/spack-stack/ + +mkdir -p git-lfs-2.4.1/src +cd git-lfs-2.4.1/src +wget http://mirror.centos.org/centos/7/sclo/x86_64/rh/Packages/r/rh-git218-git-lfs-2.4.1-3.el7.x86_64.rpm +rpm2cpio rh-git218-git-lfs-2.4.1-3.el7.x86_64.rpm | cpio -idmv +mv opt/rh/rh-git218/root/usr/* .. +rm -fr opt +cd /contrib/spack-stack/modulefiles +mkdir git-lfs +# Create the modulefile from the template in doc/modulefile_templates + +cd /contrib/spack-stack/ +mkdir -p mysql-8.0.31/src +cd mysql-8.0.31/src +ldd --version +wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.31-linux-glibc2.17-x86_64-minimal.tar.xz +tar -xvf mysql-8.0.31-linux-glibc2.17-x86_64-minimal.tar.xz +mv mysql-8.0.31-linux-glibc2.17-x86_64-minimal/* .. +rmdir mysql-8.0.31-linux-glibc2.17-x86_64-minimal +cd /contrib/spack-stack/modulefiles +mkdir mysql +# Create the modulefile from the template in doc/modulefile_templates + +cd /contrib/spack-stack/ +mkdir -p cmake-3.27.2/src +cd cmake-3.27.2/src +wget https://github.com/Kitware/CMake/releases/download/v3.27.2/cmake-3.27.2-linux-x86_64.tar.gz +tar -xvzf cmake-3.27.2-linux-x86_64.tar.gz +mv cmake-3.27.2-linux-x86_64/* .. +rmdir cmake-3.27.2-linux-x86_64 +cd /contrib/spack-stack/modulefiles +mkdir cmake +# Create the modulefile from the template in doc/modulefile_templates + +# Set up basic modules for building the external ecflow package +module unuse /opt/cray/craype/default/modulefiles +module unuse /opt/cray/modulefiles + +module purge +module load gnu/9.2.0 +module use /contrib/spack-stack/modulefiles +module load cmake/3.27.2 + +mkdir -p /contrib/spack-stack/ecflow-5.8.4/src +cd /contrib/spack-stack/ecflow-5.8.4/src +wget https://confluence.ecmwf.int/download/attachments/8650755/ecFlow-5.8.4-Source.tar.gz?api=v2 +wget https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz +mv ecFlow-5.8.4-Source.tar.gz\?api\=v2 ecFlow-5.8.4-Source.tar.gz +tar -xvzf boost_1_78_0.tar.gz +tar -xvzf ecFlow-5.8.4-Source.tar.gz +export WK=/contrib/spack-stack/ecflow-5.8.4/src/ecFlow-5.8.4-Source +export BOOST_ROOT=/contrib/spack-stack/ecflow-5.8.4/src/boost_1_78_0 + +# Build static boost (to not interfere with spack-stack boost) +cd $BOOST_ROOT +./bootstrap.sh 2>&1 | tee bootstrap.log +$WK/build_scripts/boost_build.sh 2>&1 | tee boost_build.log + +# Build ecFlow +cd $WK +mkdir build +cd build +cmake .. -DCMAKE_INSTALL_PREFIX=/contrib/spack-stack/ecflow-5.8.4 2>&1 | tee log.cmake +make -j4 2>&1 | tee log.make +make install 2>&1 | tee log.install + +cd /contrib/spack-stack/modulefiles +mkdir ecflow +# Create the modulefile from the template in doc/modulefile_templates + +############## Steps to perform when starting a new cluster ############## +source /contrib/admin/basic_setup.sh # sudo privileges requred to install packages +module unuse /opt/cray/craype/default/modulefiles +module unuse /opt/cray/modulefiles +module use /contrib/spack-stack/modulefiles +module load cmake/3.27.2 +module load ecflow/5.8.4 +module load mysql/8.0.31 +module load git-lfs/2.4.1 +# + + diff --git a/configs/sites/noaa-azure/packages.yaml b/configs/sites/noaa-azure/packages.yaml index b9c2915b1..886727adf 100644 --- a/configs/sites/noaa-azure/packages.yaml +++ b/configs/sites/noaa-azure/packages.yaml @@ -134,6 +134,10 @@ packages: externals: - spec: mysql@8.0.31 prefix: /contrib/spack-stack/mysql-8.0.31 + ncurses: + externals: + - spec: ncurses@5.9-14.20130511+termlib abi=5 + prefix: /usr openjdk: externals: - spec: openjdk@1.8.0_322-b06 diff --git a/configs/sites/noaa-gcloud/README.md b/configs/sites/noaa-gcloud/README.md new file mode 100644 index 000000000..090a09b1e --- /dev/null +++ b/configs/sites/noaa-gcloud/README.md @@ -0,0 +1,137 @@ +This README provides step by step instructions for installing the basic packages +(OS packages, external packages) for spack-stack. Following these steps ensures +that the site configuration files in `configs/sites/noaa-gcloud` work out of the box. + +# Basic system packages (need to be installed each time a cluster is spun up) + +sudo su +chmod 777 /contrib +yum install -y qt5-qtbase-devel +yum install -y qt5-qtsvg-devel +yum install -y xorg-x11-xauth +yum install -y xorg-x11-apps +yum install -y perl-IPC-Cmd +yum install -y gettext-devel +yum install -y m4 +exit + +# Create a script that can be added to the cluster resource config so that these packages get installed automatically + +mkdir -p /contrib/admin +cat < /contrib/admin/basic_setup.sh +#!/bin/bash + +chmod 777 /contrib +yum install -y qt5-qtbase-devel +yum install -y qt5-qtsvg-devel +yum install -y xorg-x11-xauth +yum install -y xorg-x11-apps +yum install -y perl-IPC-Cmd +yum install -y gettext-devel +yum install -y m4 +EOF + +chmod a+x /contrib/admin/basic_setup.sh + +# Create a mysql config for local R2D2 use (if applicable) + +sudo su +cat < /contrib/admin/my.cnf +[mysqld] +datadir=/mysql_local/data +socket=/mysql_local/data/mysql.sock +symbolic-links=0 +default-authentication-plugin=mysql_native_password + +[mysqld_safe] +log-error=/mysql_local/log/mariadb.log +pid-file=/mysql_local/run/mariadb.pid +EOF +chmod 644 /contrib/admin/my.cnf +exit + +# Build external packages for spack-stack + +mkdir -p /contrib/spack-stack +mkdir /contrib/spack-stack/modulefiles +cd /contrib/spack-stack/ + +mkdir -p git-lfs-2.4.1/src +cd git-lfs-2.4.1/src +wget http://mirror.centos.org/centos/7/sclo/x86_64/rh/Packages/r/rh-git218-git-lfs-2.4.1-3.el7.x86_64.rpm +rpm2cpio rh-git218-git-lfs-2.4.1-3.el7.x86_64.rpm | cpio -idmv +mv opt/rh/rh-git218/root/usr/* .. +rm -fr opt +cd /contrib/spack-stack/modulefiles +mkdir git-lfs +# Create the modulefile from the template in doc/modulefile_templates + +cd /contrib/spack-stack/ +mkdir -p mysql-8.0.31/src +cd mysql-8.0.31/src +ldd --version +wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.31-linux-glibc2.17-x86_64-minimal.tar.xz +tar -xvf mysql-8.0.31-linux-glibc2.17-x86_64-minimal.tar.xz +mv mysql-8.0.31-linux-glibc2.17-x86_64-minimal/* .. +rmdir mysql-8.0.31-linux-glibc2.17-x86_64-minimal +cd /contrib/spack-stack/modulefiles +mkdir mysql +# Create the modulefile from the template in doc/modulefile_templates + +cd /contrib/spack-stack/ +mkdir -p cmake-3.27.2/src +cd cmake-3.27.2/src +wget https://github.com/Kitware/CMake/releases/download/v3.27.2/cmake-3.27.2-linux-x86_64.tar.gz +tar -xvzf cmake-3.27.2-linux-x86_64.tar.gz +mv cmake-3.27.2-linux-x86_64/* .. +rmdir cmake-3.27.2-linux-x86_64 +cd /contrib/spack-stack/modulefiles +mkdir cmake +# Create the modulefile from the template in doc/modulefile_templates + +# Set up basic modules for building the external ecflow package +module unuse /opt/cray/craype/default/modulefiles +module unuse /opt/cray/modulefiles + +module purge +module load gnu/9.2.0 +module use /contrib/spack-stack/modulefiles +module load cmake/3.27.2 + +mkdir -p /contrib/spack-stack/ecflow-5.8.4/src +cd /contrib/spack-stack/ecflow-5.8.4/src +wget https://confluence.ecmwf.int/download/attachments/8650755/ecFlow-5.8.4-Source.tar.gz?api=v2 +wget https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz +mv ecFlow-5.8.4-Source.tar.gz\?api\=v2 ecFlow-5.8.4-Source.tar.gz +tar -xvzf boost_1_78_0.tar.gz +tar -xvzf ecFlow-5.8.4-Source.tar.gz +export WK=/contrib/spack-stack/ecflow-5.8.4/src/ecFlow-5.8.4-Source +export BOOST_ROOT=/contrib/spack-stack/ecflow-5.8.4/src/boost_1_78_0 + +# Build static boost (to not interfere with spack-stack boost) +cd $BOOST_ROOT +./bootstrap.sh 2>&1 | tee bootstrap.log +$WK/build_scripts/boost_build.sh 2>&1 | tee boost_build.log + +# Build ecFlow +cd $WK +mkdir build +cd build +cmake .. -DCMAKE_INSTALL_PREFIX=/contrib/spack-stack/ecflow-5.8.4 2>&1 | tee log.cmake +make -j4 2>&1 | tee log.make +make install 2>&1 | tee log.install + +cd /contrib/spack-stack/modulefiles +mkdir ecflow +# Create the modulefile from the template in doc/modulefile_templates + +############## Steps to perform when starting a new cluster ############## +source /contrib/admin/basic_setup.sh # sudo privileges requred to install packages +module unuse /opt/cray/craype/default/modulefiles +module unuse /opt/cray/modulefiles +module use /contrib/spack-stack/modulefiles +module load cmake/3.27.2 +module load ecflow/5.8.4 +module load mysql/8.0.31 +module load git-lfs/2.4.1 + diff --git a/configs/templates/skylab-dev/spack.yaml b/configs/templates/skylab-dev/spack.yaml index 886c9023e..e9df7134b 100644 --- a/configs/templates/skylab-dev/spack.yaml +++ b/configs/templates/skylab-dev/spack.yaml @@ -18,12 +18,10 @@ spack: # Various fms tags (list all to avoid duplicate packages) - fms@release-jcsda - - fms@2023.01 - - fms@2023.02.01 - - fms@2023.03 + - fms@2023.04 # Various crtm tags (list all to avoid duplicate packages) - - crtm@2.4.0 + - crtm@2.4.0.1 - crtm@v2.4.1-jedi specs: diff --git a/configs/templates/unified-dev/spack.yaml b/configs/templates/unified-dev/spack.yaml index 1b0983c2a..c3b622679 100644 --- a/configs/templates/unified-dev/spack.yaml +++ b/configs/templates/unified-dev/spack.yaml @@ -28,12 +28,10 @@ spack: # Various fms tags (list all to avoid duplicate packages) - fms@release-jcsda - - fms@2023.01 - - fms@2023.02.01 - - fms@2023.03 + - fms@2023.04 # Various crtm tags (list all to avoid duplicate packages) - - crtm@2.4.0 + - crtm@2.4.0.1 - crtm@v2.4.1-jedi # MADIS for WCOSS2 decoders. diff --git a/doc/source/Utilities.rst b/doc/source/Utilities.rst index fad759688..9e8a81a39 100644 --- a/doc/source/Utilities.rst +++ b/doc/source/Utilities.rst @@ -28,6 +28,20 @@ check_permissions.sh The utility located at util/check_permissions.sh can be run inside any spack-stack environment directory intended for multiple users (i.e., on an HPC or cloud platform). It will return errors if the environment directory is inaccessible to non-owning users and groups (i.e., if o+rx not set), as well as if any directories or files have permissions that make them inaccessible to other users. +.. _LDD_Checker: + +------------------------------ +ldd_check.py +------------------------------ + +The util/ldd_check.py utility should be run for new installations to ensure that no shared library or executable that uses shared libraries is missing a shared library dependency. If the script returns a warning for a given file, this may indicate that Spack's RPATH substitution has not been properly applied. In some instances, missing library dependencies may not indicate a problem, such as a library that is intended to be found through $LD_LIBRARY_PATH after, say, a compiler or MPI environment module is loaded. Though these paths should probably also be RPATH-ified, such instances of harmless missing dependencies may be ignored with ldd_check.py's ``--ignore`` option by specifying a Python regular expression to be excluded from consideration (see example below), or can be permanently whitelisted by modifying the ``whitelist`` variable at the top of the ldd_check.py script itself (in which case please submit a PR). The script searches the 'install/' subdirectory of a given path and runs ``ldd`` on all shared objects. The base path to be search can be specified as a lone positional argument, and by default is the current directory. In practice, this should be ``$SPACK_ENV`` for the environment in question. + +.. code-block:: console + + cd $SPACK_ENV && ../../util/ldd_check.py + # - OR - + util/ldd_check.py $SPACK_ENV --ignore '^libfoo.+' # check for missing shared dependencies, but ignore missing libfoo* + .. _Acorn_Utilities: ------------------------------ diff --git a/util/ldd_check.py b/util/ldd_check.py new file mode 100755 index 000000000..af6d3fa77 --- /dev/null +++ b/util/ldd_check.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 + +# Whitelist file patterns (checked with re.match()) that will be satisfied by +# compiler & MPI modules (though arguably these should be added as extra +# rpaths). +whitelist = [ + "^libmkl.+", + "^libifcore.so.*", +] + +######## + +import argparse +import glob +import os +import platform +import re +import subprocess +import sys + +parser = argparse.ArgumentParser(description="Check executables and shared libraries for missing dependencies") + +parser.add_argument( + "path", + nargs="?", + default=os.getcwd(), + help="Spack environment path ($SPACK_ENV) that contains install/ subdirectory (default: current directory)", +) +parser.add_argument( + "--progress", + "-p", + action="store_true", + help="Print progress to stderr", +) +parser.add_argument( + "--ignore", + "-i", + action="append", + help="Ignore pattern (Python re expression, e.g., '^libfoo.+')", +) + +args = parser.parse_args() + +if args.ignore: + whitelist.extend(args.ignore) + +platform = platform.system() +if platform=="Linux": + ldd_cmd = "ldd" + error_pattern = " => not found" + getlibname = lambda line: re.findall("^[^ ]+", line)[0] +elif platform=="Darwin": + print("macOS not yet supported", file=sys.stderr) + sys.exit(1) +else: + print(f"Platform '{platform}' not supported", file=sys.stderr) + sys.exit(1) + +searchpath = os.path.join(args.path, "install") + +bin_list = glob.glob(os.path.join(searchpath, "*/*/*/bin/*")) +dlib_list = glob.glob(os.path.join(searchpath, "*/*/*/lib*/*.{so,dylib}")) + +master_list = bin_list + dlib_list + +assert master_list, "No files found! Check directory and ensure it contains install/ subdirectory" + +iret = 0 + +for i in range(len(master_list)): + file_to_check = master_list[i] + if args.progress: print(f"\rProgress: {i+1}/{len(master_list)}", file=sys.stderr, end="") + p = subprocess.Popen([ldd_cmd, file_to_check], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + raw_output, null = p.communicate() + output = raw_output.decode(sys.stdout.encoding).strip() + if error_pattern in output: + missing_set = set([getlibname(l.strip()) for l in output.split("\n") if error_pattern in l]) + missing_list = [l for l in missing_set if not any([re.match(p, l) for p in whitelist])] + if not missing_list: continue + missing_output = ",".join(sorted(missing_list)) + print(f"\rWARNING: File {file_to_check} contains the following missing libraries: {missing_output}") + iret = 1 + +if args.progress: print() + +sys.exit(iret)