tiny-dnn icon indicating copy to clipboard operation
tiny-dnn copied to clipboard

cross-compile using arm-none-eabi-g++ 5.3.1 failed!

Open wangwei2009 opened this issue 6 years ago • 2 comments

Can tiny-dnn be cross-compiled by using arm-none-eabi-g++? I tried but got error as below It is very long so I submit the head of that to avoid annoying

.... [ 50%] Building CXX object CMakeFiles/haha.dir/main.o In file included from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/util/util.h:31:0, from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/lossfunctions/loss_function.h:12, from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/network.h:26, from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/tiny_dnn.h:11, from /home/main.cpp:8: /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp: In member function 'void cereal::JSONOutputArchive::saveLong(T)': /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:246:69: error: call of overloaded 'saveValue(int32_t)' is ambiguous void saveLong(T l){ saveValue( static_caststd::int32_t( l ) ); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:223:12: note: candidate: void cereal::JSONOutputArchive::saveValue(bool) void saveValue(bool b) { itsWriter.Bool_(b); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:225:12: note: candidate: void cereal::JSONOutputArchive::saveValue(int) void saveValue(int i) { itsWriter.Int(i); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:227:12: note: candidate: void cereal::JSONOutputArchive::saveValue(unsigned int) void saveValue(unsigned u) { itsWriter.Uint(u); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:229:12: note: candidate: void cereal::JSONOutputArchive::saveValue(int64_t) void saveValue(int64_t i64) { itsWriter.Int64(i64); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:231:12: note: candidate: void cereal::JSONOutputArchive::saveValue(uint64_t) void saveValue(uint64_t u64) { itsWriter.Uint64(u64); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:233:12: note: candidate: void cereal::JSONOutputArchive::saveValue(double) void saveValue(double d) { itsWriter.Double(d); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp: In member function 'void cereal::JSONOutputArchive::saveLong(T)': /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:256:72: error: call of overloaded 'saveValue(uint32_t)' is ambiguous void saveLong(T lu){ saveValue( static_caststd::uint32_t( lu ) ); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:223:12: note: candidate: void cereal::JSONOutputArchive::saveValue(bool) void saveValue(bool b) { itsWriter.Bool_(b); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:225:12: note: candidate: void cereal::JSONOutputArchive::saveValue(int) void saveValue(int i) { itsWriter.Int(i); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:227:12: note: candidate: void cereal::JSONOutputArchive::saveValue(unsigned int) void saveValue(unsigned u) { itsWriter.Uint(u); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:229:12: note: candidate: void cereal::JSONOutputArchive::saveValue(int64_t) void saveValue(int64_t i64) { itsWriter.Int64(i64); } ^ /home/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:231:12: note: candidate: void cereal::JSONOutputArchive::saveValue(uint64_t) void saveValue(uint64_t u64) { itsWriter.Uint64(u64); } ^ /home/wangwei/SKL/tiny-dnn/tiny-dnn-master/cereal/archives/json.hpp:233:12: note: candidate: void cereal::JSONOutputArchive::saveValue(double) void saveValue(double d) { itsWriter.Double(d); } ^ In file included from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/util/util.h:39:0, from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/lossfunctions/loss_function.h:12, from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/network.h:26, from /home/tiny-dnn/tiny-dnn-master/tiny_dnn/tiny_dnn.h:11, from /homeL/main.cpp:8: /home/tiny-dnn/tiny-dnn-master/tiny_dnn/util/aligned_allocator.h: In member function 'void* tiny_dnn::aligned_allocator<T, alignment>::aligned_alloc(tiny_dnn::aligned_allocator<T, alignment>::size_type, tiny_dnn::aligned_allocator<T, alignment>::size_type) const': /home/tiny-dnn/tiny-dnn-master/tiny_dnn/util/aligned_allocator.h:98:9: error: '::posix_memalign' has not been declared if (::posix_memalign(&p, align, size) != 0) { ^ .......

I can compile tiny-dnn using arm-linux-guneabihf-g++ successfully,but arm-none-eabi-g++ failed, I found some information about glibc 、newlib etc,but I don't know how to fix it,is there anyone tried this before?any advice is appreciated,thanks a lot!

wangwei2009 avatar May 22 '18 02:05 wangwei2009

@wangwei2009 this might help you https://github.com/shridharkini6/tiny-dnn_crossCompiling

shridharkini avatar Jun 17 '18 16:06 shridharkini

If serialization support is not required, you may run cmake command with -DUSE_SERIALIZER=OFF argument. In that way, cereal library won't be used so the errors should be gone.

beru avatar Aug 29 '18 21:08 beru