From a68b91b88f18c86a5c929924dea3702498955ca8 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 8 Apr 2022 15:23:12 -0600 Subject: [PATCH] Next attempt to find MPI --- .github/actions/setup-spack-stack/action.yaml | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-spack-stack/action.yaml b/.github/actions/setup-spack-stack/action.yaml index 5c7037e9d..c32245050 100644 --- a/.github/actions/setup-spack-stack/action.yaml +++ b/.github/actions/setup-spack-stack/action.yaml @@ -33,10 +33,13 @@ runs: - name: os-setup shell: bash run: | - if [ "$RUNNER_OS" == "Linux" ]; then + if [[ "$RUNNER_OS" == "Linux" ]]; then # Install Curl headers. Executable exists by default in spack external find. sudo apt-get install libcurl4-openssl-dev + # Install git-lfs to avoid compilation errors of "go" with Intel + sudo apt-get install git-lfs + if [[ "${{ inputs.compiler }}" == "intel"* ]]; then cd /tmp wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB @@ -47,8 +50,9 @@ runs: sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mpi-devel echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile fi - elif [ "$RUNNER_OS" == "macOS" ]; then - echo "" + elif [[ "$RUNNER_OS" == "macOS" ]]; then + # Install git-lfs because go-boostrap is too old for macOS Monterey and Apple M1 processors + brew install git-lfs fi # Install Python poetry to avoid install errors in spack @@ -89,8 +93,8 @@ runs: export FFLAGS="-fallow-argument-mismatch" fi - export MPICH_VERSION="3.4.2" - export OPENMPI_VERSION="4.1.2" + export MPICH_VERSION="3.4.3" + export OPENMPI_VERSION="4.1.3" if [[ "${{ inputs.mpi }}" == "openmpi"* ]]; then wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-${OPENMPI_VERSION}.tar.gz @@ -124,8 +128,6 @@ runs: # So Spack can find external MPI export "PATH=$HOME/mpi/bin:${PATH}" - which mpicc - # LLVM Clang not in PATH, search for it specifically # Then, Fortran compilers are null, so set to gfortran # Add minimal compilers just to prevent other compilers from being used by accident @@ -139,7 +141,7 @@ runs: spack compiler find fi - # No external find for intel-oneapi-mpi + # No external find for intel-oneapi-mpi, and problems finding other MPI libraries as well # And no way to add object entry to list using "spack config add" # Add this first so "spack config add packages:" will append to this entry if [[ "${{ inputs.mpi }}" == "intel-oneapi-mpi" ]]; then @@ -151,6 +153,24 @@ runs: echo " externals:" >> ${SPACK_ENV}/spack.yaml echo " - spec: intel-oneapi-mpi@${impi_ver}" >> ${SPACK_ENV}/spack.yaml echo " prefix: /opt/intel/oneapi" >> ${SPACK_ENV}/spack.yaml + elif [[ "${{ inputs.mpi }}" == "mpich"* ]]; then + mpich_ver=${MPICH_VERSION} + echo "" >> ${SPACK_ENV}/spack.yaml + echo " packages:" >> ${SPACK_ENV}/spack.yaml + echo " mpich:" >> ${SPACK_ENV}/spack.yaml + echo " buildable: False" >> ${SPACK_ENV}/spack.yaml + echo " externals:" >> ${SPACK_ENV}/spack.yaml + echo " - spec: mpich@${mpich_ver}" >> ${SPACK_ENV}/spack.yaml + echo " prefix: $HOME/mpi" >> ${SPACK_ENV}/spack.yaml + elif [[ "${{ inputs.mpi }}" == "openmpi"* ]]; then + openmpi_ver=${OPENMPI_VERSION} + echo "" >> ${SPACK_ENV}/spack.yaml + echo " packages:" >> ${SPACK_ENV}/spack.yaml + echo " openmpi:" >> ${SPACK_ENV}/spack.yaml + echo " buildable: False" >> ${SPACK_ENV}/spack.yaml + echo " externals:" >> ${SPACK_ENV}/spack.yaml + echo " - spec: openmpi@${openmpi_ver}" >> ${SPACK_ENV}/spack.yaml + echo " prefix: $HOME/mpi" >> ${SPACK_ENV}/spack.yaml fi spack external find