我正在尝试 FLENS-LAPACK 的教程 ( http://apfel.mathematik.uni-ulm.de/~lehn/FLENS/flens/examples/lapack-geqp3.html )。 我已经从网站 ( https://github.com/michael-lehn/FLENS ) 下载了 src 代码。
当我尝试教程中的指令时
g++ -std=c++11 -Wall -I../.. -o lapack-geqp3 lapack-geqp3.cc
控制台出现错误:
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,
我查看了我mac的gcc版本
$ 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)
显示我的mac有gcc 5.0.0。 谁能告诉我我的 mac 上的 gcc 有什么问题? 非常感谢!!
最佳答案
注意你的 GCC 有问题,static_assert
是错误的。
static_assert(__GNUG__>=4 && __GNUC_MINOR__>=7, ...)
这会检查 GCC 是否为 4.x 或更新版本,也是次要版本 7 或更新版本。此断言只会在 4.7、4.8、4.9、5.7、5.8 等上通过。
如果断言像这样改变:
static_assert(__GNUG__==4 && __GNUC_MINOR__>=7 || __GNUG__>4, ...)
然后它应该通过 GCC 5(假设它将 __GNUG__
定义为 5;我目前无法检查。)
编辑:我已经 submitted a patch解决这个问题,它已经被接受和合并。如果您提取最新的 HEAD,您的问题应该得到解决。
关于c++ - flens lapack : GNU GCC Version 4. 7 或更高要求!我的 mac 有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29529557/