Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
47 Views

-std=c++17 fails with std::random on 19.0.4.243 20190416

*** test.cpp ***

#include <random>

int main(int argc, char** argv) {

   std::random_device r;

   return 0;

}

The above code fail with --std=c++17 on 19.0.4.243 20190416.

shell> icpc -std=c++17 test.cpp -o test
/tmp/icpcnzeTcw.o: In function `main':
test.cpp:(.text+0x39): undefined reference to `__builtin_is_constant_evaluated'

However, it is okay with both c++11 and c++14

shell> icpc -std=c++14 test.cpp -o test

shell> icpc -std=c++11 test.cpp -o test

shell>

I am using RHEL 7.6.

Thanks,

Sunwoo

0 Kudos
4 Replies
Highlighted
Moderator
47 Views

spdlvme080 tmp]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

spdlvme080 tmp]$ cat t.cpp
#include <random>

int main(int argc, char** argv) {

   std::random_device r;

   return 0;

}
spdlvme080 tmp]$ icpc t.cpp  -std=c++17
spdlvme080 tmp]$
 

Let me see if I can find RHEL7.6 to try.

 

0 Kudos
Highlighted
Beginner
47 Views

This problem happened whent g++ 9.1 is used as a back-end.

Thanks,

Sunwoo

0 Kudos
Highlighted
Novice
47 Views

Is this an issue with the Intel compiler, or will the `-std=c++11` always be required, when using gcc >= 9.x as the backend? I'm having the same problem with the LAMMPS software package: https://github.com/lammps/lammps/issues/1585 I'm using: icpc version 19.0.4.243 (gcc version 9.1.0 compatibility)
0 Kudos
Highlighted
Moderator
47 Views

0 Kudos