faster-rnnlm icon indicating copy to clipboard operation
faster-rnnlm copied to clipboard

Build in ubuntu 16.04

Open star633669 opened this issue 8 years ago • 6 comments

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

star633669 avatar Sep 07 '16 17:09 star633669

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

akhti avatar Sep 09 '16 06:09 akhti

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

star633669 avatar Sep 12 '16 02:09 star633669

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

gabrer avatar Nov 08 '16 15:11 gabrer

Either include <math.h> 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.

Malkitti avatar Nov 22 '16 11:11 Malkitti

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.

yg37 avatar Jun 16 '17 00:06 yg37

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!

anavc94 avatar May 11 '18 08:05 anavc94