Community
cancel
Showing results for 
Search instead for 
Did you mean: 
215 Views

Unable to use std::complex

I am unable to compile the following snippet that uses std::complex, getting the error "qualified name is not allowed". The version of the compiler  (15.0.6) seems pretty up to date and compatible with the existing gcc installation (5.1.0). Am I missing anything???

#include <cmath>
#include <complex>
namespace tensor {
  typedef std::complex<double> cdouble;
}
 
[nnp05@cierzo ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/cm/local/apps/gcc/5.1.0/libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-5.1.0/configure --prefix=/cm/local/apps/gcc/5.1.0 --enable-languages=c,c++,fortran --with-gmp-include=/root/rpmbuild/BUILD/gcc-5.1.0-obj/../gcc-5.1.0/our-gmp --with-gmp-lib=/root/rpmbuild/BUILD/gcc-5.1.0-obj/../gcc-5.1.0/our-gmp/.libs --with-mpc-include=/root/rpmbuild/BUILD/gcc-5.1.0-obj/../gcc-5.1.0/our-mpc/src --with-mpc-lib=/root/rpmbuild/BUILD/gcc-5.1.0-obj/../gcc-5.1.0/our-mpc/src/.libs --with-mpfr-include=/root/rpmbuild/BUILD/gcc-5.1.0-obj/../gcc-5.1.0/our-mpfr/src --with-mpfr-lib=/root/rpmbuild/BUILD/gcc-5.1.0-obj/../gcc-5.1.0/our-mpfr/src/.libs
Thread model: posix
gcc version 5.1.0 (GCC)
[nnp05@cierzo ~]$ icpc -v
icpc version 15.0.6 (gcc version 5.1.0 compatibility)
[nnp05@cierzo ~]$ icc -v
icc version 15.0.6 (gcc version 5.1.0 compatibility)
0 Kudos
3 Replies
215 Views

As a side note, I am not in control of the Intel C/C++ compiler installation in this cluster, and I would appreciate means to debug whether there has been any misconfiguration, and how to correct it.

TimP
Black Belt
215 Views

I don't have any problem with icpc 15.0.7 or later versions accepting that small snippet.  I assume your g++ matches your gcc and accepts it.

Judith_W_Intel
Employee
215 Views

 

I can't reproduce the error either -- please create a preprocessed file using the -E option and post it here. Are you sure you're including the correct version of the <complex> header and not one that it's in your local workspace? Are you using any compiler options?

BTW 15.0 is an older compiler, the latest supported Intel compiler version is 17.0.

Judy

Reply