Reputation: 3
I was trying a tutorial (http://apfel.mathematik.uni-ulm.de/~lehn/FLENS/flens/examples/lapack-geqp3.html) from FLENS-LAPACK. I have download the src code from the website (https://github.com/michael-lehn/FLENS).
when I try the instruction from the tutorial
g++ -std=c++11 -Wall -I../.. -o lapack-geqp3 lapack-geqp3.cc
I had error from the console:
In file included from lapack-geqp3.cc:2:0: ../../flens/flens.cxx:45:6: error: static assertion failed: GNU GCC Version 4.7 or higher required! static_assert(__GNUG__>=4 && __GNUC_MINOR__>=7,
I checked the gcc version of my mac
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/5.0.0/lto-wrapper Target: x86_64-apple-darwin14.0.0
Configured with: ../gcc-5-20141005/configure --enable-languages=c++,fortran Thread model: posix
gcc version 5.0.0 20141005 (experimental) (GCC)
It shows that my mac has gcc 5.0.0. Can anyone tell me what's wrong with the gcc on my mac?? Thanks a lot!!
Upvotes: 0
Views: 90
Reputation: 25657
Noting is wrong with your GCC, the static_assert
is wrong.
static_assert(__GNUG__>=4 && __GNUC_MINOR__>=7, ...)
This checks that GCC is both version 4.x or newer, but also minor version 7 or newer. This assertion will only pass on 4.7, 4.8, 4.9, 5.7, 5.8, ... etc.
If the assertion is changed like so:
static_assert(__GNUG__==4 && __GNUC_MINOR__>=7 || __GNUG__>4, ...)
Then it should pass for GCC 5 (assuming it defines __GNUG__
as 5; I have no way of checking at the moment.)
Edit: I've submitted a patch to fix this issue, which has already been accepted and merged. If you pull the latest HEAD, your issue should be fixed.
Upvotes: 3