Add Eigen library to NDK

612 views
Skip to first unread message

Eduardo Santamaría Vázquez

unread,
Jan 18, 2018, 10:39:32 AM1/18/18
to android-ndk
Hi!

I'm triying to add Eigen library to my Andorid Projects to do some linear algebra operations. This library doesn't need to be compiled, just include the headers so I thought it would be easy, but i can't do it.  I've been looking for  information on this topic, but there isn't too much. I've tried to copy the folder with the headers in the NDK folder (..\Android\Sdk\ndk-bundle\sysroot\usr\include) buy it didn't work (Android Studio don't detect the fodler). How can i do it? 

Thank you in advance!

Kenneth Geisshirt

unread,
Jan 19, 2018, 1:40:09 PM1/19/18
to andro...@googlegroups.com
Hey Eduardo,

Do you plan to access the matrices from Java or only using it in your C++ code?

In Android Studio you can add support for C++ code in a project (see https://groups.google.com/forum/#!topic/android-ndk/3kAhx15wUXs), and then you can copy Eigen into your app's source code.

- Kenneth

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/2aaeec3f-0ba3-4a65-8aff-7358c7eb6c80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Kenneth Geisshirt, M.Sc., Ph.D.
Majbøl Allé 18, DK-2770 Kastrup, +45 60 62 71 82

Alex Cohn

unread,
Jan 20, 2018, 5:43:18 PM1/20/18
to android-ndk
Well, modifying the NDK directories is not a particularly good idea. You are supposed to add the Eigen directory to your project (Android.mk or CMakeLists.txt, depending on your build tools). But an experiment shows that Android Studio finds the file sysroot\usr\include\q\qq.h, if it is included as #include "q/qqq.h".

BR,
Alex

Kenneth Geisshirt

unread,
Jan 20, 2018, 9:47:22 PM1/20/18
to android-ndk
Hi again,

I have created https://github.com/kneth/EigenDemo to show how you can add Eigen to your app. I am using git submodule to pull Eigen into the app.

- Kenneth
Reply all
Reply to author
Forward
0 new messages