Ogre for Android on OS X

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
sdong21
Gnoblar
Posts: 7
Joined: Sat Oct 04, 2014 1:48 pm

Ogre for Android on OS X

Post by sdong21 »

I can successfully build Ogre for Android on Windows, but got stuck in OS X.
Is there anyone who can build really Ogre for Android on OS X?
I followed the instructions on http://www.ogre3d.org/tikiwiki/CMake%20 ... on=Android, however, it always used clang++ instead of NDK.

Code: Select all

/usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/users/dongxiaoyang/ogre_1.9.0/cmake/toolchain/android.toolchain.cmake -DOGRE_DEPENDENCIES_DIR="`pwd`/../AndroidDependencies" -DANDROID_ABI=armeabi -DANDROID_NATIVE_API_LEVEL=9 -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.7 ..
-- Configuring OGRE 1.10.0unstable
-- Search path: /Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies;/Users/dongxiaoyang/ogre_1.9.0/cmake/Dependencies;/Users/dongxiaoyang/ogre_1.9.0/Dependencies;/Users/dongxiaoyang/ogre_1.9.0/cmake/../Dependencies;/Users/dongxiaoyang/ogre_1.9.0/../Dependencies
-- Looking for ZLIB...
-- Found ZLIB: optimized;/users/dongxiaoyang/android-ndk-r8e/platforms/android-9/arch-arm/usr/lib/libz.so;debug;/users/dongxiaoyang/android-ndk-r8e/platforms/android-9/arch-arm/usr/lib/libz.so
-- Looking for ZZip...
-- Found ZZip: optimized;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libzzip.a;debug;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libzzip.a
-- Looking for FreeImage...
-- Found FreeImage: optimized;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libFreeImage.a;debug;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libFreeImage.a
-- Looking for FREETYPE...
-- CMAKE_PREFIX_PATH: /Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies;/Users/dongxiaoyang/ogre_1.9.0/cmake/Dependencies;/Users/dongxiaoyang/ogre_1.9.0/Dependencies;/Users/dongxiaoyang/ogre_1.9.0/cmake/../Dependencies;/Users/dongxiaoyang/ogre_1.9.0/../Dependencies;/usr/local;/usr/lib/armv5te-linux-gnu
-- CMAKE_PREFIX_PATH: /Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies;/Users/dongxiaoyang/ogre_1.9.0/cmake/Dependencies;/Users/dongxiaoyang/ogre_1.9.0/Dependencies;/Users/dongxiaoyang/ogre_1.9.0/cmake/../Dependencies;/Users/dongxiaoyang/ogre_1.9.0/../Dependencies;/usr/local;/usr/lib/armv5te-linux-gnu
-- Found FREETYPE: optimized;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libfreetype.a;debug;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libfreetype.a
-- Could NOT find OpenGL (missing:  OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) 
-- Looking for POCO...
-- Could not locate POCO
-- Looking for TBB...
-- Could not locate TBB
-- Looking for GLSL_Optimizer...
-- Could not locate GLSL_Optimizer
-- Looking for HLSL2GLSL...
-- Could not locate HLSL2GLSL
-- Looking for OIS...
-- Found OIS: optimized;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libOIS.a;debug;/Users/dongxiaoyang/ogre_1.9.0/AndroidDependencies/lib/armeabi/libOIS.a
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Looking for Softimage...
-- Could not locate Softimage
-- Could NOT find TinyXML (missing:  TINYXML_INCLUDE_DIR TINYXML_LIBRARIES) 
-- Looking for CppUnit...
-- Could not locate CppUnit
-- 
-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ zlib
+ zziplib
+ freeimage
+ freetype
+ OpenGL ES 1.x
+ OpenGL ES 2.x
+ OpenGL ES 3.x
+ OIS
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ OpenGL 3+: Support for the OpenGL 3+ render system <http://www.opengl.org/>
+ boost: Boost (general) <http://boost.org>
+ boost-thread: Used for threading support <http://boost.org>
+ boost-date_time: Used for threading support <http://boost.org>
+ POCO: POCO framework <http://pocoproject.org/>
+ tbb: Threading Building Blocks <http://www.threadingbuildingblocks.org/>
+ GLSL Optimizer: GLSL Optimizer <http://github.com/aras-p/glsl-optimizer/>
+ HLSL2GLSL: HLSL2GLSL <http://hlsl2glslfork.googlecode.com/>
+ Doxygen: Tool for building API documentation <http://doxygen.org>
+ Softimage: Softimage SDK needed for building XSIExporter <FALSE>
+ TinyXML: TinyXML needed for building OgreXMLConverter <FALSE>
+ CppUnit: Library for performing unit tests <http://cppunit.sourceforge.net>
-----------------------------------------------------------------------------

-- 
----------------------------------------------------------------------------
  FEATURE SUMMARY
----------------------------------------------------------------------------

Building components:
  + Paging
  + MeshLodGenerator
  + Terrain
  + RTShader System
  + RTShader System Core Shaders
  + RTShader System Extensions Shaders
  + Volume
  + Overlay
Building plugins:
  + Octree scene manager
  + Particle FX
Building rendersystems:
  + OpenGL ES 2.x
Building executables:
  + Samples
Building core features:
  + Mesh Lod
  + DDS image codec
  + PVRTC image codec
  + ETC image codec
  + FreeImage codec
  + ZIP archives

Build type:                      static
Threading support:               none
Use double precision:            disabled
Assert mode:                     standard
Allocator type:                  nedmalloc (pooling)
STL containers use allocator:    enabled
Strings use allocator:           disabled
Memory tracker (debug):          disabled
Memory tracker (release):        disabled
Use Boost:                       disabled

----------------------------------------------------------------------------

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/dongxiaoyang/ogre_1.9.0/cmake

localhost:cmake dongxiaoyang$ ~/android-ndk-r8e/prebuilt/darwin-x86/bin/make
[  0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o
clang++: error: unknown argument: '-finline-limit=64' [-Wunused-command-line-argument-hard-error-in-future]
clang++: note: this will be a hard error (cannot be downgraded to a warning) in the future
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
The CMake I am using is Ver. 2.8.12. If I use CMake 3.0.2, it will complain about no full path for clang++.

I have downloaded multiple versions of Android NDK including r8e to r10b, all the same behaviors.

/Users/dongxiaoyang/android-ndk-r10b:
GNUmakefile documentation.html ndk-gdb ndk-which sources
README.TXT find-win-host.cmd ndk-gdb-py platforms tests
RELEASE.TXT ndk-build ndk-gdb-py.cmd prebuilt toolchains
build ndk-build.cmd ndk-gdb.py remove-windows-symlink.sh
docs ndk-depends ndk-stack samples

/Users/dongxiaoyang/android-ndk-r10b-64:
GNUmakefile documentation.html ndk-gdb ndk-which sources
README.TXT find-win-host.cmd ndk-gdb-py platforms tests
RELEASE.TXT ndk-build ndk-gdb-py.cmd prebuilt toolchains
build ndk-build.cmd ndk-gdb.py remove-windows-symlink.sh
docs ndk-depends ndk-stack samples

/Users/dongxiaoyang/android-ndk-r8e:
GNUmakefile build ndk-build ndk-gdb-py ndk-stack prebuilt tests
README.TXT docs ndk-build.cmd ndk-gdb-py.cmd ndk-which samples toolchains
RELEASE.TXT documentation.html ndk-gdb ndk-gdb.py platforms sources

/Users/dongxiaoyang/android-ndk-r9c:
GNUmakefile documentation.html ndk-gdb ndk-which sources
README.TXT find-win-host.cmd ndk-gdb-py platforms tests
RELEASE.TXT ndk-build ndk-gdb-py.cmd prebuilt toolchains
build ndk-build.cmd ndk-gdb.py remove-windows-symlink.sh
docs ndk-depends ndk-stack samples

I have already set ANDROID_NDK environment of course:

localhost:cmake dongxiaoyang$ set
ANDROID_NDK=/users/dongxiaoyang/android-ndk-r8e/
ANDROID_NDK_TOOLCHAINS_PATH=/users/dongxiaoyang/android-ndk-r8e/toolchains/
ANDROID_SDK=/users/dongxiaoyang/adt-bundle-mac-x86_64-20140702/sdk/
ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.7

If I use cmake-gui to manually choose CMAKE_CXX_COMPILER to /Users/dongxiaoyang/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/arm-linux-androideabi/bin/g++, I can compile it, but it won't generate the makefile for SampleBrowserNDK:

localhost:cmake dongxiaoyang$ ls SampleBrowserNDK/
AndroidManifest.xml assets default.properties jni res src
localhost:cmake dongxiaoyang$

Can someone point out what's wrong? Many thanks.
ilotuo
Gnoblar
Posts: 16
Joined: Wed Nov 04, 2015 7:55 am

Re: Ogre for Android on OS X

Post by ilotuo »

Hey ,have you solved it?
How to compile ogre on OSX ?
sdong21
Gnoblar
Posts: 7
Joined: Sat Oct 04, 2014 1:48 pm

Re: Ogre for Android on OS X

Post by sdong21 »

I gave up it at the end actually. Instead I was able to build it on windows for android.