Search code examples
c++c++11intelicc

Error with Intel C++ compiler: identifier "_Compare" is undefined


I am able to compile the following a std=c++11 required code with g++ using the following command:

g++ test.cpp -std=c++11 -Wl,-rpath,/share/apps/gcc/6.3.0/lib64

the code:

#include <chrono>
#include <map>
#include <memory>
#include <thread>
#include <utility>
int main() {
  typedef std::unique_ptr<int> intPointer;
  intPointer p(new int(10));
  std::map<int, std::unique_ptr<int>> m;
  m.insert(std::make_pair(5, std::move(p)));
  auto start = std::chrono::system_clock::now();
  if (std::chrono::system_clock::now() - start < std::chrono::seconds(2))
  {
      std::thread t;
  }
}

The very same command(probably I don't know the correct one) wont work for intel compiler:

icpc test.cpp -std=c++11 -Wl,-rpath,/share/apps/intel/2016.1.056/vtune_amplifier_xe_2016.1.1.434111/target/linux64/lib64

The error is:

In file included from /share/apps/gcc/6.3.0/include/c++/6.3.0/map(60),
             from test.cpp(2):
/share/apps/gcc/6.3.0/include/c++/6.3.0/bits/stl_tree.h(1437): 
error: identifier "_Compare" is undefined
     && is_nothrow_move_assignable<_Compare>::value)
                                   ^

In file included from /share/apps/gcc/6.3.0/include/c++/6.3.0/map(60),
             from test.cpp(2):
/share/apps/gcc/6.3.0/include/c++/6.3.0/bits/stl_tree.h(1778): 
error: identifier "_Compare" is undefined
  _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
  ^

What am I doing wrong, and how should I fix this.


Solution

  • Well I checked with Intel agents and it turned out that Intel 16 do not support gcc6.3, the support comes in Intel 17.