Problems with Clang 3.1 and libc++

Hi,
I’m using Mac OS X 10.6 and I’m trying to compile a program using Clang 3.1 and libc++ but one of include files of libc++ is giving problems, specifically one called “cmath” located in /usr/include/c++/v1/. I have searched about this on google and I red something about building libc++ with -U__STRICT_ANSI__ param but the same errors appear. I paste here the output:

$ make
[100%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o
In file included from /Users/xxxxx/fantom/bin/foo/foo.cpp:1:
In file included from /Users/xxxxx/fantom/include/fantom/algorithm.hpp:10:
In file included from /usr/include/c++/v1/unordered_map:318:
In file included from /usr/include/c++/v1/__hash_table:19:
/usr/include/c++/v1/cmath:1333:9: error: no member named ‘llrint’ in the global namespace
using ::llrint;
^
/usr/include/c++/v1/cmath:1334:9: error: no member named ‘llrintf’ in the global namespace
using ::llrintf;
^
/usr/include/c++/v1/cmath:1336:86: error: use of undeclared identifier ‘llrintf’
inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) _NOEXCEPT {return llrintf(__x);}
^
/usr/include/c++/v1/cmath:1337:86: error: use of undeclared identifier ‘llrintl’
inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) _NOEXCEPT {return llrintl(__x);}
^
/usr/include/c++/v1/cmath:1342:35: error: call to ‘llrint’ is ambiguous
llrint(_A1 __x) _NOEXCEPT {return llrint((double)__x);}
^
~
/usr/include/c++/v1/cmath:1336:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) _NOEXCEPT {return llrintf(__x);}
^
/usr/include/c++/v1/cmath:1337:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) _NOEXCEPT {return llrintl(__x);}
^
/usr/include/c++/v1/cmath:1346:9: error: no member named ‘llround’ in the global namespace
using ::llround;
^
/usr/include/c++/v1/cmath:1347:9: error: no member named ‘llroundf’ in the global namespace
using ::llroundf;
^
/usr/include/c++/v1/cmath:1349:87: error: use of undeclared identifier ‘llroundf’
inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) _NOEXCEPT {return llroundf(__x);}
^
/usr/include/c++/v1/cmath:1350:87: error: use of undeclared identifier ‘llroundl’
inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) _NOEXCEPT {return llroundl(__x);}
^
/usr/include/c++/v1/cmath:1355:36: error: call to ‘llround’ is ambiguous
llround(_A1 __x) _NOEXCEPT {return llround((double)__x);}
^
~~
/usr/include/c++/v1/cmath:1349:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) _NOEXCEPT {return llroundf(__x);}
^
/usr/include/c++/v1/cmath:1350:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) _NOEXCEPT {return llroundl(__x);}
^
/usr/include/c++/v1/cmath:1649:9: error: no member named ‘llrintl’ in the global namespace
using ::llrintl;
~~^
/usr/include/c++/v1/cmath:1650:9: error: no member named ‘llroundl’ in the global namespace
using ::llroundl;
~~^
12 errors generated.
make[2]: *** [CMakeFiles/foo.dir/foo.cpp.o] Error 1
make[1]: *** [CMakeFiles/foo.dir/all] Error 2
make: *** [all] Error 2

I have built libc++ without any problem and all paths are correct, the only thing is that the testing application “testit” is doing the tests using the Clang version that came with XCode (which is not compatible with Mac OSX 10.6) instead of the one that I installed with Macports. Is there any way to define a specific compiler to do the tests?

Thank you,

Pere Joan