Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

std::map::emplace_hint missing when cross-compiling for MIC

Shahzad_Malik_MUZAFF
449 Views

I think it is known issue [http://software.intel.com/en-us/forums/topic/489013 : gcc 4.7.0 header use for iccc version 14.0.2 (gcc version 4.8.0 compatibility)] when cross-compiling for MIC. Following code compile fine with gcc 4.8.1 but it failed to build with icc 14.0.2

#include <map>
int main ()
{
  std::map<char,int> mymap;
  auto it = mymap.end();
  it = mymap.emplace_hint(it,'b',10);
  return 0;
}

>icpc -v
icpc version 14.0.2 (gcc version 4.8.0 compatibility)

>icpc -c -std=c++11 -mmic test.cpp -o test.o
test.cpp(6): error: class "std::map<char, int, std::less<char>, std::allocator<std::pair<const char, int>>>" has no member "emplace_hint"
    it = mymap.emplace_hint(it,'b',10);

Any work around or fix for this available?

0 Kudos
3 Replies
Feilong_H_Intel
Employee
450 Views

Hi Shahzad,

It appears that emplace_hint requires gcc 4.8.  In MPSS 3.1, gcc 4.7 headers is shipped.  That could explain the failure.

If you type "icpc -std=c++11 -mmic test.cpp -o test.o -v", you will see search directories below:

 /usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0
 /usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/backward
 /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include
 /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include-fixed
 /usr/linux-k1om-4.7/linux-k1om/usr/include

Thanks.

0 Kudos
Shahzad_Malik_MUZAFF
450 Views

Thanks, yes gcc 4.7 headers are being pickup. Any idea when MPSS might include 4.8 or above?

0 Kudos
Feilong_H_Intel
Employee
450 Views

Sorry that I don't have that information.

Thanks.

0 Kudos
Reply