Closed stephanmg closed 3 years ago
The combo gcc/osx tests the "gcc" supplied by MacOS. This "gcc" is actually clang using c++ headers and lib from gcc 4.2.1.
But half of the clang/osx tests (using clang with or without -stdlib=libc++
) also fail because the 'crono' header file is not found: [https://travis-ci.org/github/UG4/ugcore/builds/728486378]
@mlampe: How about this for .travis.yml
?
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export CXXFLAGS="-stdlib=libc++"; fi
At least this worked for me on Travis. On OS X before Mavericks g++ was really just an alias for clang as @mlampe points out and libstdc++ (OSX) was the default library (No C++11).
Starting from OS X Mavericks libc++ is the default (C++11).
Thus for pre-Mavericks one needs to use:
-std=c++11 -stdlib=libc++
or std=gnu++11 -stdlib=libc++
with clang/gcc on OSX
For later OSX releases one can compile (Clang) via:
clang++ -std=c++11
or clang++ -std=gnu++11
.
As I said above: The two OSX Travis builds with CC=clang and TARGET=vrl fail either way. The 'chrono' header is not found.
See the Travis build (STATIC_BUILD=OFF and TARGET=vrl this corresponds to build2 and build4):
https://travis-ci.org/github/UG4/ugcore/jobs/729465313
`/Users/travis/build/UG4/ugcore/travis_root/ug4/ugcore/ugbase/common/stopwatch.h:53:10: fatal error: 'chrono' file not found
include`
Looks like in these cases (
--with-gxx-include-dir=/usr/include/c++/4.2.1
) which has not the C++11 headers available. Can someone confirm?Note: When using
-stdlib=libc++
then thelibc++
standard library is included, instead of thegnu libstdc++
. On OS X, thelibc++
version has c++11 support. Thegnu libstdc++
one does not. (At least to my knowledge)