Harpmerge error relating to CODA and HDF5

I installed CODA (2.24.2), HDF4 (hdf-4.2.16), HDF5 (1.10.10) and HARP (1.19) from source on a ubuntu 20.04 machine following instructions on Installation — HARP 1.19 documentation.
For CODA, the following steps were run.

>>./configure --enable-python HDF4_INCLUDE=/usr/lib/hdf-4.2.16/hdf4/include/ HDF4_LIB=/usr/lib/hdf-4.2.16/hdf4/lib/ HDF5_INCLUDE=/usr/lib/hdf5-1.10.10/hdf5/include/ HDF5_LIB=/usr/lib/hdf5-1.10.10/hdf5/lib/
>> make
>> make install

All installation seems fine, and harpcheck -v returns:

root@0606-153252-8ggo8xj6-10-155-152-229:/lib/harp# harpcheck -v
harpcheck version 1.19
Copyright (C) 2015-2023 S[&]T, The Netherlands.

But when I try to use harpmerge, the error comes out:

root@0606-153252-8ggo8xj6-10-155-152-229:/lib/harp# harpmerge -a ‘CH4_column_volume_mixing_ratio_dry_air_validity>50; latitude > -90; latitude < 90; longitude > -180; longitude < 180; bin_spatial(1801,-90,0.1,3601,-180,0.1); keep(CH4_column_volume_mixing_ratio_dry_air,cloud_fraction,latitude_bounds,longitude_bounds)’ /dbfs/FileStore/shared_uploads/tropomi/S5P_OFFL_L2__CH4____20220901*.nc /dbfs/FileStore/shared_uploads/hao_yan/test/20220901.nc
ERROR: HDF5 is not supported (this version of CODA was not built with HDF5 support)

Thanks for your help!

You showed how you configured and build coda, but not how you configured and build harp. This would be the important information to share.

Hi Sander, thanks for your reply. I used the following to configure harp.

./configure --enable-python HDF4_INCLUDE=/usr/lib/hdf-4.2.16/hdf4/include/ HDF4_LIB=/usr/lib/hdf-4.2.16/hdf4/lib/ HDF5_INCLUDE=/usr/lib/hdf5-1.10.10/hdf5/include/ HDF5_LIB=/usr/lib/hdf5-1.10.10/hdf5/lib/

After changing the configure of coda to the following, now I can run harpmerge without error.

./configure --enable-python --with-hdf5 --with-hdf4 HDF4_INCLUDE=/usr/lib/hdf-4.2.16/hdf4/include/ HDF4_LIB=/usr/lib/hdf-4.2.16/hdf4/lib/ HDF5_INCLUDE=/usr/lib/hdf5-1.10.10/hdf5/include/ HDF5_LIB=/usr/lib/hdf5-1.10.10/hdf5/lib/

Now I have another question, how do I connect harp with python (be able to use the python wrapper) if I installed harp through building from source? Thanks!!

Since you didn’t provide a prefix argument to the configure script, everything should have been installed in /usr/local. This means that you should add /usr/local/lib/python3.11/site-packages (using the appropriate path depending on your python version) to your python path.
You can set a PYTHONPATH environment variable to point to this path or you can set it programmatically using e.g. sys.path.append from within python itself.

Got it, thank you very much sander!!