How to reliably find the C++11 <array> header?

Ryan Schmidt ryandesign at macports.org
Fri Oct 31 03:46:53 PDT 2014


On Oct 31, 2014, at 4:45 AM, Thibaut Paumard wrote:

> Building of Gyoto failed on Montain Lion:
> https://build.macports.org/builders/buildports-mtln-x86_64/builds/18764
> 
> The error message is:
> /bin/sh ../libtool  --tag=CXX   --mode=compile /usr/bin/clang++
> -DHAVE_CONFIG_H -I. -I.. -I../include  -I../include
> -I/opt/local/include/udunits2/  -I/opt/local/include
> -DGYOTO_NO_DEPRECATED -D_THREAD_SAFE -pthread
> -DGYOTO_PREFIX=\"/opt/local\" -pipe -Os -arch x86_64 -stdlib=libstdc++
> -std=gnu++11 -MT Photon.lo -MD -MP -MF .deps/Photon.Tpo -c -o Photon.lo
> Photon.C
> In file included from Worldline.C:20:
> ../include/GyotoWorldline.h:36:11: fatal error: 'array' file not found
> # include <array>
> 
> I don't understand this as the <array> header is part of the C++11

C++11 requires OS X 10.9 or later. (More correctly: it requires libc++, which is the default on OS X 10.9 and up.)

Gyoto can apparently deal with the absence of C++11, since the build succeeded on the Snow Leopard buildbot.

If you're going to disable the use of C++11 for Gyoto, do it based in the ${configure.cxx_stdlib} variable, not the OS X version.



More information about the macports-dev mailing list