Mellanox/sockperf

Configure attempts to compile c++ code with gcc but not with g++

dmitriy-chizhov90 opened this issue · 2 comments

./configure fails with error
checking for library containing clock_gettime... no
configure: error: librt not found
while attempting to compile c++ code with gcc compiler:
configure:6260: gcc -o conftest -g -O2 conftest.c >&5
conftest.c:35:1: error: unknown type name 'namespace'
35 | namespace conftest {
| ^~~~~~~~~
conftest.c:35:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
35 | namespace conftest {
| ^
conftest.c: In function 'main':
conftest.c:41:8: error: 'conftest' undeclared (first use in this function)
41 | return conftest::clock_gettime ();
| ^~~~~~~~
conftest.c:41:8: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:41:16: error: expected ';' before '::' token
41 | return conftest::clock_gettime ();
| ^~
| ;

./configure CC=g++ may be used as workaround.

What is the compiler version?

uname -m = x86_64
uname -r = 5.15.6-arch2-1
uname -s = Linux
uname -v = #1 SMP PREEMPT Thu, 02 Dec 2021 15:47:09 +0000

configure:3755: checking for g++
configure:3776: found /usr/bin/g++
configure:3787: result: g++
configure:3814: checking for C++ compiler version
configure:3823: g++ --version >&5
g++ (GCC) 11.1.0