【问题标题】:flens lapack: GNU GCC Version 4.7 or higher required! my mac hasflens lapack:需要 GNU GCC 4.7 或更高版本!我的mac有
【发布时间】:2015-04-09 04:06:18
【问题描述】:

我正在尝试来自 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有什么问题? 非常感谢!!

【问题讨论】:

    标签: c++ macos gcc installation gnu


    【解决方案1】:

    注意你的 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,您的问题应该会得到解决。

    【讨论】:

    • 非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2013-10-08
    • 2013-11-19
    • 2013-01-10
    • 1970-01-01
    • 1970-01-01
    • 2020-12-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多