fhs / pyhdf

Python wrapper around the NCSA HDF version 4 library
https://pypi.org/project/pyhdf/
Other
46 stars 16 forks source link

fixes annoying install bug for linux #40

Closed espg closed 4 years ago

espg commented 4 years ago

Compiling HDF4 doesn't yield a libdf.a file... but it does give libhdf.a, and it seems suspicious that other platforms (windows) uses ["mfhdf", "hdf", ... ], while linux has ["mfhdf", "df"], with no mention of "hdf".

This change allows pyhdf to be pip installed on a unix-like system that has HDF4 installed; otherwise, pip install fails complaining that the linker can't find -ldf

fhs commented 4 years ago

What linux distro has libhdf instead of libdf? The libdf is no typo -- that's what the library is traditionally named in unix systems and I'm inclined to stick with it.

See build failure: https://travis-ci.org/github/fhs/pyhdf/jobs/672202474#L351

espg commented 4 years ago

...is there a way to check for libdf vs libhdf? It's impacting other users besides me (see #39).

I've never been able to get pyhdf to work outside of anaconda... which isn't particularly surprising that it works there since Travis Oliphant did that and the original pyhdf code.

I used nix to install hdf4, which is a very reproducible build system, and does a standard build. When pip wasn't able to find the library, I recompiled hfd4 by hand with and without netcdf, with and without Fortran, with and without production mode set. None produced a libdf @fhs what is standard build of hdf4 on a modern linux system that produces this library?

fhs commented 4 years ago

See how it's compiled in archlinux hdf4 package: PKGBUILD. It produces libdf:

$ pacman -Ql hdf4|grep 'so$'
hdf4 /opt/hdf4/lib/libdf.so
hdf4 /opt/hdf4/lib/libhdf_java.so
hdf4 /opt/hdf4/lib/libmfhdf.so

Ubuntu libhdf4-dev package also has libdf.so: https://packages.ubuntu.com/eoan/amd64/libhdf4-dev/filelist

I might give nix a try, but I don't see how the library is called libhdf from the source of nix package.