yandex / faster-rnnlm

Faster Recurrent Neural Network Language Modeling Toolkit with Noise Contrastive Estimation and Hierarchical Softmax
Other
562 stars 138 forks source link

Build in ubuntu 16.04 #33

Open star633669 opened 8 years ago

star633669 commented 8 years ago

dear all,

after call ./build.sh I have got the errors

rnnlm.cc:448:22: error: ‘isnan’ was not declared in this scope if (isnan(entropy) || isinf(entropy) || !(ratio >= bad_ratio)) { ^ rnnlm.cc:448:22: note: suggested alternative: In file included from /usr/include/c++/4.8/complex:44:0, from ../eigen3/Eigen/Core:28, from ../eigen3/Eigen/Dense:1, from ../faster-rnnlm/util.h:7, from ../faster-rnnlm/hierarchical_softmax.h:9, from rnnlm.cc:17: /usr/include/c++/4.8/cmath:632:5: note: ‘std::isnan’ isnan(_Tp x) ^ rnnlm.cc:448:40: error: ‘isinf’ was not declared in this scope if (isnan(entropy) || isinf(entropy) || !(ratio >= bad_ratio)) { ^ rnnlm.cc:448:40: note: suggested alternative: In file included from /usr/include/c++/4.8/complex:44:0, from ../eigen3/Eigen/Core:28, from ../eigen3/Eigen/Dense:1, from ../faster-rnnlm/util.h:7, from ../faster-rnnlm/hierarchical_softmax.h:9, from rnnlm.cc:17: /usr/include/c++/4.8/cmath:614:5: note: ‘std::isinf’ isinf(_Tp x) ^ Makefile:48: recipe for target 'rnnlm.o' failed make: * [rnnlm.o] Error 1 make: * Waiting for unfinished jobs.... /usr/include/string.h: In function ‘void* mempcpyinline(void, const void_, sizet)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char ) memcpy (dest, src, n) + __n; ^ Makefile:60: recipe for target 'cudasoftmax.o' failed make: ** [cuda_softmax.o] Error 1

Could you pls help me? Thanks

akhti commented 8 years ago

Which compile version to you use? Can you try g++-4.8?

star633669 commented 8 years ago

It's my compile version "" g++ (Ubuntu 4.8.5-4ubuntu2) 4.8.5 "" But the problem happen again.

gabrer commented 7 years ago

You have to prepend "std::" to each error. For instance, "isnan" becomes "std::isnan".

This solved for me! g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

See also: https://cgit.freedesktop.org/beignet/commit/?id=14bd8855dddcf683df8138c1062bc65b05d46f94

Malkitti commented 7 years ago

Either include and use isnan or include and use std::isnan, everything else is non-portable. Of course all this applies to any other C header and its respective C++ version, too.

yg37 commented 7 years ago

I got the error:

/usr/include/string.h: In function ‘void __mempcpy_inline(void, const void, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char ) memcpy (dest, src, n) + n; ^ Makefile:60: recipe for target 'cuda_softmax.o' failed make: [cuda_softmax.o] Error 1 make: Waiting for unfinished jobs....

And using std::memcpy doesn't solve the problem.

anavc94 commented 6 years ago

Hello @yg37 ,

could you solve the problem building faster-RNNLM? I am fancing the same error and I would appreciate a lot if you can help me. Thanks in advance!