[petsc-users] Fail to Configure petsc-3.6.1

Barry Smith bsmith at mcs.anl.gov
Wed Aug 5 14:13:40 CDT 2015


> On Aug 5, 2015, at 12:35 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> 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.

   Our approach is always to work around bugs and stupidity in other packages design, so if HDF5 needs to link against -ldl (and -lm it looks like) even with static libraries then we just make that a dependency in hdf5.py  We sure don't require people to know that they should "pass LDLIBS=-ldl so that NetCDF can link?"

   Why is my answer not obvious?

  Barry

BTW: needsmath should probably eliminated and handled properly where math is just another package that some packages depend on. 

> 
>   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



More information about the petsc-users mailing list