flens lapack:需要GNU GCC 4.7版或更高版本!我的mac有

flens lapack: GNU GCC Version 4.7 or higher required! my mac has

本文关键字:版本 mac 我的 高版本 需要 lapack GNU GCC 7版 flens      更新时间:2023-10-16

我正在尝试一个教程(http://apfel.mathematik.uni-ulm.de/~lehn/FENS/FLENS/examples/lapack-geqp3.html)。我已经从网站上下载了src代码(https://github.com/michael-lehn/FLENS)。

当我尝试教程中的说明时

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;我现在没有办法检查。)

编辑:我已经提交了一个修复此问题的补丁,该补丁已经被接受并合并。如果你拉了最新的头,你的问题应该得到解决。