2. Using Source Package
In order to install from the source package, I need to load the dependencies. Some dependencies require me to load gcc/9.4 compiler. Someother dependency need me to load intel compiler. I am unable to load both these simulataneously in my HPC. Thus, I am unable to install using source package.
This looks like there is a problem with PETSc and the used Fortran compiler. I recommend asking the PETSc team to solve this issue if you need PETSc.
Otherwise, try installing preCICE without PETSc first.
Also, note that GCC 9.4 is an old version and may be problematic when using a newer preCICE version. The current baseline for preCICE is Ubuntu 22.04, which ships GCC 11.2.
You can install a new GCC with spack, add it as a compiler and then install preCICE including dependencies with this new GCC version.
Have you tried asking the system admins to provide a preCICE module for you? This could save you some hassle.
The last error message shows that spack is using gcc 9.4.0 though.
Also, have you tried using an older version of PETSc? spack install precice+petsc ^petsc@3.20?
Which error are you getting when installing preCICE without PETSc?