- edited description
demo/wrap-swig needs PETSc CFLAGS (hdf include path)
Something seems to have changed in PETSc 3.11.3 (unless I messed up a patch). Running demo tests on Debian gives this failure in wrap-swig:
$ cd demo/wrap-swig/
$ make PETSC_DIR=${PETSC_DIR} PYTHON=python3 F2PY=f2py3
CC=mpicc F90=mpif90 LDSHARED='mpicc -Wl,-z,relro -fPIC -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -shared' \
python3 setup.py -q build_ext --inplace
In file included from /usr/lib/petsc/include/petscvec.h:9,
from /usr/lib/petsc/include/petscmat.h:6,
from /usr/lib/petsc/include/petscdm.h:6,
from /usr/lib/petsc/include/petscdmda.h:4,
from /usr/lib/petsc/include/petsc.h:13,
from ./Bratu3D.h:4,
from ./Bratu3D.c:20:
/usr/lib/petsc/include/petscis.h:317:10: fatal error: H5Ipublic.h: No such file or directory
#include <H5Ipublic.h>
^~~~~~~~~~~~~
compilation terminated.
In file included from /usr/lib/petsc/include/petscvec.h:9,
from /usr/lib/petsc/include/petscmat.h:6,
from /usr/lib/petsc/include/petscdm.h:6,
from /usr/lib/petsc/include/petscdmda.h:4,
from /usr/lib/petsc/include/petsc.h:13,
from /usr/lib/python3/dist-packages/petsc4py/include/petsc4py/petsc4py.h:8,
from ./Bratu3D_wrap.c:3085:
/usr/lib/petsc/include/petscis.h:317:10: fatal error: H5Ipublic.h: No such file or directory
#include <H5Ipublic.h>
^~~~~~~~~~~~~
compilation terminated.
The petsc4py code hasn’t changed so this must be a change in the PETSc headers.
The makefile for wrap-swig doesn’t specially add path flags. The compilation failure can be fixed by replacing
CC=${CC} F90=${FC} LDSHARED='${CLINKER} -shared'
with
CC=${CC} F90=${FC} CFLAGS='${PETSC_CCPPFLAGS} ${CFLAGS}' LDSHARED='${CLINKER} -shared'
(probably PETSC_CCPPFLAGS is more appropriate, though the more targeted HDF5_INCLUDE would also enable compilation)
Comments (11)
-
reporter -
reporter - edited description
-
Just to clarify: Is this a regression from PETSc 3.11.2 to 3.11.3 ?
-
@Matthew Knepley Any chance your changes to petsc/maint screw things up? Do we really need to include HDF5 headers in public PETSc headers other than
petscviewerhdf5.h
? -
reporter It does seem to be a regression in PETSc 3.11.3. I think I’ve pinned it down. tldr; nothing to see here, it’s already fixed in PETSc master.
The
#include <H5Ipublic.h>
inpetscis.h
was new. It had the consequence that HDF5 include paths would need to be added when compiling, even if the PETSc client program doesn’t use HDF5 itself.It’s been addressed by commit 6a0bd7522af7eb76a79ca5f1af77fc9a30e8cdb2, which refactors the HDF5-specific code into a private header so only active when specifically needed. With that patch in place, nothing specific needs to be done, unless you do need petsc4py to work with PETSC 3.11.3.
-
@BarryFSmith @Jed Brown Despite this seems to be fixed in petsc/master, though in not the best way,
PetscViewerHDF5Load()
simply do not below to IS, it should go topetscviewerhdf5.h
.IMHO this is a nasty regression in petsc/maint. We should put all the HDF5 stuff in
petscviewerhdf5.h
. What should we do now? Fix maint and go to the hassle of handling the merge conflicts? Or just fix master? -
Oh, I see now,
PetscViewerHDF5Load()
usesPetscLayout
. Let it be, let it be… -
- changed status to resolved
-
- changed status to open
Hmm, not sure why Lisandro closed this. It would be good to have it work in PETSc 3.11 plus the fix in master is ugly
-
I have attempted a change for PETSc maint that I think should also move cleanly over to master and provides a better way of handling then the current heading of a public interface in isimpl.h https://bitbucket.org/petsc/petsc/pull-requests/1943/move-higher-level-is-level-hdf5-function/diff
-
- changed status to resolved
- Log in to comment