Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#56517 closed defect (fixed)

gdal @2.3.0: A compiler with support for C++11 language features is required

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: Veence (Vincent)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger leopard snowleopard lion mountainlion Cc:
Port: gdal

Description

gdal fails to build with libstdc++:

10.6:

configure: WARNING: unrecognized options: --without-cpp11
checking if use C++14 compiler options... disabled by user
checking whether /usr/bin/g++-4.2 supports C++11 features by default... no
checking whether /usr/bin/g++-4.2 supports C++11 features with -std=c++11... no
checking whether /usr/bin/g++-4.2 supports C++11 features with -std=c++0x... no
checking whether /usr/bin/g++-4.2 supports C++11 features with +std=c++11... no
checking whether /usr/bin/g++-4.2 supports C++11 features with -h std=c++11... no
configure: error: *** A compiler with support for C++11 language features is required.

10.8:

configure: WARNING: unrecognized options: --without-cpp11
fatal error: 'type_traits' file not found
#include <type_traits> // for std::is_base_of
         ^

The usual solution is to use the cxx11 1.1 portgroup, but gdal offers compiler variants via the mpi portgroup, which is a conflicting concept; I don't know how the mpi portgroup intends for this situation to be handled. The mpi portgroup includes the compilers portgroup, and the languages portgroup seems to work with it and offers a compiler.cxx_standard option, so maybe you're meant to include the languages portgroup and use that.

Change History (4)

comment:1 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Looks like in [f841ac7466414ea790d21772f99aa3f633e87bf5/macports-ports] you removed the mpi portgroup and added the cxx11 1.1 portgroup. This lets the build get as far as the link stage, where it fails because the build system only uses CXXFLAGS (which contain the -stdlib argument) at compile time, not at link time.

https://build.macports.org/builders/ports-10.8_x86_64_legacy-builder/builds/61128/steps/install-port/logs/stdio

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

Aha. I’m going to commit a further change. Thanks for reporting.

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

Resolution: fixed
Status: assignedclosed

Ok, I think it’s been fixed by my latest commit [73f6c980bb02dcd3cda694f6732b45136b4c6a4f/macports-ports] fixed it!

Thanks again Ryan!

comment:4 in reply to:  1 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

The usual solution is to use the cxx11 1.1 portgroup, but gdal offers compiler variants via the mpi portgroup, which is a conflicting concept; I don't know how the mpi portgroup intends for this situation to be handled.

Replying to ryandesign:

Looks like in [f841ac7466414ea790d21772f99aa3f633e87bf5/macports-ports] you removed the mpi portgroup and added the cxx11 1.1 portgroup.

You've reinstated the mpi portgroup in #56522, so now it's unclear whether using the cxx11 1.1 portgroup is still a valid fix for the issue.

Note: See TracTickets for help on using tickets.