Software Archive
Read-only legacy content
17061 Discussions

Compiler Problem on MIC with C++11

zibschuett
Beginner
515 Views

Hi, I have trouble compiling the following code with the SP1 version of the Intel C++ compiler. It works with older compilers. [cpp] #include #include int main(int argc, char**argv) { #pragma offload target(mic) { } return 0; } [/cpp] icc -std=c++11 -offload-attribute-target=mic -offload-option,mic,compiler,"-z defs" main.cpp /tmp/icc1jGwdV.o: In function `std::signbit(float)': main.cpp:(.text._ZSt7signbitf[_ZSt7signbitf]+0x2): undefined reference to `__builtin_signbit' /tmp/icc1jGwdV.o: In function `std::signbit(double)': main.cpp:(.text._ZSt7signbitd[_ZSt7signbitd]+0x2): undefined reference to `__builtin_signbit' /tmp/icc1jGwdV.o: In function `std::signbit(long double)': main.cpp:(.text._ZSt7signbite[_ZSt7signbite]+0xd): undefined reference to `__builtin_signbit' /tmp/icc1jGwdV.o: In function `std::nexttoward(float, long double)': main.cpp:(.text._ZSt10nexttowardfe[_ZSt10nexttowardfe]+0xd): undefined reference to `__builtin_nexttowardf'

0 Kudos
9 Replies
TimP
Honored Contributor III
515 Views

You seem to have suppressed important text for your source code.

Are you sure you used icc rather than icpc, and the same version of g++, in both cases?  The current icpc probably works best with g++ 4.7 or 4.8.

0 Kudos
zibschuett
Beginner
515 Views

sorry for that. I wanted to include complex and cmath.

I used icc, but icpc gives the same result.

This is all running on the same machine. We use CentOS 6.4 with gcc 4.4.7 because of the Xeon Phi cards.

0 Kudos
TimP
Honored Contributor III
515 Views

I confirmed this problem.

I thought it might be related to g++ version, but it seems not.  icpc (on host) sometimes misses support for C++11 features on account of g++ 4.4 not supporting them, but the MIC 14.0 compiler should have its own copy of headers from gcc-4.7.

Most rumors of changes for the next 14.0 update refer to performance, not failures, so it may be good to file a formal problem report.

0 Kudos
Kevin_D_Intel
Employee
515 Views

I reported this to Development and will keep this post updated as I learn more. No need for formal problem report.

(Internal tracking id: DPD200295115)

0 Kudos
RKannan
Beginner
515 Views

Is there a workaround for this in the meantime?

0 Kudos
Kevin_D_Intel
Employee
515 Views

I'm sorry I missed your post earlier. Unfortunately, there is no work around at this time. I inquired w/Development regarding the status of a fix. I reiterated the impact/urgency (this has also impacted others not doing offload too) and will update once I hear more.

0 Kudos
Christoph_L_
Beginner
515 Views

I'm still experiencing issues about a "missing symbol definition of __builtin_signbit" when including <algorithm> with C++11 support and offloading to the Xeon Phi (whether actual algorithms of the include are used or not doesn't matter). I'm using the most recent version of MPSS.

The code on the host compiles and runs fine, but when the code is executed on a xeon phi it crashes (a dlopen error message).

 

0 Kudos
Christoph_L_
Beginner
515 Views

Hi,

looking further into it, the inclusion of any one of the following three headers seems to cause trouble: algorithm, cmath and random. A minimal example to reproduce the issue (Compiler version 14.0 and MPSS 3.1.2):

#pragma offload_attribute(push, target(mic))
// Include any one of these three. No need to actually use any function.
#include <random>
#include <cmath>
#include <algorithm>

#pragma offload_attribute(pop)
 

int main() {
  #pragma offload target(mic)
  { }
}

The code compiles and the MIC compiler just brings up a warning about the missing symbols:
*MIC* unresolved __builtin_nexttowardf
*MIC* unresolved __builtin_signbit

The application crashes when the actual offload should take place.

 

0 Kudos
Georg_Z_Intel
Employee
515 Views

Hello,

the problem is fixed with Intel(R) Composer XE 2013 SP1 Update 3. Please give it a try.

Best regards,

Georg Zitzlsberger

0 Kudos
Reply