Page 1 of 1

Problem when compiling with -std=c++11

PostPosted: Sun Jun 16, 2013 2:14 am
by hazelnusse
I was using LAPACKEin a project that makes use of C++11 features, and hence when it compiles with g++, it uses the 'std=c++11' flag. This flag seems to be incompatible with the current lapacke.h, or at least the way I am using it is incorrect. I made a minimal working example that reproduces the problem below.

Code: Select all
#include <lapacke.h>
int main() {}


It works fine when I compile with:
$ g++ -c test_lapack.cpp

but if I add the c++11 flag:
$ g++ -std=c++11 -c test_lapack.cpp

I get a massive amount of errors (see attachment to this post). I'm guessing this is because things in c++11 got more strict and now things that used to be fine in c++03 or c++98 are now deemed unsafe or deprecated. I don't know if I should be contacting the GNU gcc/g++ people or if this is something in the domain of LAPACK developers, or maybe there is an additional flag I can add that will suppress these errors?

Re: Problem when compiling with -std=c++11

PostPosted: Sun Jun 16, 2013 3:00 pm
by hazelnusse
I'm not sure if this is the recommended way to fix this, but if I put the following #define's at the top of my file, the problem is fixed:

Code: Select all
#define HAVE_LAPACK_CONFIG_H
#define LAPACK_COMPLEX_CPP
#include <lapacke.h>


Is this the recommended way to fix the errors I was running into?

Re: Problem when compiling with -std=c++11

PostPosted: Mon Jun 17, 2013 10:03 am
by admin
Yes thank you. The fix will be included in the next release.