Opened 5 months ago

Last modified 4 months ago

#70295 new defect

gdal +hdf5 and/or +netcdf look for non-existing include path

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc: Veence (Vincent), nilason (Nicklas Larsson), Dave-Allured (Dave Allured), cooljeanius (Eric Gallager)
Port: gdal, mpich

Description (last modified by barracuda156)

This code in the portfile is wrong:

variant hdf5 description {Enable HDF5 file format} {
    pre-configure {
        # If HDF5 is built with a mpi variant, we need to know the path to "mpi.h".
        # Figure out HDF5's mpi include directory:
        set mpl_include_dir ""
        if {![catch {set result [active_variants hdf5 openmpi]}]} {
            if {$result} {
                set mpl_include_dir "-I${prefix}/include/openmpi-mp"
            }
        }
        if {![catch {set result [active_variants hdf5 mpich]}]} {
            if {$result} {
                set mpl_include_dir "-I${prefix}/include/mpich-mp"
            }
        }
        if {$mpl_include_dir ne ""} {
            configure.cxxflags-append ${mpl_include_dir}
        }
    }
    depends_lib-append      port:hdf5
    configure.args-replace  -DGDAL_USE_HDF5=OFF    -DGDAL_USE_HDF5=ON
    configure.args-append   -DGDAL_ENABLE_DRIVER_HDF5=ON
}

It assumes mpich-default is used, apparently. It needs not be the case.

And the this happens:

[ 13%] Building CXX object ogr/CMakeFiles/ogr.dir/ogrfeaturestyle.cpp.o
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/build/ogr && /opt/local/bin/g++-mp-13 -DDONT_DEPRECATE_SPRINTF -DGDAL_COMPILATION -DHAVE_EXPAT -DHAVE_GEOS=1 -DHAVE_MITAB -DHAVE_ZLIB -DHAVE_ZLIB_H -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/apps -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/alg -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/gcore -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/build/gcore -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/port -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/build/port -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/ogr -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/ogr/ogrsf_frmts -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/frmts -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/ogr/ogrsf_frmts/geojson -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/ogr/ogrsf_frmts/mem -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/ogr/ogrsf_frmts/geojson/libjson -I/opt/local/lib/proj9/include -I/opt/local/include/geos -I/opt/local/include -pipe -DGDAL_COMPILATION -DNDEBUG -I/opt/local/include -I/opt/local/include/LegacySupport -I/opt/local/include/mpich-mp -I/opt/local/include/mpich-mp -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -arch ppc -mmacosx-version-min=10.6 -fPIC -Wall -Wextra -Winit-self -Wunused-parameter -Wmissing-declarations -Wlogical-op -Wshadow -Wmissing-include-dirs -Wformat -Werror=format-security -Wno-format-nonliteral -Werror=vla -Wno-clobbered -Wdate-time -Wnull-dereference -Wextra-semi -Wfloat-conversion -Wnon-virtual-dtor -Woverloaded-virtual -Wsuggest-override -fno-operator-names -Wzero-as-null-pointer-constant -Wold-style-cast -Weffc++ -MD -MT ogr/CMakeFiles/ogr.dir/ogrfeaturestyle.cpp.o -MF CMakeFiles/ogr.dir/ogrfeaturestyle.cpp.o.d -o CMakeFiles/ogr.dir/ogrfeaturestyle.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_gis_gdal/gdal/work/gdal-3.9.0/ogr/ogrfeaturestyle.cpp
cc1plus: warning: /opt/local/include/mpich-mp: No such file or directory [-Wmissing-include-dirs]
cc1plus: warning: /opt/local/include/mpich-mp: No such file or directory [-Wmissing-include-dirs]

While the correct path would be /opt/local/include/mpich-gcc13.

Same problem with +netcdf.

Just in case, this is not a powerpc-specific problem, even though I faced it on powerpc. If one installs mpich-gcc* on any system, it likewise will break down.

Change History (3)

comment:1 Changed 5 months ago by barracuda156

Description: modified (diff)
Summary: gdal +hdf5 looks for non-existing include pathgdal +hdf5 and/or +netcdf look for non-existing include path

comment:2 Changed 5 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:3 Changed 4 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.