Errors installing HDF5 version 1.6.5

I am currently working on installing NETCDF Version 3.6.3, which requires HDF5 version 1.6.5. I have installing zlib version 1.2.2.3 without any problems and its present in my /usr directory. I am currently running GCC version 7.5.0 and Gfortran version 7.5.0.

I am using the following commands to installing HDF5-1.6.5:
tar -xf hdf5-1.6.5.tar.gz
cd hdf5-1.6.5
./configure --with-zlib=/usr --prefix=/usr
make
make check
make install

I get the following errors when running make:

In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:0,
from /usr/include/stdio.h:27,
from zip_perf.c:23:
/usr/include/features.h:184:3: warning: #warning “_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE” [-Wcpp]
#warning “_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE”
^~~~~~~
In file included from /usr/include/fcntl.h:290:0,
from zip_perf.c:28:
In function ‘open’,
inlined from ‘do_write_test’ at zip_perf.c:548:18,
inlined from ‘main’ at zip_perf.c:649:5:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
__open_missing_mode ();
^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [zip_perf.lo] Error 1
make[1]: *** [tests] Error 1
make: *** [all] Error 2

Unfortunately, I cannot attach the entire output from the make command because I am a new user.

Any idea what I am getting these errors?

Thanks in advance.

I checked the install documents for Netcdf 3.6.3. I do not find any such requirement for HDF5 or Zlib. Please try building Netcdf 3.6.3 without HDF5. For a simple initial test, I recommend a minimal, C-only build. Specify –disable-f77 --disable-cxx with Netcdf configure. This worked fine for me on Mac OS. Linux should be the same. You can rebuild with fortran or C++ later, if you need either one.

Note that Netcdf 3.6.3 does contain some developmental code that references HDF5. This code is never compiled unless you are doing something unusual with the build configuration.

NETCDF 3.6.3 installed for me without any issues, I ran make check and it passed all the tests. But I might need hdf5 for WRF version 2.2 I am trying to install. All of the instructions for the newer WRF versions say to specify the path to hdf5, and I cannot find any instructions to install WRF V2.2, so I am going off that.