fhs / pyhdf

Python wrapper around the NCSA HDF version 4 library

Home Page:https://pypi.org/project/pyhdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find libraries from libhdf-alt-dev

treuherz opened this issue · comments

I have the package libhdf-alt-dev installed instead of libhdf-dev (because it's required by libgdal-dev), but python-hdf4 doesn't accept the libraries provided by this package (i.e. libdfalt and libmfhdfalt instead of libdf and libmfhdf), causing compilation to fail.

Manually symlinking the lib{df.mfhdf}alt.{a,la,so} to the non-alt paths before running pip3 install python-hdf4 makes everything run fine. Would it be possible for setup.py to automatically accept the alt-libraries?

I'd be interested in a good answer to this too. I went with the symlinking option on travis for now. I think the bigger issue is whatever the reason is that libhdf4-alt-dev had to be created.

If I recall correctly, the alt version have netCDF functions disabled so that you can use libhdf and libnetcdf in the same program. Symlinking is not really necessary. You just need to change one line in setup.py:

https://github.com/fhs/python-hdf4/blob/master/setup.py#L128
# change this line: libraries = ["mfhdf", "df"]

You may also need to change INCLUDE_DIRS and LIBRARY_DIRS environment variables. See installation instruction.

But yes, this should be easier.

Modifying the setup.py is not really an option on travis-ci without getting even more complex and possibly maintaining a fork of the project.