I’m trying to deploy Urho for Android by using a modern, Android Studio, latest Cmake toolchain.
To be more clear, I want to support a process decoupling the upstream Urho3d library from the downstream app building.
As of now, the android build only support building “one-way”, that is upstream. If I use the same build on the downstream app, I end up having an upstream library rebuild in the downstream app directory, and that’s not what I want. I want a modern, decoupled, lightweight (possibly) command line building process, much in the so fashionable CI style which is current today…
More, I want it to run flawlessly in both Android Studio and gradle wrapper. Please no rake / cmake cube-enter-the-build-line-fix-it-again, I’ve already tried them all in all possible combination, there’s no way to make them work good, or at least I’m unable.
As of now, I’ve create the cmd line utils, built the general downstream structure, and created a new Cmakefiles.txt for android studio 2.3 to work. After some troubling, Cmake appears to work generally, but maybe there’s something missing, something that’s inside the inner build process / android toolchain, because when I run gradlew assembleDebug i get a mmintrin related error as follows:
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:app:externalNativeBuildDebug’.Build command failed.
Error while executing process /usr/local/android/cmake/3.6.3155560/bin/cmake with arguments {–build /Users/max/Developer/Stage/Workspace/AndroidStudio/MyApplication12/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target native-lib}
[1/2] Building CXX object CMakeFiles/native-lib.dir/Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp.o
FAILED: /usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv7-none-linux-androideabi -gcc-toolchain /usr/local/android/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/usr/local/android/ndk-bundle/platforms/android-9/arch-arm -Dnative_lib_EXPORTS -I/usr/local/Urho/Urho3D-1.6/build/android/Debug/include -isystem /usr/local/android/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /usr/local/android/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /usr/local/android/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,–noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,–noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native-lib.dir/Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp.o -MF CMakeFiles/native-lib.dir/Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp.o.d -o CMakeFiles/native-lib.dir/Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp.o -c /Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp
In file included from /Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp:8:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/CoreEvents.h:25:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Core/Object.h:26:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Core/Variant.h:29:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Math/Matrix3x4.h:25:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Math/…/Math/Matrix4.h:25:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Math/…/Math/Quaternion.h:28:
In file included from /usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/emmintrin.h:27:
In file included from /usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/xmmintrin.h:27:
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:39:5: error: use of undeclared identifier ‘__builtin_ia32_emms’; did you mean ‘__builtin_isless’?
__builtin_ia32_emms();
^
/usr/local/android/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath:885:14: note: ‘__builtin_isless’ declared here
return __builtin_isless(__type(__f1), __type(__f2));
^
In file included from /Users/max/Developer/Stage/Workspace/Urho/prima/src/prima.cpp:8:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/CoreEvents.h:25:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Core/Object.h:26:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Core/Variant.h:29:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Math/Matrix3x4.h:25:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Math/…/Math/Matrix4.h:25:
In file included from /usr/local/Urho/Urho3D-1.6/build/android/Debug/include/Urho3D/Core/…/Math/…/Math/Quaternion.h:28:
In file included from /usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/emmintrin.h:27:
In file included from /usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/xmmintrin.h:27:
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:39:25: error: too few arguments to function call, expected 2, have 0
__builtin_ia32_emms();
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:45:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si’
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:51:12: error: use of undeclared identifier '__builtin_ia32_vec_ext_v2si’
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:69:19: error: use of undeclared identifier '__builtin_ia32_packsswb’
return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:75:19: error: use of undeclared identifier '__builtin_ia32_packssdw’
return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:81:19: error: use of undeclared identifier '__builtin_ia32_packuswb’
return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:87:19: error: use of undeclared identifier '__builtin_ia32_punpckhbw’
return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:93:19: error: use of undeclared identifier '__builtin_ia32_punpckhwd’
return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:99:19: error: use of undeclared identifier '__builtin_ia32_punpckhdq’
return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:105:19: error: use of undeclared identifier '__builtin_ia32_punpcklbw’
return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:111:19: error: use of undeclared identifier '__builtin_ia32_punpcklwd’
return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:117:19: error: use of undeclared identifier '__builtin_ia32_punpckldq’
return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:123:19: error: use of undeclared identifier ‘__builtin_ia32_paddb’; did you mean ‘__builtin_arm_qadd’?
return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:123:19: note: ‘__builtin_arm_qadd’ declared here
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:123:40: error: cannot initialize a parameter of type ‘int’ with an rvalue of type ‘__v8qi’ (vector of 8 ‘char’ values)
return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
^~~~~~~~~~~~
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:129:19: error: use of undeclared identifier ‘__builtin_ia32_paddw’; did you mean ‘__builtin_arm_qadd’?
return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:123:19: note: ‘__builtin_arm_qadd’ declared here
return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:129:40: error: cannot initialize a parameter of type ‘int’ with an rvalue of type ‘__v4hi’ (vector of 4 ‘short’ values)
return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
^~~~~~~~~~~~
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:135:19: error: use of undeclared identifier ‘__builtin_ia32_paddd’; did you mean ‘__builtin_arm_qadd’?
return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:123:19: note: ‘__builtin_arm_qadd’ declared here
return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
^
/usr/local/android/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/…/lib64/clang/3.8.256229/include/mmintrin.h:135:40: error: cannot initialize a parameter of type ‘int’ with an rvalue of type ‘__v2si’ (vector of 2 ‘int’ values)
return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
^~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I’ve read some other topics about this but they seem different or related to building, afaiu, android upstream library without SSE.
Is there someone who can confirm this and / or shed some light?
I’m up to get to the end of this, and I’d like to contribute a solution for this. I don’t like being defeated by a build system whatever complicated it can be…