`conditional_t` not found in namespace std --- tensorflow c++ versioning issue
frederick-m-k opened this issue · comments
Hi guys,
I tried to setup and install RASR for the first time following the Beginners How To on https://www-i6.informatik.rwth-aachen.de/rwth-asr/manual/index.php/Beginner%27s_Howto
I executed the scripts/requirements.sh and this executed well.
Error
When running the Makefile
, I got some errors stemming from Eigen (from TensorFlow).
In file included from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/Core:161:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/util/ForwardDeclarations.h:109:46: error: no template named 'conditional_t' in namespace 'std'; did you mean 'conditional'?
typename StrideType = typename std::conditional_t<PlainObjectType::IsVectorAtCompileTime,InnerStride<1>,OuterStride<> > > class Ref;
~~~~~^~~~~~~~~~~~~
conditional
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:538:33: note: 'conditional' declared here
struct _LIBCPP_TEMPLATE_VIS conditional {typedef _If type;};
^
Same error occurred for enable_if_t
/enable_if
, integer_sequence
/__integer_sequence
, make_signed_t
/make_signed
, and probably more.
One possible solution
This seems to be an issue of c++ versioning with tensorflow versioning. As this StackOverflow issue states, enable_if_t
is only available since c++14: https://stackoverflow.com/a/64282324
Therefore, when editing the config/cc-gcc.make
file and specifically setting the c++ version to be used, the error resolves.
In the config/cc-gcc.make
file, there is the line
CXXFLAGS += -std=gnu++0x
which defines the standard (std) version for c++. (I'm not a proficient c++ programmer, so please correct me, if this is wrong!!)
When setting this line to
CXXFLAGS += -std=c++14
the error resolves.
Other solution
It may also be possible to change the used tensorflow version. I did not experiment with this.
This post is mainly for the developers and RASR users to be aware of this fact.
Regards,
Frederick