Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Hi, I am having some trouble compiling osg for Android... These are the options I pick with cmake: Code: OSG_GL1_AVAILABLEOFF OSG_GL2_AVAILABLEOFF OSG_GL3_AVAILABLEOFF OSG_GLES1_AVAILABLE OFF OSG_GLES2_AVAILABLE ON OPENGL_INCLUDE /home/rubn/data/android/gl/khronos_headers/GLES2 OPENGL_LIBRARY /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libGLESv2.so OPENGL_egl_LIBRARY /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libEGL.so OSG_GL_DISPLAYLISTS_AVAILABLEOFF SG_GL_MATRICES_AVAILABLE OFF OSG_GL_VERTEX_FUNCS_AVAILABLEOFF OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE OFF OSG_GL_FIXED_FUNCTION_AVAILABLE OFF OSG_CPP_EXCEPTIONS_AVAILABLE OFF OSG_BUILD_ANDROID_PLATFORM ON ANDROID_NDK/home/rubn/data/android/android-ndk DYNAMIC_OPENTHREADS OFF DYNAMIC_OPENSCENEGRAPHOFF When I press generate everything works just fine, no error messages... When I try to compile using make from the shell, I get: Code: rubn@CPU00063:~/data/OpenSceneGraph/build$ make [ 0%] Generating Android-OpenSceneGraph Android NDK: NDK installation path auto-detected: '/home/rubn/data/android/android-ndk' Android NDK: GNU Make version 3.81 detected Android NDK: Host OS was auto-detected: linux Android NDK: Host CPU was auto-detected: x86 Android NDK: HOST_TAG set to linux-x86 Android NDK: Host awk tool was auto-detected: awk Android NDK: Host awk test returned: Pass Android NDK: This NDK supports the following toolchains and target ABIs: Android NDK:arm-linux-androideabi-4.4.3: armeabi armeabi-v7a Android NDK:x86-4.4.3: x86 Android NDK: Found platform root directory: /home/rubn/data/android/android-ndk/platforms Android NDK: Found supported platforms: android-3 android-4 android-5 android-8 android-9 Android NDK: PLATFORM android-3 supports: arm x86 Android NDK: ABI arm sysroot is: /home/rubn/data/android/android-ndk/platforms/android-3/arch-arm Android NDK: ABI x86 sysroot is: /home/rubn/data/android/android-ndk/platforms/android-3/arch-x86 Android NDK: PLATFORM android-4 supports: arm x86 Android NDK: ABI arm sysroot is: /home/rubn/data/android/android-ndk/platforms/android-4/arch-arm Android NDK: ABI x86 sysroot is: /home/rubn/data/android/android-ndk/platforms/android-4/arch-x86 Android NDK: PLATFORM android-5 supports: arm x86 Android NDK: ABI arm sysroot is: /home/rubn/data/android/android-ndk/platforms/android-5/arch-arm Android NDK: ABI x86 sysroot is: /home/rubn/data/android/android-ndk/platforms/android-5/arch-x86 Android NDK: PLATFORM android-8 supports: arm x86 Android NDK: ABI arm sysroot is: /home/rubn/data/android/android-ndk/platforms/android-8/arch-arm Android NDK: ABI x86 sysroot is: /home/rubn/data/android/android-ndk/platforms/android-8/arch-x86 Android NDK: PLATFORM android-9 supports: arm x86 Android NDK: ABI arm sysroot is: /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm Android NDK: ABI x86 sysroot is: /home/rubn/data/android/android-ndk/platforms/android-9/arch-x86 Android NDK: Found stable platform levels: 3 4 5 8 9 Android NDK: Found max platform level: 9 Android NDK: Looking for AndroidManifest.xml in /home/rubn/data/OpenSceneGraph/build Android NDK: Found it ! Android NDK: Found project path: /home/rubn/data/OpenSceneGraph/build Android NDK: Parsing Application.mk Android NDK: Using build script ./Android.mk Android NDK: Application 'local' is not debuggable Android NDK: Selecting optimization mode through Application.mk: release Android NDK: Adding import directory: /home/rubn/data/android/android-ndk/sources Android NDK: Building application 'local' for ABI 'armeabi' Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for 'armeabi' ABI Android NDK: Looking for imported module with tag 'cxx-stl/gnu-libstdc++' Android NDK: Probing /home/rubn/data/android/android-ndk/sources/cxx-stl/gnu-libstdc++/Android.mk Android NDK: Found in /home/rubn/data/android/android-ndk/sources/cxx-stl/gnu-libstdc++ Android NDK: Trying to define local module 'OpenThreads' in /home/rubn/data/OpenSceneGraph/build/src/OpenThreads/pthreads/Android.mk. Android NDK: But this module was already defined by /home/rubn/data/OpenSceneGraph/build/src/OpenThreads/pthreads/Android.mk. /home/rubn/data/android/android-ndk/build/core/build-module.mk:34: *** Android NDK: Aborting.. Stop. make[2]: *** [Android-OpenSceneGraph] Error 2 make[1]: *** [CMakeFiles/ndk.dir/all] Error 2 make: *** [all] Error 2 And that's pretty much it... I also try with $ $ANDROID_NDK/ndk_build NDK_APPLICATION_MK=Application.mk but no luck Android NDK: Trying to define local module 'OpenThreads' in /home/rubn/data/OpenSceneGraph/build/src/OpenThreads/pthreads/Android.mk. Android NDK: But this module was already defined by /home/rubn/data/OpenSceneGraph/build/src/OpenThreads/pthreads/Android.mk. any idea why I am getting this err
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
First, there is a good page in the wiki page with Cmake chain and requirements... and other stuff wich I recomend as a reading before doing anything. Second: NO! caca -> OPENGL_INCLUDE /home/rubn/data/android/gl/khronos_headers/GLES2 NO! caca -> OPENGL_LIBRARY /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libGLESv2.so NO! caca -> OPENGL_egl_LIBRARY /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libEGL.so NO! it's not needed we do it already -> DYNAMIC_OPENTHREADS OFF NO! it's not needed we do it already -> DYNAMIC_OPENSCENEGRAPHOFF Third: >From what i've seen so far some extrange bugs appear when... -You run cmake config twice over the same directory -You use some graphic Cmake frontend version (but i've seen it work also) -You use some Cmake outdated (this shoul be prevented by a fix that was approved a month ago) -Ndk produce some extrange bugs with some distros Fourth: What it's important is: -What version of Ndk are you using? Remember that we recomend r5/b/c (Crystax it's not recommended) -Thrunk or 3.0 Rc ? So... what i recomend you to do: -Clean your directory -Use the Cmake console command Good Luck. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Hi, Thanks a lot for your reply. I tried with the changes that you suggested and still didn't work using the graphic frontend for cmake. Using the console, everything fine. (I used r6, and got osg from trunk). Thanks again! Cheers, ruben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41384#41384 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Cheers for you! I didn't knew r6 was out... oh hell I'll have to add it to the auto detection system :) Have fun with Osg and Android. 2011/7/15 Rubén Díaz > Hi, > > Thanks a lot for your reply. > I tried with the changes that you suggested and still didn't work using the > graphic frontend for cmake. > > > Using the console, everything fine. > (I used r6, and got osg from trunk). > > Thanks again! > > Cheers, > ruben > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=41384#41384 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Hi again, > Have fun with Osg and Android. Thanks, I'll do my best :P I've been checking out the android examples, both osgAndroidExampleGLES1 and osgAndroidExampleGLES2. No problem with osgAndroidExampleGLES1 :) But when it comes to do the same thing with osgAndroidExampleGLES2, I am not having the same luck. I get a bunch of errors when I use ndk-build. I am gonna assume that osg has been compiled using the OpenGL ES 1.1 API? Do I have to recompile or something? Thanks once again. Cheers, Rubén -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41427#41427 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Yes, you have to build two versions of OSG one with Gles1 and one with Gles2. According the Ndk google group it's not good to mix them up. If you used the cmake chain that was on the wiki I think it was for Gles1 ... if not I don't know. But as I was saying you need one for each one. Although looking how they load libraries in Android it "should be theorically possible" to build with support for both of them... But i've not delved into the subject... I'm bussy with my End of Degree project so... it's not something prioritary for me and i'm not testing those posibilities, right now I'm more concerned to do Osg Dynamic Linking to ease the life of developing with OSG and Android. Good luck and keep the Robot Fight! 2011/7/18 Rubén Díaz > > But when it comes to do the same thing with osgAndroidExampleGLES2, I am > not having the same luck. I get a bunch of errors when I use ndk-build. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Cool, thanks! Good luck with your project! Cheers, Rubén -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41494#41494 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Hi, just a quick one... (I was not sure whether I should have posted it here or somewhere else. anyway...) I was testing the example application for OpenGL ES 2.0 and worked flawlessly using the Android 2.2 SDK. I tested on a Samsung Galaxy Tablet. I am testing now, using the Android 3.1 SDK for an ASUS Eee Pad Transformer. And I am out of luck... The result I get is the application starting (I can see the menu but the rest is black) and suddenly exiting a couple of seconds after. No error messages. Is this version of android (3.0 or 3.1) supported? Thank you! Cheers, Rubén -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41700#41700 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Rubén as I said to you I'm not a wise man with enough midiclorians as to have a sentient preescience of time and space that can guess anything. That kind of errors leave a Java Dalvik Exception that you can read through LogCat. Android's applications can crash in a thousand different ways. As i've stated in other threads it has not been tested with 2.3 or 3.X but i recall reading someone who did it. In any case my midiclorian say that you've probably shoot yourself with a shotgun on your foot. That kind of behaviour is typical of a error in finding the initialization method. It can be for a lot of reasons: -You've not configured the compilation to compile the Native part IN that compilation -You've changed some clase names without comprehension about how screen widgets where used in my example. -You have encountered some extrange bug that no one has seen so far or it's not visible in 2.2. If I have to bet on something... i should bet for the two first options because that way of crashing has happened to me a looot of times because the need of changin a name in five different places to change a namespace name (eclipse won't solve everything for you). In any way... the next time that you want help please COPY the java error. It may be gibberish the 20 first times you read it but it makes sense the 21 time you read them. Otherwise i won't help you because i'm not in your shoes. If you are a experienced programmer you know what is the feeling when people ask you for help with "my monitor don't show anything" "it shows a message (withouth saying the message)" and so on. 2011/7/28 Rubén Díaz > Hi, > > just a quick one... (I was not sure whether I should have posted it here or > somewhere else. anyway...) > > I was testing the example application for OpenGL ES 2.0 and worked > flawlessly using the Android 2.2 SDK. I tested on a Samsung Galaxy Tablet. > I am testing now, using the Android 3.1 SDK for an ASUS Eee Pad > Transformer. And I am out of luck... > > The result I get is the application starting (I can see the menu but the > rest is black) and suddenly exiting a couple of seconds after. No error > messages. > Is this version of android (3.0 or 3.1) supported? > > Thank you! > > Cheers, > Rubén > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=41700#41700 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Jorge Izquierdo Ciges wrote: > First, there is a good page in the wiki page with Cmake chain and > requirements... and other stuff wich I recomend as a reading before doing > anything. > Could you link to it? All I found was this: www. openscenegraph. org/projects/osg/wiki/Community/OpenGL-ES Jorge Izquierdo Ciges wrote: > > Second: > NO! caca -> OPENGL_INCLUDE /home/rubn/data/android/gl/khronos_headers/GLES2 > NO! caca -> OPENGL_LIBRARY > /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libGLESv2.so > NO! caca -> OPENGL_egl_LIBRARY > /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libEGL.so > How to set these paths then? I really need a little bit of guidance here... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46254#46254 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
They are not needed at all. OSG compilation, as it is right now doesn't support full Native compilation, it's made by calls through JNI from a Java/Dalvik Code. The egl Context is raised in the Java part and can't be passed down to OSG, that's the reason the examples need to use an "embebed viewer" instead of a simple viewer. If you want/need to use a full Native Activity right now we haven't implemented yet any solution. Currently I'm working precisely in that point, full integration with the new native form. But you still can use the Java/JNI/Native in 3.0 and 4.0 it hasn't been deprecated and it is part of the standard ABI. Moreover the code can be easily converted between them. On a side note, using the NDK scripts and google's build system already provides the proper include directories ( where egl and gles1/2 is located ) so there's no need to use them, and probably if I'm not mistaken I ignored them in the script creation step. To force the platform version just change the platform number in Application.mk or Android.mk (I think it was on Application). In the near future I'm changin some compile options and adding some little features to choose the platform and or the optimizations also I'm working with the damn full native viewer but I'm hitting on walls every two steps so don't expect it to be this week or the next, I won't send it until i can be sure it's more or less bug free and there's no hurry because I'm gonna miss the deadline for the new OSG version. Oh! One more thing don't compile with NDK r7 it has a bug use r7b. It was commented by another user. STL linking was not going well and it was needed to respecify it. 2012/3/14 Bernd Kampl > > Jorge Izquierdo Ciges wrote: > > First, there is a good page in the wiki page with Cmake chain and > requirements... and other stuff wich I recomend as a reading before doing > anything. > > > > > Could you link to it? All I found was this: www. openscenegraph. > org/projects/osg/wiki/Community/OpenGL-ES > > > Jorge Izquierdo Ciges wrote: > > > > Second: > > NO! caca -> OPENGL_INCLUDE > /home/rubn/data/android/gl/khronos_headers/GLES2 > > NO! caca -> OPENGL_LIBRARY > > /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libGLESv2.so > > NO! caca -> OPENGL_egl_LIBRARY > /home/rubn/data/android/android-ndk/platforms/android-9/arch-arm/usr/lib/libEGL.so > > > > > How to set these paths then? I really need a little bit of guidance here... > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=46254#46254 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] problem compiling osg 3.0.0 for Android
Hi, Thank you for your Answer, it clears up some things. I got it to work. The problem was in linking to the standard library. Like you wrote: "NDK r7 has a strange bug with the order of linking std libraries just add -lgnustl_static at the end and it will be solved. " For anyone having the same problem, the solution was to edit the Android.mk file in the project/jni/ folder (project being osgViewerExample[1/2]) on the LOCAL_LDLIBS to change it to this: from LOCAL_LDLIBS:= -llog -lGLESv2 -lz to LOCAL_LDLIBS:= -llog -lGLESv2 -lz -lgnustl_static I'm about to write a tutorial with screenshots to get openscenegraph to run. Thank you! Cheers, Bernd -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46332#46332 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org