PETSc Update

17 views
Skip to first unread message

Hammond, Glenn E

unread,
Aug 28, 2025, 10:55:17 AMAug 28
to pflotran-dev
PFLOTRAN Devs,

Just a heads up that I plan to update PFLOTRAN to the PETSc main branch in anticipation of the release of PETSc 3.24 coming this fall. Once complete, I will branch PFLOTRAN v7.0 and merge the update to the master branch.

I can use some help with updating documentation if anyone has time. 

Glenn

Frederick, Jennifer Mary

unread,
Sep 25, 2025, 5:02:06 PMSep 25
to pflotr...@googlegroups.com

Glenn,

Folks at Sandia have been having a hard time updating to v7. I worked on it for the past few days and finally was successful in compiling PETSc main and PFLOTRAN v7! However, there were things I needed to change in my PETSc configure script and in the PFLOTRAN code to get things to work. Here is what I had to do:

 

  1. In my PETSc configure scripts, I had the following compiler flags set (from ages ago): --CFLAGS='-g -O0' --CXXFLAGS='-g -O0' --FFLAGS='-g -O0 -Wno-unused-function'. It turns out that compiler flags in the configure script should be defined using the OPT flags instead. Doing this corrected my issues compiling PETSc main: --COPTFLAGS='-g -O0' --CXXOPTFLAGS='-g -O0' --FOPTFLAGS='-g -O0 -Wno-unused-function'. This is because the configure options CFLAGS, CXXFLAGS, and FFLAGS overwrite most of the flags that PETSc would use by default. To add to the default flags instead use COPTFLAGS, CXXOPTFLAGS, and FOPTFLAGS (these work for all uses of ./configure). The same holds for CUDAFLAGS, HIPFLAGS, and SYCLFLAGS.

 

  1. In PFLOTRAN, I had to get rid of a duplicate subroutine definition in petsc_utility.F90, remove a “use petscsys” statement in characteristic_curves_spline.F90, and add an include petscsys.h statement in pm_waste_form.F90. I made these in the branch jenn/v7test. With these changes, PFLOTRAN v7 compiled for me. As far as I know, I am the first person to compile PFLOTRAN v7 at Sandia, but it required these changes.

 

Did any other DEV compile PFLOTRAN v7 without making these changes? I am curious why these were needed for me. Is it my installation of gfortran? I am using GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, but this also happened with 9.4.

 

Jenn

--
You received this message because you are subscribed to the Google Groups "pflotran-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pflotran-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pflotran-dev/SA1PR09MB7838253E2E2EE66CA552D2AF9A3BA%40SA1PR09MB7838.namprd09.prod.outlook.com.

Hammond, Glenn E

unread,
Sep 26, 2025, 12:31:34 AMSep 26
to pflotr...@googlegroups.com
See my comments in red.

Glenn

From: 'Frederick, Jennifer Mary' via pflotran-dev <pflotr...@googlegroups.com>
Date: Thursday, September 25, 2025 at 2:02 PM
To: pflotr...@googlegroups.com <pflotr...@googlegroups.com>
Subject: RE: [EXTERNAL] [pflotran-dev: 6353] PETSc Update

Check twice before you click! This email originated from outside PNNL.

Glenn,

Folks at Sandia have been having a hard time updating to v7. I worked on it for the past few days and finally was successful in compiling PETSc main and PFLOTRAN v7! However, there were things I needed to change in my PETSc configure script and in the PFLOTRAN code to get things to work. Here is what I had to do:

 

  1. In my PETSc configure scripts, I had the following compiler flags set (from ages ago): --CFLAGS='-g -O0' --CXXFLAGS='-g -O0' --FFLAGS='-g -O0 -Wno-unused-function'. It turns out that compiler flags in the configure script should be defined using the OPT flags instead. Doing this corrected my issues compiling PETSc main: --COPTFLAGS='-g -O0' --CXXOPTFLAGS='-g -O0' --FOPTFLAGS='-g -O0 -Wno-unused-function'. This is because the configure options CFLAGS, CXXFLAGS, and FFLAGS overwrite most of the flags that PETSc would use by default. To add to the default flags instead use COPTFLAGS, CXXOPTFLAGS, and FOPTFLAGS (these work for all uses of ./configure). The same holds for CUDAFLAGS, HIPFLAGS, and SYCLFLAGS.


Overriding CFLAGS, CXXFLAGS and FFLAG will cause issues. Barry has chewed me out several times for doing so.... 


  1. In PFLOTRAN, I had to get rid of a duplicate subroutine definition in petsc_utility.F90, remove a “use petscsys” statement in characteristic_curves_spline.F90, and add an include petscsys.h statement in pm_waste_form.F90. I made these in the branch jenn/v7test. With these changes, PFLOTRAN v7 compiled for me. As far as I know, I am the first person to compile PFLOTRAN v7 at Sandia, but it required these changes.

A recent push to petsc-main caused the issue with PetscTestFile. main lacked the Fortran interface to the routine until recently. Barry is actively updating the Fortran interface prior to the release of 3.24.  

The "use petscsys" in characteristic_curves_spline.F90 should not be an issue, but it is not needed. The need for petscsys.h in pm_waste_form.F90 is puzzling as petscvec.h includes petscsys.h. I will merge an update tomorrow morning with all the above but the petscsys.h issue. I want to see if the issue still exists. I suspect that some of these issues are due to my use of Ubuntu 22.04. I don't plan to update ot 24.04 until PETSc's release of 3.24 next month.

 

Did any other DEV compile PFLOTRAN v7 without making these changes? I am curious why these were needed for me. Is it my installation of gfortran? I am using GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, but this also happened with 9.4.

 

Jenn

 

From: 'Hammond, Glenn E' via pflotran-dev <pflotr...@googlegroups.com>
Sent: Thursday, August 28, 2025 7:55 AM
To: pflotran-dev <pflotr...@googlegroups.com>
Subject: [EXTERNAL] [pflotran-dev: 6349] PETSc Update

 

PFLOTRAN Devs,

 

Just a heads up that I plan to update PFLOTRAN to the PETSc main branch in anticipation of the release of PETSc 3.24 coming this fall. Once complete, I will branch PFLOTRAN v7.0 and merge the update to the master branch.

 

I can use some help with updating documentation if anyone has time. 

 

Glenn

--
You received this message because you are subscribed to the Google Groups "pflotran-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pflotran-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pflotran-dev/SA1PR09MB7838253E2E2EE66CA552D2AF9A3BA%40SA1PR09MB7838.namprd09.prod.outlook.com.

--
You received this message because you are subscribed to the Google Groups "pflotran-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pflotran-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages