faster-rnnlm
faster-rnnlm copied to clipboard
Build in ubuntu 16.04
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* 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
Could you pls help me? Thanks
Which compile version to you use? Can you try g++-4.8?
It's my compile version "" g++ (Ubuntu 4.8.5-4ubuntu2) 4.8.5 "" But the problem happen again.
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
Either include <math.h> and use isnan or include
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.
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!