diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake
index ce04cd10152dd4cadbee3d3c70b36f7a784f18c5..9cf81f938d1025472afc3bd86b8f562aea6ddca6 100644
--- a/scripts/cmake/DependenciesExternalProject.cmake
+++ b/scripts/cmake/DependenciesExternalProject.cmake
@@ -162,7 +162,9 @@ if(OGS_USE_PETSC)
 
     add_library(petsc SHARED IMPORTED)
     target_include_directories(petsc INTERFACE ${PETSC_INCLUDES})
-    set_target_properties(petsc PROPERTIES IMPORTED_LOCATION ${PETSC_LIBRARIES})
+    # Get first petsc lib as import location
+    list(GET PETSC_LIBRARIES 0 _first_petsc_lib)
+    set_target_properties(petsc PROPERTIES IMPORTED_LOCATION ${_first_petsc_lib})
     target_compile_definitions(petsc INTERFACE USE_PETSC)
 endif()
 
diff --git a/scripts/env/juwels/petsc.sh b/scripts/env/juwels/petsc.sh
index 57aa4847dd48cab0bd86f29ee3d900b2a615fd5e..5bff9e3d872aecdb3ec0899c92394257d7d71c54 100644
--- a/scripts/env/juwels/petsc.sh
+++ b/scripts/env/juwels/petsc.sh
@@ -1,10 +1,21 @@
-module load CMake/3.18.0
-module load GCC/10.3.0
-module load ParaStationMPI/5.4.10-1
-module load PETSc/3.14
+module load Stages/2023
+module load GCC/11.3.0
+module load OpenMPI/4.1.4
+module load CMake/3.23.1
+module load Ninja/1.10.2
+module load Python
+module load Eigen
+module load Boost
+module load git
+module load HDF5/1.12.2
+module load ScaLAPACK/2.2.0-fb
 
 export CC=mpicc
 export CXX=mpic++
 
-echo "Example config: cmake ../ogs -DCMAKE_BUILD_TYPE=Release -DOGS_USE_PETSC=ON"
-echo "Example run: srun bin/ogs -n 3 -t 2 -A ogs6hpc3 bin/ogs ../ogs/Tests/Data/EllipticPETSc/cube_1e3_neumann.prj"
+# CMake may spawn as many processes as available. This may overload the filesystem on JUWELS.
+# It is therefore necessary to limit the number of processes with CMAKE_BUILD_PARALLEL_LEVEL.
+export CMAKE_BUILD_PARALLEL_LEVEL=6
+
+echo "Example config: cmake --preset release-petsc"
+echo "Example run: srun -n 3 -t 2 -A ogs6hpc4 bin/ogs ../ogs/Tests/Data/EllipticPETSc/cube_1e3_neumann.prj"