does not compile against PETSc3.2

Bug #1017830 reported by Johan Hake
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libadjoint
In Progress
Undecided
Unassigned

Bug Description

Changes in PETSc interface make libadjoint not compile against PETSc3.2. Possibly other versions too, but that is the one I have installed. The pasted diff fixes the compilation:

=== modified file 'src/adj_petsc_data_structures.c'
--- src/adj_petsc_data_structures.c 2012-03-06 14:10:17 +0000
+++ src/adj_petsc_data_structures.c 2012-06-25 09:26:45 +0000
@@ -165,7 +165,7 @@
   Vec *vec=(Vec*) malloc(sizeof(Vec));
   PetscViewer viewer;
   PetscViewerBinaryOpen(PETSC_COMM_WORLD, filename, FILE_MODE_READ, &viewer);
- VecLoad(viewer, PETSC_NULL, vec);
+ VecLoad(vec, viewer);
   PetscViewerDestroy(viewer);
   *x = petsc_vec_to_adj_vector(vec);
 #else
@@ -220,7 +220,8 @@
 #ifdef HAVE_PETSC
     KSP ksp; /* linear solver context */
     PC pc; /* preconditioner context */
- PetscTruth assembled;
+ PetscBool assembled;
+ //bool assembled;

     MatAssembled(*(Mat*) &mat, &assembled);
     if (!assembled)

This should ofcourse be put in appropriate #ifdefs :)

Revision history for this message
Patrick Farrell (pefarrell) wrote :

Hi Johan,

Thanks for that bug and the patch. Can you try the confirm the latest trunk fixes the issue? (I don't have PETsc 3.2 handy here)

Changed in libadjoint:
status: New → Incomplete
status: Incomplete → In Progress
Revision history for this message
Tim Greaves (tim-greaves) wrote :

Compilation is now fixed with 3.2, but it's now failing in tests, see:

 https://launchpadlibrarian.net/123855900/buildlog_ubuntu-quantal-amd64.libadjoint_0.1-0%7E263%7Equantal1_FAILEDTOBUILD.txt.gz

for an example failure from debuild on quantal on the launchpad builders.

The relevent part being:

   dh_auto_test -a
 make -j1 test
make[1]: Entering directory `/build/buildd/libadjoint-0.1'
  FC bin/tests/test_adj_dictionary
  FC bin/tests/test_adj_get_adjoint_equation_block_action
  CC bin/tests/test_adj_iteration_count
  FC bin/tests/test_adj_nonlinear_derivative_action_callback
In file included from src/tests/test_adj_nonlinear_derivative_action_callback.F90:8:0:
include/libadjoint/adj_petsc_f.h:1:0: fatal error: petscversion.h: No such file or directory
compilation terminated.
make[1]: *** [bin/tests/test_adj_nonlinear_derivative_action_callback] Error 1
make[1]: Leaving directory `/build/buildd/libadjoint-0.1'
dh_auto_test: make -j1 test returned exit code 2
make: *** [build-arch] Error 29
dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2

I think this is a result of the 3.1 to 3.2 change, if not apologies for putting this on the wrong bug report!

Revision history for this message
Patrick Farrell (pefarrell) wrote :

Tim: that is a separate bug. And I think it is now fixed, in r264 of the stable branch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.