[Ves] ndk-build NDK_DEBUG=1

Ariel Hernán Curiale curiale at gmail.com
Mon Nov 26 04:23:26 EST 2012


Hi Pat,

Thanks for you reply. I think that the only way to debug native code into eclipse is using the Android.mk file. I will configure Android.mk by hand and set all dependencies.

About TestKiwiImage.cpp:

>> About the TestKiwiImage.cpp, I've had some troubles to compile the
>> VES_HOST_SUPERBUILD. I got some errors ( OpenGLES/ES2/gl.h file not found).
>> I thought that the GL library are including in Xcode 4.4
>> Where can I find just the file TestKiwiImage.cpp ?


Thanks.
__________________________________
| Ariel Hernán Curiale Ph.D Student
| ETSI Telecomunicación
| Universidad de Valladolid
| Campus Miguel Delibes
| 47011 Valladolid, Spain
| Phone: 983-423000 ext. 5590
| Web: www.curiale.com.ar
|_________________________________

El 26/11/2012, a las 00:31, Pat Marion escribió:

> CMake is a replacement for Android.mk files and ndk-build.  CMake is
> used to compile the VTK and VES libraries in a cross platform way, so
> that they can be built for iOS, Android, and host architectures.
> 
> The file you are talking about is
> Apps/Android/Kiwi/jni/KiwiNative.cpp.  This file is not part of the
> VES cross platform library, it is part of the KiwiViewer app for
> Android.  A CMakeLists.txt is provided to compile KiwiNative.cpp as a
> shared library so that it may be loaded as a JNI library by the Kiwi
> Java app.  Instead of using CMake to compile KiwiNative.cpp, you could
> write an Android.mk file and use ndk-build, that will work fine.  The
> reason that CMake is preferred is because it makes it easier to lookup
> the required VES and VTK include dirs and libraries to link the JNI
> shared library.  But, you could also list these things in an
> Android.mk file and then use ndk-build.
> 
> Pat
> 
> On Sun, Nov 25, 2012 at 11:27 PM, Ariel Hernán Curiale
> <curiale at gmail.com> wrote:
>> Hi Pat,
>> 
>> About the native compilation, I don't understand a few points:
>> 
>> 1) According to the NDK-GDB.html provided by android-ndk-r8b I need to
>> compile the .cxx files using the script 'ndk-build'. I'm using a modified
>> version of the script configure_cmake included into the Kiwi App.
>> In particular I modified this script to create a eclipse project. I use this
>> script:
>> 
>> $CMAKE -DCMAKE_ECLIPSE_EXECUTABLE="/Applications/eclipse"\
>>       -DCMAKE_ECLIPSE_VERSION="4.2 (Juno)"\
>>       -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN\
>>       -DANDROID_NATIVE_API_LEVEL=8\
>>       -DCMAKE_BUILD_TYPE="Debug"\
>>       -DVTK_DIR=$VTK_DIR\
>>       -DVES_DIR=$VES_DIR\
>>       -G "Eclipse CDT4 - Unix Makefiles"\
>>       $eclipse_dir
>> 
>> 
>> 
>> This script configure properly the dependencies of the ves library but I
>> think that this script configure eclipse to use the make command instead
>> ndk-build to compile the .cxx.
>> 
>> Is there a way to use cmake to configure the ves libraries and use the
>> ndk-build to compile the .cxx ?
>> 
>> 2) According to all the tutorials that I read, including your
>> recommendation,  them use the file Android.mk to configure and build .cxx
>> files.
>> When I use cmake to create the project, cmake configure all files  and I
>> don't need to use the Android.mk. Indeed I think that I must not create the
>> Android.mk file because I use the cmake to configure the way to compile the
>> .cxx files.
>> 
>> 
>> 
>> I'm a bit confuse about if the cmake is configured to use ndk-build to
>> build the .cxx or if its just use the make command.
>> How can I use ndk-build instead of make ?
>> 
>> 
>> I know how to compile and debug native libraries using Android.mk but I
>> don't know how to merge this with the configuration created by the cmake.
>> 
>> 
>> 
>> 
>> 
>> About the TestKiwiImage.cpp, I've had some troubles to compile the
>> VES_HOST_SUPERBUILD. I got some errors ( OpenGLES/ES2/gl.h file not found).
>> I thought that the GL library are including in Xcode 4.4
>> Where can I find just the file TestKiwiImage.cpp ?
>> 
>> Thanks a lot.
>> __________________________________
>> | Ariel Hernán Curiale Ph.D Student
>> | ETSI Telecomunicación
>> | Universidad de Valladolid
>> | Campus Miguel Delibes
>> | 47011 Valladolid, Spain
>> | Phone: 983-423000 ext. 5590
>> | Web: www.curiale.com.ar
>> |_________________________________
>> 
>> El 19/11/2012, a las 08:53, Pat Marion escribió:
>> 
>> Hi Ariel,
>> 
>> You should use CMAKE_BUILD_TYPE=Debug, which will pass the
>> CMAKE_CXX_FLAGS_DEBUG to the compiler.  If you need to add additional flags,
>> you can modify that variable.  If you want to debug native code on android
>> using the ndk gdb, you could try following some tutorials like this one:
>> http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/
>> 
>> Pat
>> 
>> On Sun, Nov 18, 2012 at 5:22 AM, Ariel Hernán Curiale <curiale at gmail.com>
>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I did a native library and I want to debug it. I know how to do this using
>>> eclipse and Android.mk but using VES I have some scripts to create and
>>> configure the project . Also, I have some CMakeLists.txt and I don't know
>>> how to set properly the debugger.
>>> 
>>> I tried to set using the flag CMAKE_BUILD_TYPE
>>> (-DCMAKE_BUILD_TYPE="Debug") but nothing.
>>> 
>>> 
>>> If anyone knows how to debug a native library built using VES please tell
>>> me how can I debug it.
>>> 
>>> Thanks,
>>> __________________________________
>>> | Ariel Hernán Curiale Ph.D Student
>>> | ETSI Telecomunicación
>>> | Universidad de Valladolid
>>> | Campus Miguel Delibes
>>> | 47011 Valladolid, Spain
>>> | Phone: 983-423000 ext. 5590
>>> | Web: www.curiale.com.ar
>>> |_________________________________
>>> 
>>> 
>>> _______________________________________________
>>> Ves mailing list
>>> Ves at public.kitware.com
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>>> 
>> 
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20121126/8f84ba0d/attachment.htm>


More information about the Ves mailing list