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

Chris Jones jonesc at hep.phy.cam.ac.uk
Fri Oct 31 02:58:04 PDT 2014


On 31/10/14 09:45, Thibaut Paumard wrote:
> Hi,
>
> 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
> standard and the above command lines includes -std=gnu++11.

That might be so, but the compilers in OSX 10.8 and earlier do not 
*fully* support C++11....

In the ROOT6 port, which also requires C++11 support, we use compiler 
black/white lists to enforce the use of MacPorts clang 3.4 compiler on 
OSX 10.8 and older, for similar reasons.

>
> How should I fix this? Depend on a specific compiler? Add a directory to
> the include search path? Is array still in the tr1 nampespace and
> directory on the default Montain Lion compiler?
>
> One way out is to add a snippet such as:
>
> platform darwin 12 {
>       configure.args-append --disable-c++11
> }
>
> I would rather avoid that as that would remove significant features from
> this Gyoto build.
>
> Kind regards, Thibaut.
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-dev
>



More information about the macports-dev mailing list