[petsc-users] Fail to Configure petsc-3.6.1

Matthew Knepley knepley at gmail.com
Wed Aug 5 12:35:52 CDT 2015


On Wed, Aug 5, 2015 at 10:29 AM, Jed Brown <jed at jedbrown.org> wrote:

> Rongliang Chen <rongliang.chan at gmail.com> writes:
>
> > Hi Jed,
> >
> > Thanks for your reply.
> >
> > I checked the netcdf and hdf5's config.log and could not find any
> > possible solutions. Can you help me check these two files again? The two
> > files are attached. Thanks.
>
> It looks to me like libhdf5.a needs to be linked with -ldl, which partly
> defeats the intent of static linking.  PETSc folks, do we blame this on
> HDF5 with --disable-shared not being a truly static build?  Should we
>

Yes, this is an error in the HDF5 buildsystem.


> pass LDLIBS=-ldl so that NetCDF can link?
>

That would work I think, but looks very strange for a static build (as you
said). It appears to me
that HDF5 is not suitable for a static build, and I would reconsider this
strategy.

  Thanks,

     Matt


> This likely all works if you use shared libraries.  (I can't believe
> this is still a debate in 2015.)
>
> configure:16585: mpicc -o conftest -g3 -O0
> -I/home/rlchen/soft/petsc-3.6.1/64bit-debug/include  conftest.c -lhdf5  -lm
> -Wl,-rpath,/home/rlchen/soft/petsc-3.6.1/64bit-debug/lib
> -L/home/rlchen/soft/petsc-3.6.1/64bit-debug/lib -lhdf5hl_fortran
> -lhdf5_fortran -lhdf5_hl -lhdf5 -lz >&5
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/lib/libhdf5.a(H5PL.o): In
> function `H5PL__open':
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/externalpackages/hdf5-1.8.12/src/H5PL.c:535:
> undefined reference to `dlopen'
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/externalpackages/hdf5-1.8.12/src/H5PL.c:536:
> undefined reference to `dlerror'
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/externalpackages/hdf5-1.8.12/src/H5PL.c:544:
> undefined reference to `dlsym'
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/lib/libhdf5.a(H5PL.o): In
> function `H5PL__search_table':
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/externalpackages/hdf5-1.8.12/src/H5PL.c:627:
> undefined reference to `dlsym'
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/lib/libhdf5.a(H5PL.o): In
> function `H5PL__close':
> /home/rlchen/soft/petsc-3.6.1/64bit-debug/externalpackages/hdf5-1.8.12/src/H5PL.c:661:
> undefined reference to `dlclose'
> collect2: error: ld returned 1 exit status

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150805/c92f9837/attachment.html>


More information about the petsc-users mailing list