Skip to content

Commit

Permalink
Next attempt to find MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed Apr 8, 2022
1 parent 5aa05d3 commit 21ce595
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions .github/actions/setup-spack-stack/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -47,8 +50,8 @@ 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
echo " "
fi
# Install Python poetry to avoid install errors in spack
Expand Down Expand Up @@ -89,8 +92,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
Expand Down Expand Up @@ -123,8 +126,8 @@ runs:
# So Spack can find external MPI
export "PATH=$HOME/mpi/bin:${PATH}"
which mpicc
export MPICH_VERSION="3.4.3"
export OPENMPI_VERSION="4.1.3"
# LLVM Clang not in PATH, search for it specifically
# Then, Fortran compilers are null, so set to gfortran
Expand All @@ -139,7 +142,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
Expand All @@ -151,6 +154,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
Expand Down

0 comments on commit 21ce595

Please sign in to comment.