Unable to install LAMMPS+PLUMED on GPU

I want to run biased simulation with LAMMPS + PLUMED and I want to run them on GPU.

I could install LAMMPS + PLUMED on CPUs and LAMMPS on GPUs, but when I set both, the PLUMED and the GPU package to yes, there are errors.

The exact command I use to install is:

#!/bin/bash

wget https://download.lammps.org/tars/lammps.tar.gz 
rm -r lammps-gpu-plumed
mkdir lammps-gpu-plumed && tar xf lammps.tar.gz -C lammps-gpu-plumed --strip-components 1

cd lammps-gpu-plumed
rm -r build; mkdir build
cd build

spack unload --all
spack load /lneghc5 # [email protected]
spack load /jjak3m4 # [email protected]
spack load /n4umuoq # plumed 2.9
spack load /du2i3iz 
spack load /dofbtkg 
spack load /buybdha 
spack load /b74lmhc
spack load /5adixt7
spack load /7kcqcor


cmake ../cmake -D LAMMPS_MACHINE=gpu -D PKG_PLUMED=yes -D DOWNLOAD_PLUMED=yes -D PKG_MPI=yes -D PKG_EXTRA-FIX=yes -D PKG_MOLECULE=yes -D PKG_H5MD=yes -D PKG_EXTRA-PAIR=yes -D PKG_MANYBODY=yes -D PKG_DPD-BASIC=yes -D PKG_RIGID=yes -D PKG_KSPACE=yes -D PKG_GPU=yes -D GPU_API=opencl -D GPU_ARCH=sm_86

cmake ../cmake 
cmake --build . -j 

I am attatching the log file which has all the details when I run the aforementioned commands.

Could someone help me resolve this issue?

Thank you
log (97.3 KB)

I solved this issue by using GCC 12.3.0