Problem when compiling with -std=c++11

Open discussion regarding features, bugs, issues, vendors, etc.

Problem when compiling with -std=c++11

Postby hazelnusse » Sun Jun 16, 2013 2:14 am

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?
Attachments
lapacke_c++11_errors.tar.bz2
g++ -std=c++11 -c ./test_lapack.cpp > /tmp/lapacke_c++11_errors.txt 2>&1
(7.84 KiB) Downloaded 11 times
hazelnusse
 
Posts: 4
Joined: Sun Jun 16, 2013 1:54 am

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

Postby hazelnusse » Sun Jun 16, 2013 3:00 pm

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?
hazelnusse
 
Posts: 4
Joined: Sun Jun 16, 2013 1:54 am

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

Postby admin » Mon Jun 17, 2013 10:03 am

Yes thank you. The fix will be included in the next release.
admin
Site Admin
 
Posts: 468
Joined: Wed Dec 08, 2004 7:07 pm


Return to User Discussion

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest