Fail to build glmark2 by ndk for an Android 3.1 tablet

Asked by maceo on 2011-09-16

hi There
I'd try to build the glmark2(2011.008) by NDK as an apk to install on my "Acer Iconia A500" tablet which is with Android v3.1.
I followed the procedure in INSTALL.android to install both SDK, NDK and cygwin as well
However, I failed with error below when I build the glmark2 through cygwin console:
========================================================================
$cd /android-ndk-r6b/samples/glmark2-2011.08/android

$ ndk-build
make: *** No rule to make target `jni/src/canvas-android.cpp', needed by `/andro
id-ndk-r6b/samples/glmark2-2011.08/android/obj/local/armeabi/objs/glmark2-androi
d/src/canvas-android.o'. Stop.
========================================================================

My environment is:
[OS]: Windows XP
[Installed tool kit]: SDK, NDK, cygwin

Can anyone help me to solve this?
Am I using the right way to build it through cygwin console?

Question information

Language:
English Edit question
Status:
Solved
For:
glmark2 Edit question
Assignee:
No assignee Edit question
Solved by:
Alexandros Frantzis
Solved:
2011-09-26
Last query:
2011-09-26
Last reply:
2011-09-16

Hmm, can you check if there actually is an android/jni/src/canvas-android.cpp file?

The glmark2 tarball uses symbolic links internally. One guess is that if you extracted the tarball in Windows, the symbolic links where not handled properly. Can you try extracting through cygwin (tar xzf glmark2-2011.08.tar.gz), and see if that changes things?

maceo (maceo1975) said : #2

hi Alex
unzipped the tarball by command do change something.
Now, the return error message becomes
=====================================================================
$ ndk-build
Compile++ thumb : glmark2-android <= android.cpp
arm-linux-androideabi-g++.exe: jni/src/android.cpp: No such file or directory
arm-linux-androideabi-g++.exe: no input files
make: *** [/android-ndk-r6b/samples/glmark2-2011.08/android/obj/local/armeabi/ob
js/glmark2-android/src/android.o] Error 1
=====================================================================

Below is the file tree after extracted.
the /jni/src/ is a link to redirect the reference path to the real source path(i.e. /glmark2-2011.08/src/)
However, it seems not workable to re-directory the path to get the source file.

C:\cygwin\android-ndk-r6b\samples\glmark2-2011.08
│ COPYING
│ filetree.log
│ INSTALL
│ INSTALL.android
│ NEWS
│ README
│ waf
│ wscript

├─android
│ │ Android.mk
│ │ AndroidManifest.xml
│ │ CleanSpec.mk
│ │ default.properties
│ │
│ ├─jni
│ │ Android.mk
│ │ Android.ndk.mk
│ │ Application.mk
│ │ src (it seems a link to redirect path ../../src)
│ │
│ ├─res
│ │ └─values
│ │ strings.xml
│ │
│ └─src
│ └─org
│ └─linaro
│ └─glmark2
│ Glmark2Activity.java
│ Glmark2SurfaceView.java

├─data
│ │ wscript_build
│ │
│ ├─models
│ │ asteroid-high.3ds
│ │ asteroid-low.3ds
│ │ cat.3ds
│ │ cube.3ds
│ │ horse.3ds
│ │
│ ├─shaders
│ │ bump-normals.frag
│ │ bump-normals.vert
│ │ bump-poly.frag
│ │ bump-poly.vert
│ │ conditionals-step-conditional.all
│ │ conditionals-step-simple.all
│ │ conditionals.frag
│ │ conditionals.vert
│ │ effect-2d-convolution.frag
│ │ effect-2d.vert
│ │ function-call.all
│ │ function-step-low.all
│ │ function-step-medium.all
│ │ function.frag
│ │ function.vert
│ │ light-advanced.frag
│ │ light-advanced.vert
│ │ light-basic-tex.frag
│ │ light-basic.frag
│ │ light-basic.vert
│ │ light-phong.frag
│ │ light-phong.vert
│ │ loop-step-loop.all
│ │ loop-step-simple.all
│ │ loop.frag
│ │ loop.vert
│ │ pulsar-light.vert
│ │ pulsar.vert
│ │
│ └─textures
│ asteroid-normal-map.png
│ crate-base.png
│ effect-2d.png

├─doc
│ glmark2.1.in
│ wscript_build

└─src
    │ android.cpp
    │ benchmark.cpp
    │ benchmark.h
    │ canvas-android.cpp
    │ canvas-android.h
    │ canvas-x11-egl.cpp
    │ canvas-x11-egl.h
    │ canvas-x11-glx.cpp
    │ canvas-x11-glx.h
    │ canvas-x11.cpp
    │ canvas-x11.h
    │ canvas.h
    │ gl-headers.h
    │ log.cpp
    │ log.h
    │ main.cpp
    │ mesh.cpp
    │ mesh.h
    │ model.cpp
    │ model.h
    │ options.cpp
    │ options.h
    │ scene-build.cpp
    │ scene-bump.cpp
    │ scene-conditionals.cpp
    │ scene-default-options.cpp
    │ scene-effect-2d.cpp
    │ scene-function.cpp
    │ scene-grid.cpp
    │ scene-loop.cpp
    │ scene-pulsar.cpp
    │ scene-shading.cpp
    │ scene-texture.cpp
    │ scene.cpp
    │ scene.h
    │ shader-source.cpp
    │ shader-source.h
    │ texture.cpp
    │ texture.h
    │ util.cpp
    │ util.h
    │ wscript_build
    │
    ├─libmatrix
    │ COPYING
    │ Makefile
    │ mat.cc
    │ mat.h
    │ matrix_inverse_test.cc
    │ program.cc
    │ program.h
    │ README
    │ stack.h
    │ vec.h
    │
    └─libpng
            ANNOUNCE
            CMakeLists.txt
            INSTALL
            KNOWNBUG
            LICENSE
            png.c
            png.h
            pngconf.h
            pngerror.c
            pnggccrd.c
            pngget.c
            pngmem.c
            pngpread.c
            pngread.c
            pngrio.c
            pngrtran.c
            pngrutil.c
            pngset.c
            pngtrans.c
            pngvcrd.c
            pngwio.c
            pngwrite.c
            pngwtran.c
            pngwutil.c
            README
            TODO
            Y2KINFO

maceo (maceo1975) said : #3

I just checked the android.cpp is existed in /glmark2-2011.08/src/ (check below from my console)
does the mk file written properly to re-directory the path when looking for cpp files?
=====================================================================
0912057@TWTPED0912057 /android-ndk-r6b/samples/glmark2-2011.08/android/jni
$ ls
Android.mk Android.ndk.mk Application.mk src

0912057@TWTPED0912057 /android-ndk-r6b/samples/glmark2-2011.08/android/jni
$ cd ../../src/

0912057@TWTPED0912057 /android-ndk-r6b/samples/glmark2-2011.08/src
$ ls -al | grep android.cpp
-rw-r--r-- 1 0912057 Domain Users 6464 Aug 18 23:17 android.cpp
-rw-r--r-- 1 0912057 Domain Users 2893 Aug 17 17:10 canvas-android.cpp
=====================================================================

Does "ls android/jni/src" show the correct files?

You can try replacing the symbolic links android/jni/src and android/assets with copies of the linked-to directories to see if this solves the problem. This is of course a hacky solution, but it will at least allow you to move forward and also find out if symbolic links are the culprits here.

maceo (maceo1975) said : #5

Yes, the "ls android/jni/src" commands shows those source file under /glmark2-2011.08/src/ : )

I just copy the src folder to the path "/android/jni/" and compiler is passed, I am moving forward! (let me know if my workaround is incorrect : p )

I am trying to continue building the package from the command line as below (from INSTALL.android):
$ android update project -p . -s
$ ant debug {or release}

thanks a lot!

Don't forget to also copy the data/ folder contents to android/assets

maceo (maceo1975) said : #7

Thanks Alexandros Frantzis, that solved my question.