[SOLVED] Android build error: unknown target CPU 'armv7-a'

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

[SOLVED] Android build error: unknown target CPU 'armv7-a'

Post by DanielSefton »

Hi,

Having configured and generated the latest Ogre 1.9 for Android with CMake 2.8.12, when I run "make" on the build directory on OS X I receive the following error:

Code: Select all

make
Scanning dependencies of target OgreMain
[  0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o
clang: warning: argument unused during compilation: '-mfloat-abi=softfp'
clang: warning: argument unused during compilation: '-mfpu=vfp'
clang: warning: argument unused during compilation: '-mthumb'
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-parameter'; did you mean '-Wno-unused-parameter'?
      [-Wunknown-warning-option]
error: unknown target CPU 'armv7-a'
make[2]: *** [OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2
Any ideas how to solve this?

Also, I'm not sure if it's related, but I also tried generating it with CMake 3.x, and apparently this version requires full paths, I receive the following errors:

Code: Select all

CMake Error at CMakeLists.txt:46 (project):
  The CMAKE_C_COMPILER:

    clang

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:46 (project):
  The CMAKE_CXX_COMPILER:

    clang++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
I tried adding explicit paths by setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER manually, but the properties disappear when I hit "Configure" and the same error is shown.
Last edited by DanielSefton on Tue Sep 16, 2014 7:51 am, edited 1 time in total.
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Re: Android build error: unknown target CPU 'armv7-a'

Post by Wolfmanfx »

Feels like he is picking the wrong compiler - so the toolchain file is not used
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: Android build error: unknown target CPU 'armv7-a'

Post by DanielSefton »

Looks like it, tried the following, same error:

Code: Select all

-DCMAKE_C_COMPILER="/usr/bin/clang" -DCMAKE_CXX_COMPILER="/usr/bin/clang++"
edit: thanks for the quick reply btw!
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Re: Android build error: unknown target CPU 'armv7-a'

Post by Wolfmanfx »

You can not use clang. Did you installed NDK - you have to use the compiler inside NDK :)
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: Android build error: unknown target CPU 'armv7-a'

Post by DanielSefton »

Oh that makes sense - so it's picking out Clang and needs the NDK compiler.

Any idea where that is? Looking for it now...
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Re: Android build error: unknown target CPU 'armv7-a'

Post by Wolfmanfx »

check the wiki for my android cmake guide
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: Android build error: unknown target CPU 'armv7-a'

Post by DanielSefton »

Yeah that's what I've been following, just has 1 line for OS X: http://www.ogre3d.org/tikiwiki/tiki-ind ... on=Android

This is what I'm running:

Code: Select all

cmake -DANDROID_NDK="/Applications/android-ndk-r8e" -DCMAKE_TOOLCHAIN_FILE="`pwd`/CMake/toolchain/android.toolchain.cmake" -DOGRE_DEPENDENCIES_DIR="`pwd`/AndroidDependencies" -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=9
Then I call "make", also tried with the "make" included in the NDK with the same results.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: Android build error: unknown target CPU 'armv7-a'

Post by DanielSefton »

Ok I started again with a clean Ogre and it's working now :) Didn't need to specify a compiler. It was probably down to not using the NDK "make" - using the standard make screwed it up irreversibly.

Might want to mention that in the Wiki.

Many thanks for your time.
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Re: [SOLVED] Android build error: unknown target CPU 'armv7-

Post by Wolfmanfx »

Np - looking forward to feature your game here (@news) when its ready :)
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4308
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 137

Re: Android build error: unknown target CPU 'armv7-a'

Post by spacegaier »

DanielSefton wrote:Might want to mention that in the Wiki.
Feel free to add a respective comment.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: [SOLVED] Android build error: unknown target CPU 'armv7-

Post by DanielSefton »

Wolfmanfx wrote:Np - looking forward to feature your game here (@news) when its ready :)
Thanks :) Will post something in the showcase soon!
Feel free to add a respective comment.
Sorry yeah forgot I can just use my forum login - added it.