Have problem about linking PETSC when install dolfinx using spack

Hello I tried to installed dolfinx on a HPC machine using spack, I followed this guide

but changed the version to 0.7.2 since my code is written in this version. (I believe 0.7.2 is one of the safe version in spack.)
So I replace the command to:

spack add fenics-dolfinx@0.7.2+adios2 py-fenics-dolfinx cflags="-O3" fflags="-O3"

But when I tried to compile my codes, I got the error message:

/proj/naiss2024-23-125/local/Work/spack/opt/spack/linux-centos7-broadwell/gcc-13.2.0/petsc-3.22.3-je3j3by35teir4hdfbsimwwa3l3kkls5/lib/libpetsc.so: undefined reference to `MPI_Neighbor_alltoallv_init'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/demo_poisson.dir/build.make:126: demo_poisson] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/demo_poisson.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

so it seems there is something wrong with the installation os PETSC. Does anyone has any suggestion or comment regarding my problem?
Thanks a lot!

Seems like it is picking up a wrong/not modern enough mpi version. Could you check what you get with mpirun —version and which mpirun?

Thanks for quick replying, here is the output:

-bash-4.2$ mpirun -version
mpirun (Open MPI) 5.0.6

Report bugs to https://www.open-mpi.org/community/help/

and

-bash-4.2$ which mpirun
/crex/proj/uppstore2017025/local/Work/spack/opt/spack/linux-centos7-broadwell/gcc-13.2.0/openmpi-5.0.6-6nysh7af27lxacxcz24rygtjhb752sb5/bin/mpirun

Hm, that is the latest version of mpich. Seems strange that it doesn’t find

It should be part of your openmpi installation

https://docs.open-mpi.org/en/v5.0.6/man-openmpi/man3/MPI_Neighbor_alltoallv_init.3.html

Could you try pinning the PETSC version to an older version than 3.22?

Hi I tried to install petsc@3.21.0 but still get the same problem, here is the packages I have installed:

-bash-4.2$ spack find petsc
==> In environment fenicsx-env
==> 3 root specs
[+] fenics-dolfinx@0.7.2 +adios2  [+] petsc@3.21.0  [+] py-fenics-dolfinx  cflags=-O3 fflags=-O3 

-- linux-centos7-broadwell / gcc@13.2.0 -------------------------
petsc@3.21.0
==> 1 installed package
==> 0 concretized packages to be installed (show with `spack find -c`)

Oh, I just cleaned the old cache and configuration, now it works. Thanks!