FindMPI: hipcc 4.1 w/ OpenMPI
I realized in our CI (WarpX, ECP), that since the update this week from 3.19.6 to 3.19.7, CMake cannot find OpenMPI anymore if one compiles with AMD's hipcc
(in parallel version 4.0.20496-4f163c68 updated to 4.1.21072-c3eb5ccc).
The packages installed are: https://github.com/ECP-WarpX/WarpX/blob/development/.github/workflows/dependencies/hip.sh
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key \
| sudo apt-key add -
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' \
| sudo tee /etc/apt/sources.list.d/rocm.list
echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin' \
| sudo tee -a /etc/profile.d/rocm.sh
# we should not need to export HIP_PATH=/opt/rocm/hip with those installs
sudo apt-get update
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#installing-development-packages-for-cross-compilation
# meta-package: rocm-dkms
# OpenCL: rocm-opencl
# other: rocm-dev rocm-utils
sudo apt-get install -y --no-install-recommends \
build-essential \
gfortran \
libnuma-dev \
libopenmpi-dev \
openmpi-bin \
rocm-dev \
rocfft \
rocrand
# activate
#
source /etc/profile.d/rocm.sh
Generic HIP + MPI config call:
source /etc/profile.d/rocm.sh
hipcc --version # 4.1.21072-c3eb5ccc
export CXX=$(which hipcc)
export CC=$(which hipcc)
cmake -S . -B build -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build build -j 2
The error message is:
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1")
CMake Error at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find MPI (missing: MPI_C_FOUND C) (found version "3.1")
Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled.
Note that the "reason messsage" is likely tainted by !5801 (merged) (unless this one was backported to 3.19.7).
CI action history: https://github.com/ECP-WarpX/WarpX/commits/development
Edited by Axel Huebl