Quantcast
Channel: Intel® Many Integrated Core Architecture
Viewing all articles
Browse latest Browse all 1347

Xeon Phi Cilk Offload: problem with libraries

$
0
0

I try to use Cilk_offload on host + Xeon Phi. test.cc:

#pragma offload_attribute (push,target(mic))
#include <vector>
#include <string>
#pragma offload_attribute (pop)

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

using namespace std;


int main(const int argc, const char *argv[]) {

 #pragma offload target(mic:0)
{
        vector<int> tmp;
        tmp.push_back(10);
        printf("%d\n",tmp[0]);

}

  return 0;
 }

 

Building: icc test.cc -o test

When I try to run it, I get the following error:

x86_64-k1om-linux-ld: /usr/linux-k1om-4.7/linux-k1om/usr/lib64/libmyo-service.so: undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5'
x86_64-k1om-linux-ld: note: 'pthread_key_delete@@GLIBC_2.2.5' is defined in DSO /usr/linux-k1om-4.7/linux-k1om/lib64/libpthread.so.0 so try adding it to the linker command line
/usr/linux-k1om-4.7/linux-k1om/lib64/libpthread.so.0: could not read symbols: Invalid operation

And if I remove "#include <string>", everything is ok.

I need <vector> and <string> in a complex program where I have the same problem.

What should I do?

 


Viewing all articles
Browse latest Browse all 1347

Trending Articles