srvk / eesen

The official repository of the Eesen project
http://arxiv.org/abs/1507.08240
Apache License 2.0
822 stars 342 forks source link

const vs. constexpr issue in gpucompute/ctc-utils.h #90

Closed riebling closed 7 years ago

riebling commented 8 years ago

As Florian also noticed (and mentioned in a code comment) - some compilers flame out at "static const" for the 8 definitions in ctc-utils.h ../gpucompute/ctc-utils.h:37:35: error: ‘constexpr’ needed for in-class initialization of static data member ‘log_zero_’ of non-integral type but changing the definitions to static constexpr fixes this. In my case it was because of running an older C compiler that came by default with Ubuntu 12.04. I believe on newer OS releases (14.04 and up), the compiler does not mind.

Maybe we should update the code to the form that works for more compilers?

Breaks: ilva@ilva-VirtualBox:~/eesen/src$ g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Works: vagrant@vagrant-ubuntu-trusty-64:~/bin$ g++ --version g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

yajiemiao commented 8 years ago

Thanks for pointing this out. I will test this and update it to the repos.