Opened 6 years ago

Closed 4 years ago

#57793 closed defect (fixed)

QGIS3 fails to compile due to mpi.h not found

Reported by: aaschwanden (Andy Aschwanden) Owned by: Veence (Vincent)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: qgis3

Description

Hi,

I'm trying to update to QGIS 3.4.2 and keep running into

:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_4_1/external/mdal/frmts/mdal_hdf5.hpp:15:
: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 Scanning dependencies of target postgresprovider

I'm using OSX Mojave, QT 5.12, and

$ port installed hdf5
The following ports are currently installed:
  hdf5 @1.10.4_0+cxx+hl+mpich+threadsafe 

Switching to the barebones hdf5 port, QGIS compiles, so this indicates that the hdf5 variant +mpich is the culprit.

The workaround is simple: use hdf5 without mpich. Not sure how many users use hdf5 +mpich along with qgis3, maybe it's not a big deal.

Change History (14)

comment:1 Changed 6 years ago by Veence (Vincent)

Thanks, I’ll commit a change in the Portfile to check for this.

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: Veence removed
Owner: set to Veence
Port: qgis3 added; QGIS3 removed
Status: newassigned

comment:3 Changed 6 years ago by Schamschula (Marius Schamschula)

Last edited 6 years ago by Schamschula (Marius Schamschula) (previous) (diff)

comment:4 Changed 6 years ago by willic3 (Charles Williams)

I have the same issue, with the following packages installed:

qgis3 @3.2.3_0+grass+postgresql10+proj5+python36 (active)

hdf5 @1.10.4_0+cxx+fortran+gfortran+hl+openmpi+szip (active)

Interestingly, hdf5 does not show up as a dependency (or recursive dependency) for qgis3, which seems odd. I think the problem is that things should be built with the MPI compiler, which I believe is how hdf5 is built.

comment:5 Changed 6 years ago by willic3 (Charles Williams)

Following the suggestion from Marius about armadillo, I made a couple very minor changes to the existing Portfile and got things to work:

diff /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/gis/qgis3/Portfile Portfile
8a9
> PortGroup           mpi     1.0
48a50
>                     port:hdf5 \
111a114,117
> # MPI setup
> mpi.setup
> mpi.enforce_variant         hdf5

I was then able to install:

qgis3 @3.4.2_0+grass+openmpi+postgresql10+proj5+python36

The only other issue is that I had to create the symbolic link mentioned in https://trac.macports.org/ticket/57915.

Thanks

comment:6 Changed 6 years ago by willic3 (Charles Williams)

Once again, I was able to make a couple of very minor changes to the existing Portfile to allow MPI. The reason I'm doing this is because I require parallel HDF5 for other work. Here are the differences between the two Portfiles:

diff /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/gis/qgis3/Portfile Portfile
8a9
> PortGroup           mpi     1.0
48a50
>                     port:hdf5 \
112a115,117
> # MPI setup
> mpi.setup
> mpi.enforce_variant         hdf5

This allowed me to install:

qgis3 @3.6.0_0+grass+openmpi+postgresql10+proj5+python36 (active)

Thanks

comment:7 Changed 6 years ago by Veence (Vincent)

It should be corrected in the release 1 I just committed. Could you have a go at it?

comment:8 Changed 6 years ago by aaschwanden (Andy Aschwanden)

Hm, even with the latest commit, I get the same error:

:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_6_0/external/mdal/frmts/mdal_hdf5.hpp:16:
: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.
:info:build make[2]: *** [src/providers/mdal/CMakeFiles/mdalprovider.dir/__/__/__/external/mdal/mdal_driver_manager.cpp.o] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build'
:info:build make[1]: *** [src/providers/mdal/CMakeFiles/mdalprovider.dir/all] Error 2

I'm using

The following ports are currently installed:
  hdf5 @1.10.5_0+clang70+cxx+hl+mpich+threadsafe (active)

Could the +clang70 be the issue? I might be able to try with a clean install (re-installing MacPorts and all my ports), but not before next week. I do have QGIS 3.6 running that was compiled without hdf5.

comment:9 Changed 6 years ago by Veence (Vincent)

My bad. I thought the mpi variant was named "mpi" and not "mpich". I've corrected that and committed a new Portfile with the same revision. Please wait a couple of hours and try again.

Sorry for the blooper :)

comment:10 Changed 6 years ago by aaschwanden (Andy Aschwanden)

Yep, I can now confirm that QGIS 3.6.0 compiles with mpich.

Thanks.

comment:11 Changed 6 years ago by willic3 (Charles Williams)

This still doesn't work for me, because I'm using OpenMPI. The hdf5 I'm using is:

hdf5 @1.10.5_0+cxx+fortran+gfortran+hl+openmpi+szip (active)

As far as I know, the only two MPI versions supported by macports are mpich and openmpi, so there just needs to be a way to handle openmpi.

Thanks.

comment:12 Changed 6 years ago by Veence (Vincent)

I have silently added another chunk of code to handle hdf5/openmpi the same way the Portfile already handles hdf5/mpich. Please wait a couple of hours and try again

comment:13 Changed 6 years ago by willic3 (Charles Williams)

I just got around to testing this, and it works -- thanks! I now have installed:

qgis3 @3.6.0_1+grass+openmpi+postgresql10+proj5+python36 (active)

comment:14 Changed 4 years ago by Veence (Vincent)

Resolution: fixed
Status: assignedclosed
  • Outdated -
Note: See TracTickets for help on using tickets.