Re: HDF5 linking issues with new NetCDF packages
-----BEGIN PGP SIGNED MESSAGE-----
Thanks for the feedback, and enjoy your vacation. I've started mine
with this work in preparation of the netcdf transition. :-)
On 31-07-15 10:51, Gilles Filippini wrote:
> Hi Bas,> > Sebastiaan Couwenberg a écrit le 30/07/2015 16:38 :
>> As mentioned in the 'netCDF Transition' thread  we're
>> preparing the netcdf transition in which we'll update from NetCDF
>> 4.1.3 to 4.4.0.
>> One of the significant changes is the switch to the HDF5 MPI
>> variant. I'd like your opinion about the HDF5 related issues that
>> have surfaced.
>> There is a common issue with linking the HDF5 libraries the new
>> netcdf library is built with. Several netcdf dependents FTBFS due
>> to link issues such as this:
>> gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o ncdf4.so
>> \ ncdf.o ncdf2.o ncdf3.o src_ncdf4.o -L/usr/lib -lnetcdf
>> -lhdf5_hl \ -lhdf5 -lz -ldl -lm -lcurl -L/usr/lib/R/lib -lR
>> /usr/bin/ld: cannot find -lhdf5_hl /usr/bin/ld: cannot find
>> -lhdf5 collect2: error: ld returned 1 exit status
>> As you documented in the hdf5 transition (#755539)  adding
>> the HDF5 library and include paths is the way to fix these
>> The best way to fix this for the new netcdf package is probably
>> to patch nc-config & netcdf.pc to include the HDF5 library and
>> include paths too.
There results were much better after implementing the above, adding
the HDF5 library & include paths in nc-config & netcdf.pc fixed the
FTBFS for all packages that failed to find the hdf5 libraries before.
I've not uploaded the netcdf (1:4.4.0~rc2-1~exp4) revision containing
these changes yet, I'll update it to switch back to the HDF5 serial
variant by default, and build with the MPI variant in addition.
>> Another issue with the switch to the HDF5 MPI variant for the new
>> netcdf package is that it's the only option it's built with.
>> Because most (if not all) of our packages are built with the HDF5
>> serial variant by default, it may not be wise to not have the
>> option in netcdf too.
> IIUC MPI shouldn't be the only option or you'll have to use mpirun
> for every executable depending on netcdf.
This may very well be a hidden issue. Nearly all reverse dependencies
build succesfully with the new netcdf package built only with the HDF5
MPI variant, but they may not work correctly at run time. I've only
built the packages, not installed and tested them.
>> I'm considering changing the new netcdf package to be more like
>> the hdf5 package, and default to the serial variant, and have the
>> MPI variants available too (with mpich for only a few
> I can't think of a better solution. If you want to provide an MPI
> variant of netcdf you'll have to ship the serial variant as well.
As mentioned above I'll reintroduce the build with the HDF5 serial
variant, that will likely solve the ncview (2.1.5+ds1-1) FTBFS which
is caused by mpicc not deemed acceptable. And probably also the gmt
>> What do you think about these issues?
> Sorting out the libhdf5 build process to have all variant
> co-installable was really painful, but it was worth it. We also
> added symbols versioning to be able - in theory - to link an
> executable with both serial and mpi variants.
> I'd be pleased to give you a hand in this process, but I'll be in
> vac from today until the 25th of august. I'll keep an eye on my
> emails anyway.
There is a bit of time pressure to get the new netcdf package ready
for the transition, because of the GCC 5 related transitions that were
planned to start today. If building with the HDF5 MPI variant in
addition turns out to be too problematic, I'll stick to only the
serial variant for the time being (and reopen #708638). That's
probably the best course of action.
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----