vector undefined symbol

vector undefined symbol

Hello,

I am porting a code to Xeon Phi (using manual offload) and I am experimenting some trouble to compile/execute code with STL vectors on MIC. I isolated a small test case which reproduces the problem (see attached files).

Using classical compilation generates the executable but execution fails :

$ icpc  -fPIC -fopenmp  ../Code/DATA/RegionF.cxx -I ../Code/DATA
$ ./a.out
On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/192143/load_lib/icpcoutAoy76m: undefined symbol: _ZNSt6vectorIiSaIiEEC1IiEET_S3_RKS0_
On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/192143/load_lib/icpcoutAoy76m: undefined symbol: _ZNSt6vectorIiSaIiEEC1IiEET_S3_RKS0_"
offload error: cannot load library to the device 0 (error code 20)

$ c++filt _ZNSt6vectorIiSaIiEEC1IiEET_S3_RKS0_
std::vector<int, std::allocator<int> >::vector<int>(int, int, std::allocator<int> const&)

There is a missing symbol concerning std::vector on the MIC side.

If I compile using verification option, it gives me details on the error :

$ icpc  -fPIC -fopenmp -offload-option,mic,compiler,"-z defs"  ../Code/DATA/RegionF.cxx -I ../Code/DATA
/tmp/pbs.1698391.tu-adm01/icpckl957f.o: In function `data::Region::isInside(data::Region const&) const':
../Code/DATA/RegionF.cxx:(.text+0xda): undefined reference to `std::allocator<int>::allocator()'
../Code/DATA/RegionF.cxx:(.text+0xed): undefined reference to `std::vector<int, std::allocator<int> >::vector<int>(int, int, std::allocator<int> const&)'
../Code/DATA/RegionF.cxx:(.text+0xf7): undefined reference to `std::allocator<int>::~allocator()'
../Code/DATA/RegionF.cxx:(.text+0x101): undefined reference to `std::vector<int, std::allocator<int> >::~vector()'
../Code/DATA/RegionF.cxx:(.text+0x116): undefined reference to `std::allocator<int>::~allocator()'

May be I missed something, I tryed to include the #include <vector> into the #pragma offload_attribute(push,target(mic))
region but it's giving me another error.

Is someone can help me to make this small code to work ?

Regards,

 

AnhangGröße
Herunterladen RegionF.cxx617 Bytes
Herunterladen RegionF.h409 Bytes
2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Oups adding ALL includes into to #pragma offload_attribute solve the issue.

Regards,

Melden Sie sich an, um einen Kommentar zu hinterlassen.