mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

[v0.9.3] Amalgamation for Android broken

Open d4wud opened this issue 9 years ago • 62 comments

Amalgamation for Android still breaking in the recent release:

from mxnet_predict0.cc:3:
[...]/mxnet/mxnet/amalgamation/../dmlc-core/include/dmlc/logging.h:18:22: fatal error: execinfo.h: No such file or directory
 #include <execinfo.h>
                      ^
compilation terminated.
make: *** [mxnet_predict0.d] Error 1

Commenting out that #include <execinfo.h> creates the further error:

In file included from mxnet_predict0.cc:4:0:
[...]/mxnet/amalgamation/../src/ndarray/ndarray.cc:16:30: fatal error: opencv2/opencv.hpp: No such file or directory
 #include <opencv2/opencv.hpp>
                              ^
compilation terminated.
make: *** [mxnet_predict0.d] Error 1

It looks like the USE_OPENCV = 0 is being ignored?

d4wud avatar Jan 24 '17 01:01 d4wud

you need to update submodules.

Try a fresh clone

piiswrong avatar Jan 24 '17 17:01 piiswrong

I cloned fresh and retried, same error as before. @piiswrong any ideas? Is this working for you?

d4wud avatar Jan 24 '17 20:01 d4wud

USE_OPENCV was accidentally turned on in amalgamation/Makefile. Should be fixed by https://github.com/dmlc/mxnet/commit/01ae4df23735fb837e6f5119bdce77f671133f96 @howard0su

piiswrong avatar Jan 24 '17 21:01 piiswrong

@piiswrong just tested, still breaking:

In file included from jni/predictor.cc:4:0:
jni/../mxnet_predict-all.cc:49:28: fatal error: packet/sse-inl.h: No such file or directory
 #include <packet/sse-inl.h>
                            ^
compilation terminated.

d4wud avatar Jan 24 '17 21:01 d4wud

try make -DANDROID=1?

@howard0su USE_SSE is not turned off properly for JS and android. Moving it to make file doesn't work

piiswrong avatar Jan 24 '17 21:01 piiswrong

should be fixed by https://github.com/dmlc/mxnet/pull/4797

piiswrong avatar Jan 24 '17 21:01 piiswrong

@d4wud Hi, I met this trouble too. Do you succeed now?

PhanTask avatar Jan 25 '17 11:01 PhanTask

@piiswrong thanks for working on this.

I'm still having the problem posted above with #include <packet/sse-inl.h> on fix https://github.com/dmlc/mxnet/pull/4797

Any ideas?

d4wud avatar Jan 25 '17 19:01 d4wud

Try adding -DMSHADOW_USE_SSE=0 to https://github.com/dmlc/mxnet/blob/master/amalgamation/Makefile#L20?

piiswrong avatar Jan 25 '17 19:01 piiswrong

I tried adding that to the CFLAGS in Makefile with no affect.

d4wud avatar Jan 25 '17 20:01 d4wud

@piiswrong Also no affect adding it to DEFS at line 20

d4wud avatar Jan 25 '17 21:01 d4wud

Are you sure you are using a fresh clone of latest code? could you post the content of your mxnet_predict-all.cc? Here is mine, it doesn't include sse-inl.h: https://gist.github.com/piiswrong/deeb345ccc5c83426d2249ba86105cfc

piiswrong avatar Jan 25 '17 21:01 piiswrong

I did a fresh clone. On the most recent commit there are all kinds of new problems.

When I set head to your fix https://github.com/dmlc/mxnet/pull/4797 I am still seeing the #include <packet/sse-inl.h>. I've attached my mxnet_predict-all.cc.

mxnet_predict-all.cc.zip

d4wud avatar Jan 25 '17 23:01 d4wud

make ANDROID=1 is working for me with most recent commit on Ubuntu14.

I'm out of ideas...

If anyone can reproduce this please try to debug or provide more information

piiswrong avatar Jan 26 '17 00:01 piiswrong

Wow that is really strange. All I can say is that my environment (Mac) amalgamates perfectly for v0.8.0 so I don't see how the problem could be outside mxnet.

@PhanTask Are you able to reproduce this error on c07fe6f4348b8a053a4cac31a12791343cd6fc27?

d4wud avatar Jan 26 '17 01:01 d4wud

You can try debugging it by removing the parts of mxnet_predict-all.cc that's causing problem.

piiswrong avatar Jan 26 '17 01:01 piiswrong

@d4wud I cloned the latest version, but I can't even generate mxnet_predict-all.cc now. I built OpenBLAS and wrote this in makefile:

export OPENBLAS_ROOT=/home/rokim/OpenBLAS
export CC=/home/rokim/android-toolchain/bin/arm-linux-androideabi-gcc
export CXX=/home/rokim/android-toolchain/bin/arm-linux-androideabi-g++

When I run "make ANDROID=1", I met two errors. First error:

/home/rokim/android-toolchain/bin/arm-linux-androideabi-g++   -std=c++11 -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -fPIC -MD -MF nnvm.d \
		-I `pwd`/../ -I `pwd`/../include \
		-D__MIN__=0 -c nnvm.cc
arm-linux-androideabi-g++: error: unrecognized command line option '-msse2'

The second:

	-I /home/rokim/mxnet/dmlc-core/include \
	-D__MIN__=0 dmlc-minimum0.cc > dmlc.d
In file included from /home/rokim/mxnet/dmlc-core/include/dmlc/io.h:14:0,
                 from ../dmlc-core/src/io/line_split.cc:2,
                 from dmlc-minimum0.cc:6:
/home/rokim/mxnet/dmlc-core/include/dmlc/./logging.h:18:22: fatal error: execinfo.h: No such file or directory
 #include <execinfo.h>
                      ^
compilation terminated.

I commented execinfo.h in /home/rokim/mxnet/dmlc-core/include/dmlc/./logging.h but the first error still exists.

But I backed up the mxnet I used yesterday, on which I can still reproduce the error as yours, with the same mxnet_predict-all.cc:

#if defined(__MACH__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif
#if !defined(__WIN32__)
#include <sys/stat.h>
#include <sys/types.h>
#if !defined(__ANDROID__) && (!defined(MSHADOW_USE_SSE) || MSHADOW_USE_SSE == 1)
#include <emmintrin.h>
#endif
#endif

#include <algorithm>
#include <array>
#include <assert.h>
#include <atomic>
#include <cblas.h>
#include <cctype>
#include <cfloat>
#include <chrono>
#include <climits>
#include <cmath>
#include <condition_variable>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <dirent.h>
#include <errno.h>
**#include <execinfo.h>**
#include <fstream>
#include <functional>
#include <inttypes.h>
#include <iostream>
#include <istream>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <new>
#include <ostream>
**#include <packet/sse-inl.h>** 
#include <queue>
#include <random>
#include <regex>
#include <sched.h>
#include <set>
#include <src/c_api/c_api_error.cc>
#include <src/c_api/c_api_graph.cc>
#include <src/c_api/c_api_symbolic.cc>
#include <src/core/graph.cc>
#include <src/core/node.cc>
#include <src/core/op.cc>
#include <src/core/pass.cc>
#include <src/core/symbolic.cc>
#include <src/pass/gradient.cc>
#include <src/pass/infer_shape_type.cc>
#include <src/pass/order_mutation.cc>
#include <src/pass/place_device.cc>
#include <src/pass/plan_memory.cc>
#include <src/pass/saveload_json.cc>
#include <sstream>
#include <stdbool.h>
#include <stddef.h>
#include <stdexcept>
#include <stdint.h>
#include <stdlib.h>
#include <streambuf>
#include <string>
#include <thread>
#include <time.h>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

PhanTask avatar Jan 26 '17 03:01 PhanTask

@piiswrong this is what I'm seeing as well. Any idea how to proceed?

d4wud avatar Jan 26 '17 14:01 d4wud

Seems to be a mac specific problem. I'll look into it

piiswrong avatar Jan 26 '17 20:01 piiswrong

Made a fix https://github.com/dmlc/mxnet/commit/7c197d6f3a364083f1336a60a1c5e2695c5e6ffa

I tested it works on Mac 10.11.6

piiswrong avatar Jan 26 '17 22:01 piiswrong