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

How to use Library Eigen on iPhone 4

Tags: None
(comma "," separated)
jorgenluis004
Registered Member
Posts
2
Karma
0
OS

How to use Library Eigen on iPhone 4

Fri Sep 02, 2011 11:27 pm
We are developing an application for iphone 4 in xcode4 where we get an error when compiling for the device:

{standard input}: unknown: Undefined local symbol LC85
{standard input}: unknown: Undefined local symbol LC86
Command / Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

We are using the gcc 4.2 and Eigen packages such as SVD, Array, QR, LU, Core, Cholesky, etc.
However when compiling for the iPhone Simulator 4 gives no error.

As could be solved?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
this seems to be the same issue as here:
viewtopic.php?f=74&t=94774

and it seems this has never been really fixed. In the meantime you could #define EIGEN_DONT_VECTORIZE

Also, which version of Eigen are you using?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
could you try the following patch to see if that does the trick? (I cannot test myself)

Code: Select all
diff -r 83521c523b99 Eigen/src/Core/arch/NEON/Complex.h
--- a/Eigen/src/Core/arch/NEON/Complex.h   Thu Aug 25 07:42:32 2011 +0100
+++ b/Eigen/src/Core/arch/NEON/Complex.h   Sat Sep 03 03:26:07 2011 +0200
@@ -27,8 +27,6 @@
 
 namespace internal {
 
-static uint32x4_t p4ui_CONJ_XOR = { 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
-static uint32x2_t p2ui_CONJ_XOR = { 0x00000000, 0x80000000 };
 
 //---------- float ----------
 struct Packet2cf
@@ -74,12 +72,14 @@
 template<> EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) { return Packet2cf(pnegate<Packet4f>(a.v)); }
 template<> EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a)
 {
+  const uint32x4_t p4ui_CONJ_XOR = { 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
   Packet4ui b = vreinterpretq_u32_f32(a.v);
   return Packet2cf(vreinterpretq_f32_u32(veorq_u32(b, p4ui_CONJ_XOR)));
 }
 
 template<> EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b)
 {
+  const uint32x4_t p4ui_CONJ_XOR = { 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
   Packet4f v1, v2;
   float32x2_t a_lo, a_hi;
 
@@ -179,6 +179,7 @@
 
 template<> EIGEN_STRONG_INLINE std::complex<float> predux_mul<Packet2cf>(const Packet2cf& a)
 {
+  const uint32x2_t p2ui_CONJ_XOR = { 0x00000000, 0x80000000 };
   float32x2_t a1, a2, v1, v2, prod;
   std::complex<float> s;
 

smh0816
Registered Member
Posts
1
Karma
0
ggael's patch code works only when I include Eigen/Core and use basic arithmatic functions.
Though, it also makes a compile error when I use SVD function such as 'jacobiSvd' in Eigen/SVD.
Anyone has solved this problem?

@ I am using the latest Eigen (ver 3.0.3) and iOS 4.3.4 with iPhone 3GS and Xcode 4.1
TC1
Registered Member
Posts
4
Karma
0
OS
One thing I can suggest from personal experience -- try getting a somewhat decent version of a compiler. GCC 4.2 is pre-historic by now, and I know that the fruit company isn't too keen on updates, but I had my fair share of trouble with a product I do for Mac OS and most, if not all, of them went away by getting a newer compiler.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]