Opened 6 months ago
Last modified 6 months ago
#69928 assigned defect
hdf5 @1.14.4.2_1+cxx+fortran+gcc13+hl: error: 'PATH_MAX' undeclared (first use in this function)
Reported by: | jvianalopes (João Manuel Viana Parente Lopes) | Owned by: | eborisch (Eric A. Borisch) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.9.3 |
Keywords: | Cc: | ||
Port: | hdf5 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
Hi,
I tried to install hdf5 port with:
sudo port -v install hdf5 +gcc13
And it aborts with an error:
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_hdf5/hdf5/work/hdf5-1.14.4.2/src' make[1]: *** [all] Error 2
moving to the directory:
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_hdf5/hdf5/work/hdf5-1.14.4.2
and trying to compile:
make
Give-me the error:
In file included from H5encode.h:23, from H5private.h:1845, from H5Fint.c:22: H5Fint.c: In function 'H5F__build_actual_name': H5Fint.c:2817:65: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'AF_MAX'? 2817 | if (NULL == (realname = (char *)H5MM_calloc((size_t)PATH_MAX * sizeof(char)))) | ^~~~~~~~ H5MMprivate.h:36:34: note: in definition of macro 'H5MM_calloc' 36 | #define H5MM_calloc(Z) calloc(1, Z) | ^ H5Fint.c:2817:65: note: each undeclared identifier is reported only once for each function it appears in 2817 | if (NULL == (realname = (char *)H5MM_calloc((size_t)PATH_MAX * sizeof(char)))) | ^~~~~~~~ H5MMprivate.h:36:34: note: in definition of macro 'H5MM_calloc' 36 | #define H5MM_calloc(Z) calloc(1, Z) | ^ make[2]: *** [H5Fint.lo] Error 1 make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1
If complaints about this PATH_MAX
definition.
Do you have any suggestions? I was able to compile it with gcc12
Thanks in advance
Attachments (1)
Change History (5)
comment:1 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)
Owner: | set to eborisch |
---|---|
Port: | hdf5 added |
Status: | new → assigned |
Changed 6 months ago by jvianalopes (João Manuel Viana Parente Lopes)
comment:2 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Summary: | Compiling hdf5 with gcc13 → hdf5 @1.14.4.2_1+cxx+fortran+gcc13+hl: error: 'PATH_MAX' undeclared (first use in this function) |
Version: | → 2.9.3 |
PATH_MAX
is defined in <limits.h>. Sounds like hdf5 hasn't included it here. This would be an upstream bug that should be reported to the developers.
comment:3 Changed 6 months ago by jvianalopes (João Manuel Viana Parente Lopes)
That's true; it seems to be an upstream bug. However, the same code is compiled using the macports with gcc12:
sudo port install hdf5 +gcc12
installs hdf5-1.14.4.2_1 version without any problem.
comment:4 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)
That's not entirely surprising. It also compiles fine with clang or we would have noticed the problem sooner. This just means that some other system header that hdf5 is including eventually includes <limits.h> in clang and gcc12, but not anymore in gcc13. The hdf5 source code should not rely on coincidences of eventually included headers; it should directly include what it uses.
Please attach the main.log file.