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

Thibaut Paumard thibaut at
Fri Oct 31 02:45:43 PDT 2014


Building of Gyoto failed on Montain Lion:

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_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
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.

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.

More information about the macports-dev mailing list