Issue Creating SO file:
Hi,
I am facing the below issue while trying to build SO file in /mxnet/amalgamation/
jni/predictor.cc:80:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i=0; i<size; i++) out[i] = data[i];
Is there a work around it?
Also, on further working on a different ec2 instance, I am getting below error, while I run: make ANDROID=1 in /mxnet/amalgamation/
In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]': jni/../mxnet_predict-all.cc:19351:15: required from 'std::vector<_Tp, _Alloc>::vector() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' jni/../mxnet_predict-all.cc:46492:12: required from here jni/../mxnet_predict-all.cc:19225:33: error: 'struct std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl' has no member named '_M_start' - this->_M_impl._M_start); ^ jni/../mxnet_predict-all.cc:19225:9: error: 'struct std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl' has no member named '_M_start' - this->_M_impl._M_start); ^ jni/../mxnet_predict-all.cc:19225:9: error: 'struct std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl' has no member named '_M_end_of_storage' jni/../mxnet_predict-all.cc:19225:33: error: '_M_deallocate' was not declared in this scope - this->_M_impl._M_start); ^ In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc: In instantiation of 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]': jni/../mxnet_predict-all.cc:33067:56: required from 'std::basic_stringbuf<_CharT, _Traits, _Alloc>::basic_stringbuf(std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::ios_base::openmode = std::_Ios_Openmode]' jni/../mxnet_predict-all.cc:33392:62: required from 'std::basic_ostringstream<_CharT, _Traits, _Alloc>::basic_ostringstream(std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::ios_base::openmode = std::_Ios_Openmode]' jni/../mxnet_predict-all.cc:34080:48: required from here jni/../mxnet_predict-all.cc:13344:58: error: invalid use of incomplete type 'class std::allocator<char>' : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { } ^ In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc:692:11: error: declaration of 'class std::allocator<char>' class allocator; ^ In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]': jni/../mxnet_predict-all.cc:19189:17: required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' jni/../mxnet_predict-all.cc:19351:15: required from 'std::vector<_Tp, _Alloc>::vector() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' jni/../mxnet_predict-all.cc:46492:12: required from here jni/../mxnet_predict-all.cc:19151:68: error: type 'std::allocator<unsigned int>' is not a direct base of 'std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl' : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) ^ jni/../mxnet_predict-all.cc:19151:68: error: using invalid field 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_start' jni/../mxnet_predict-all.cc:19151:68: error: using invalid field 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_finish' jni/../mxnet_predict-all.cc:19151:68: error: using invalid field 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_end_of_storage' make: *** [jni_libmxnet_predict.o] Error 1
On running 'make ANDROID=1' next time I am getting the below error:
g++ -std=c++11 -Wno-unknown-pragmas -Wall -I/home/ubuntu/openblasbuilt/include -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -O3 -MD -MF mxnet_predict0.d \ -Ipwd/../ -Ipwd/../mshadow/ -Ipwd/../dmlc-core/include \ -Ipwd/../include \ -D__MIN__=0 -c mxnet_predict0.cc rm mxnet_predict0.o Generating amalgamation to mxnet_predict-all.cc python ./amalgamation.py mxnet_predict0.d mxnet_predict0.cc mxnet_predict-all.cc 0 1 Not processed: mxnet_predict0.o: g++ -std=c++11 -Wno-unknown-pragmas -Wall -I/home/ubuntu/openblasbuilt/include -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -O3 -fPIC -o jni_libmxnet_predict.o -c jni/predictor.cc jni/predictor.cc:1:17: fatal error: jni.h: No such file or directory #include <jni.h> ^ compilation terminated.
Errors are not consistent for some reasons, I am not sure how to accomplish amalgamation task.
Thanks, Gaurav
The first one is a warning. It's safe to ignore it.
you need android sdk for building with android
@piiswrong Hi, if the first one is only warning, it shouldn't terminate giving compilation error at the same time. Also, could you please suggest me how to use android-sdk for the same, and where to define its path in amalgamation. I've tried this on multiple machine now, and getting stuck at the below error:
jni/predictor.cc:1:17: fatal error: jni.h: No such file or directory #include <jni.h>
On further trying setting up mxnet, openblas, ndk etc on a new ec2 instance: I get the following error at first:
In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc:25:26: fatal error: machine/ansi.h: No such file or directory
After comment the above part in mxnet_predict-all.cc file, I get the error below:
jni/../mxnet_predict-all.cc:31:24: fatal error: sys/_types.h: No such file or directory #include <sys/_types.h> ^ compilation terminated.
Having commented the above one as well, I get this:
In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc:692:11: error: declaration of 'class std::allocator<char>' class allocator; ^ In file included from jni/predictor.cc:4:0: jni/../mxnet_predict-all.cc: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]': jni/../mxnet_predict-all.cc:19189:17: required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' jni/../mxnet_predict-all.cc:19351:15: required from 'std::vector<_Tp, _Alloc>::vector() [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' jni/../mxnet_predict-all.cc:46492:12: required from here jni/../mxnet_predict-all.cc:19151:68: error: type 'std::allocator<unsigned int>' is not a direct base of 'std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl' : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) ^ jni/../mxnet_predict-all.cc:19151:68: error: using invalid field 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_start' jni/../mxnet_predict-all.cc:19151:68: error: using invalid field 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_finish' jni/../mxnet_predict-all.cc:19151:68: error: using invalid field 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_end_of_storage' make: *** [jni_libmxnet_predict.o] Error 1
Please help!
jni.h is part of Java SDK. Please double check your Java installation.
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!