This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen on iPhone

Tags: None
(comma "," separated)
thespiders
Registered Member
Posts
15
Karma
0

Eigen on iPhone

Mon Mar 22, 2010 10:39 am
Hello folks,

We plan to port our particle simulation to iPhone. The simulation is based on the Eigen vector library. Especially we use linear solving (matrix inversion) and SVD.

Is it possible to use Eigen on iPhone? (There are no libs needed to link, however there are many compiler flags in the headers)

Regards, Johannes
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Eigen on iPhone

Mon Mar 22, 2010 11:02 am
What CPU, OS, compiler does the iPhone have?

- Eigen runs very well at least on ARM embedded CPUs
- Eigen runs very well on Mac OS X
- Eigen is well tested with GCC. As for LLVM, it works with the LLVM-GCC C++ front-end.

So if that is what's inside an iPhone, you can be optimistic. Might require a few adjustments as you're probably the first one to be doing that...


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
thespiders
Registered Member
Posts
15
Karma
0

Re: Eigen on iPhone

Mon Mar 22, 2010 11:20 am
bjacob wrote:What CPU, OS, compiler does the iPhone have?

- Eigen runs very well at least on ARM embedded CPUs
- Eigen runs very well on Mac OS X
- Eigen is well tested with GCC. As for LLVM, it works with the LLVM-GCC C++ front-end.

So if that is what's inside an iPhone, you can be optimistic. Might require a few adjustments as you're probably the first one to be doing that...


The iPhone uses an ARM 1176 (according to Wikipedia). For its "iPhone OS" there exists the iPhoneSDK API for Mac and it uses GCC. Languages are Objective-C but you can also compile C++.

I will try if it works soon...


Regards, Johannes
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Eigen on iPhone

Mon Mar 22, 2010 11:33 am
ok, so in principle you should have no problem using Eigen there.

FYI, if this ARM CPU has NEON SIMD instructions, Eigen3 is able to use that (vectorization) for dynamic-sized matrices (a GCC bug is preventing us from using that with fixed-size matrices).


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
thespiders
Registered Member
Posts
15
Karma
0

Re: Eigen on iPhone

Wed Mar 24, 2010 2:52 pm
Well, Eigen 2.x runs on iPhone with the compiler described above. The Geometry and SVD runs, too.

However, I experience some issue with the LU module. When inverting a matrix I get a "branch out of range" error and the compilation aborts. I didn't look into that yet, maybe it is a smaller problem.

Btw., the performance of my particle simulation is weak, compared to a PC (not surprisingly). Where on my Athlon XP 2600+ a simulation run takes 0.2 sec. on iPhone it takes 10 sec. in this first unadapted configuration.

Regards, Johannes
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Eigen on iPhone

Wed Mar 24, 2010 3:24 pm
This "branch out of range" message sounds like an internal compiler error. What GCC version are you using? Apple has a very bad record of using completely outdated GCC versions, such as 4.0. For Eigen, we recommend GCC 4.2 or newer, although we support GCC all the way back to 3.3. FYI, GCC 4.2 produces 4x faster code with Eigen than GCC 4.1, in many cases. GCC 4.4 is even better.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
thespiders
Registered Member
Posts
15
Karma
0

Re: Eigen on iPhone

Wed Mar 24, 2010 4:36 pm
bjacob wrote:This "branch out of range" message sounds like an internal compiler error. What GCC version are you using? Apple has a very bad record of using completely outdated GCC versions, such as 4.0. For Eigen, we recommend GCC 4.2 or newer, although we support GCC all the way back to 3.3. FYI, GCC 4.2 produces 4x faster code with Eigen than GCC 4.1, in many cases. GCC 4.4 is even better.

It says "com.apple.compilers.gcc.4_2".
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Eigen on iPhone

Fri Mar 26, 2010 2:27 pm
ok, interesting. Can you then paste the whole compiler output?


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
thespiders
Registered Member
Posts
15
Karma
0

Re: Eigen on iPhone

Wed Mar 31, 2010 3:39 pm
bjacob wrote:ok, interesting. Can you then paste the whole compiler output?


Hmm, now the LU is working. I don't know what I changed since the last time, maybe it's because of sun flares.

Thanks for your help, anyway.
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Eigen on iPhone

Wed Mar 31, 2010 3:47 pm
Np. By the way, see the last thread with kfriddile, he announced that there are several Eigen-based games in the iPhone app store.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]