Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditional_t not found in namespace std --- tensorflow c++ versioning issue #36

Open
frederick-m-k opened this issue Nov 5, 2022 · 0 comments

Comments

@frederick-m-k
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant