Error on FreeBSD: error: no member named 'tr1' in namespace 'std'
C++ library for sorting and searching in OpenCL applications
Brought to you by:
bmerry
In file included from ../src/radixsort.cpp:46:
In file included from ../src/radixsort.h:44:
../src/tune.h:152:5: error: no member named 'tr1' in namespace 'std'
FUNCTIONAL_NAMESPACE::function<
^~~~~~~~~~~~~~~~~~~~
../src/tr1_functional.h:38:36: note: expanded from macro 'FUNCTIONAL_NAMESPACE'
~~~~~^
../src/radixsort.cpp:462:5: error: no member named 'tr1' in namespace 'std'
RANDOM_NAMESPACE::mt19937 engine;
^~~~~~~~~~~~~~~~
../src/tr1_random.h:38:32: note: expanded from macro 'RANDOM_NAMESPACE'
~~~~~^
../src/radixsort.cpp:668:29: error: no member named 'tr1' in namespace 'std'
using namespace FUNCTIONAL_NAMESPACE::placeholders;
^~~~~~~~~~~~~~~~~~~~
It looks like the compiler detection isn't working for you. What compiler and version are you using? Can you also attach your config.log.
I use clang-5.0.1.
Attaching config.log
Ok reading on the internet it sounds like Clang has gotten rid of the std::tr1 namespace even though they still provide the <tr1 functional=""> header.
Do you know if clang 5 supports C++11 by default (i.e., without having to pass a command-line option)? If so I can probably fix it by first detecting C++11 support.
AFAIK, clang5 still requires the c++11 option, but clang6 supports it by default.
So, to be safe you always need to include this option.
That's going to make it more difficult - I'll probably need to set up a VM or something to experiment with clang 5 and also make sure I don't break anything. I haven't touched clogs for about a year, and I don't even have a Windows machine any more to test MSVC.
If you want to just get going with clogs, you can probably just edit src/tr1_functional.h to change FUNCTIONAL_NAMESPACE from std::tr1 to std, and similarly in src/tr1_random.h.
Interestingly, I wasn't able to generate your exact issue with Ubuntu 18.04 and clang 5.0, with either libstdc++ or libc++. However, the libc++ build fails because the random classes got renamed when they were promoted from TR1 e.g. std::tr1::uniform_int -> std::uniform_int_distribution.
I think I'm just going to assume that C++11 has arrived and get rid of all the TR1 detection.
Hi Yuri. Can you try out the c++11 branch in git and let me know if it works in your environment?