Roll back hdfeos version to 2.19 from 2.20
Closed this issue · 6 comments
WE have some reports that some of our build problems will go away if we roll back from version 2.20 to 2.19. So we will give it a try and see how it goes. ;-)
OK, annoyingly I can't find this release on the HDFEOS web site.
James has a copy, but when I try to use it, it won't uncompress:
(base) ed@mikado:wget https://github.com/OPENDAP/hyrax-dependencies/blob/master/downloads/HDF-EOS2.19v1.00.tar.Z &> /dev/null
(base) ed@mikado:~/STAREmaster$ tar xvf HDF-EOS2.19v1.00.tar.Z
tar (child): compress: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
(base) ed@mikado:~/STAREmaster$ uncompress HDF-EOS2.19v1.00.tar.Z
gzip: HDF-EOS2.19v1.00.tar.Z: not in gzip format
(base) ed@mikado:~/STAREmaster$ gunzip HDF-EOS2.19v1.00.tar.Z
gzip: HDF-EOS2.19v1.00.tar.Z: not in gzip format
Here's where I should be able to find the 1.19 version: https://wiki.earthdata.nasa.gov/display/DAS/Toolkit+Downloads
However, the link to the 1.19 version they have, points to a compressed tarball that contains windows binaries, instead of source code. :-(
I have sent an email to their support email address but no answer yet...
OK, I found a copy on-line on the HDFEOS web site, but it's not quite a normal distribution. However, it contains the source code, and it's possible to build it.
Then I had to add:
export CXXFLAGS=-fpermissive
to get STAREmaster to build, due, presumably, to a change in the library between 19 and 20.
With that flag, the build with v19 works.
OK, the difference between the two versions as far as STAREmaster is concerned, is the SWopen() function call. From 2.19:
int32 SWopen(char *, intn);
From 2.20:
int32 SWopen(const char *, intn);
This leads to compile error:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/hdfeos2.19_fPIC/include -I/usr/local/hdf-4.2.15_fPIC/include -I/usr/local/STARE-0.16.3/include -I/usr/local/netcdf-c-4.7.4_hdf5-1.10.6/include -g -O2 -MT SidecarFile.lo -MD -MP -MF .deps/SidecarFile.Tpo -c SidecarFile.cpp -o SidecarFile.o >/dev/null 2>&1
ModisL2GeoFile.cpp: In member function ‘int ModisL2GeoFile::readFile(std::string, int, int, int)’:
ModisL2GeoFile.cpp:206:45: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
206 | if ((swathfileid = SWopen(fileName.c_str(), DFACC_RDONLY)) < 0)
| ~~~~~~~~~~~~~~^~
| |
| const char*
In file included from ModisL2GeoFile.cpp:9:
/usr/local/hdfeos2.19_fPIC/include/HdfEosDef.h:128:14: note: initializing argument 1 of ‘int32 SWopen(char*, intn)’
128 | int32 SWopen(char *, intn);
| ^~~~~~
ModisL2GeoFile.cpp:209:44: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
OK, the answer here is to cast the char arrays to (char *). This works with 2.20 because (char *) is silently accepted wherever (const char *) is expected, whereas the reverse is not true.
Given that, it make sense to permit (and test) both HDFEOS2.19 and HDFEOS2.20. STAREmaster will work with either version.
Running CI now...