Discussion:
[MacPorts] #57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
MacPorts
2018-08-27 22:51:03 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
------------------------+------------------------
Reporter: EJFielding | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Keywords: | Port: gdal, hdf5
------------------------+------------------------
I recently updated several ports to be +openmpi, which triggered
rebuilding of gdal among other ports. The rebuild failed because it is not
finding the "mpi.h" header reference in the hdf5.h (hdf5 was installed
with +openmpi). Here is the part of the log file that I assume is relevant
(full log attached).

{{{
...
:info:build /bin/sh
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/libtool
--mode=compile --silent --tag=CXX /usr/bin/clang++ -std=c++14
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/port
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/gcore
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/alg
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/ogr
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/ogr/ogrsf_frmts
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/gnm
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/apps
-DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME
-DHAVE_SSE_AT_COMPILE_TIME -pipe -DGDAL_COMPILATION -stdlib=libc++ -arch
x86_64 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror
=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow
-Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-
conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-
private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-
dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough
-DGNM_ENABLED
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.3.1/gdal/port
-DGDAL_COMPILATION -I/opt/local/include -c -o ../o/gifdataset.lo
gifdataset.cpp
:info:build In file included from hdf5dataset.cpp:42:
:info:build In file included from /opt/local/include/hdf5.h:22:
:info:build /opt/local/include/H5public.h:60:13: fatal error: 'mpi.h' file
not found
:info:build # include <mpi.h>
:info:build ^~~~~~~
:info:build 1 error generated.
...
}}}

I have selected one of the openmpi port versions.

{{{
port select mpi
Available versions for mpi:
none
openmpi-gcc7-fortran
openmpi-mp-fortran (active)
}}}
--
Ticket URL: <https://trac.macports.org/ticket/57045>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-27 22:53:22 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
-------------------------+--------------------
Reporter: EJFielding | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal, hdf5 |
-------------------------+--------------------
Changes (by EJFielding):

* Attachment "main.log" added.

main log
--
Ticket URL: <https://trac.macports.org/ticket/57045>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 11:20:46 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
-------------------------+--------------------
Reporter: EJFielding | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal, hdf5 |
-------------------------+--------------------

Comment (by Veence):

Hmmm
 I’m not precisely keen on mpi, but mpi is tied to a particular
compiler, right? So you can’t anything compile with mpi using clang, you
have to use the selected version of your mpi compiler instead. Is that
correct?
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 13:30:13 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
-------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 |
-------------------------+----------------------
Changes (by mf2k):

* cc: Veence (removed)
* cc: mamoll (added)
* owner: (none) => Veence
* status: new => assigned
* port: gdal, hdf5 => gdal hdf5
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 13:31:02 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
-------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 |
-------------------------+----------------------

Comment (by mf2k):

The port selected with {{{port select}}} should never affect if a port can
be built.
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 14:48:21 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
-------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 |
-------------------------+----------------------
Post by MacPorts
The port selected with {{{port select}}} should never affect if a port
can be built.
However, the port should honor the mpi choice that was made, no?
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 15:52:06 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
--------------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 openmpi |
--------------------------------+----------------------
Changes (by EJFielding):

* port: gdal hdf5 => gdal hdf5 openmpi


Comment:

Maybe the responsibility here is for the openmpi port to add the
appropriate mpi.h to /opt/local/include? I added the openmpi port to the
ticket list. I faced the same issue when trying to build a package outside
of MacPorts. I had to add "/opt/local/include/openmpi-gcc7" to the build
include list because the package was including "hdf5.h" that then wanted
"mpi.h".
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 16:41:13 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
--------------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 openmpi |
--------------------------------+----------------------
Changes (by mf2k):

* cc: seanfarley (added)
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 16:42:32 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
--------------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 openmpi |
--------------------------------+----------------------

Comment (by mf2k):

Whatever it needs to honor needs to be based on installed versions of
ports. {{{port select}}} merely creates symlinks and so there is nothing
to rely on there.
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-28 18:24:11 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
--------------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 openmpi |
--------------------------------+----------------------

Comment (by EJFielding):

I looked on my other Mac to see how it has gdal built. I see that it has
the "+openmpi" variant added. That must be what I am missing on the Mac
that failed to build gdal in this ticket.

It seems that the gdal port should be warning me that I need to add the
"+openmpi" variant because my hdf5 is built with the "+openmpi" variant.
That would be a lot more helpful than just failing to build. I had that
warning from the netcdf port when I changed hdf5 to the openmpi variant.
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-08-29 21:58:42 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
--------------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 openmpi |
--------------------------------+----------------------

Comment (by EJFielding):

I got back to the Mac that was having trouble building gdal. I was able to
get it to build by adding the +openmpi variant flag like this:

{{{
port install gdal +hdf5 +netcdf +postgresql95 +openmpi
}}}

It still seems like the gdal port should have warned me that I needed to
add the +openmpi variant instead of failing to build without it.
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-30 17:00:04 UTC
Permalink
#57045: gdal-2.3.1_0+hdf5+netcdf+postgresql95 fails to build
--------------------------------+----------------------
Reporter: EJFielding | Owner: Veence
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: gdal hdf5 openmpi |
--------------------------------+----------------------

Comment (by jjstickel):

I suggest using active_variants to check for hdf5 +openmpi and add a
warning/error message. See https://github.com/macports/macports-
ports/pull/3102 .
--
Ticket URL: <https://trac.macports.org/ticket/57045#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
Loading...