0

I have switched my compiler to LLVM GCC 4.2 in XCode 4.2 from GCC and have run into a strange linker error for the _mm_shuffle_ps intrinsic under OpenMP. This function will works else where but once I put it within a omp block it starts generating the following linker error:

"___builtin_ia32_shufps", referenced from:
__ZN7Annulus12traceFactorsEP9PrimitiveP8VFMatrix.omp_fn.0 in Annulus.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

The basic structure of my code is as follows :

#pragma omp parallel {
    //Some stuff
    #pragma omp for {
        //Do more stuff including _mm_shuffle_ps
    }
}

The code works fine in GCC 4.2 so is this a bug in the LLVM GCC implementation of OpenMP or do I need an exotic compiler flag?

cubiclewar
  • 1,569
  • 3
  • 20
  • 37
  • perhaps you should tell use the platform (CPU arch?) and compiler flags used. It is looking like you are missing a ia32 specific function, but you are linking the x86_64 version. Perhaps the compiler flags/defines are off – sehe Nov 12 '11 at 23:28
  • I am compiling on a MacPro (OS X 10.7.2, 2.8 GHz Quad-Core Intel Xeon), however I have also tried on a MacPro (OS X 10.6.8, 2 x 2.26 Quad Core Intel Xeon). The compiler flags are all the Xcode defaults with OpenMP and SSE enabled. As it works outside of the OpenMP blocks I would think its not my existing settings. – cubiclewar Nov 12 '11 at 23:45

2 Answers2

0

Totally a bug. Please file it. Thanks.

echristo
  • 1,687
  • 10
  • 8
0

Just FYI:

I have the same problem here, but with the shuf_pd instruction. Other intrinsics work just fine. I just filed that bug to Apple.

There may be a workaround I have not tried yet: Put all the SSE code into a different function and call it from the OpenMP loop.

  • I have also filed a bug with Apple. Yes I was thinking about putting it in another function however to get the same performance it would have to be inline which would probably still give the error. In the meantime I have dropped back to using GCC4.2 – cubiclewar Nov 24 '11 at 09:33