【问题标题】:Luarocks fails install asyncLuarocks 无法安装异步
【发布时间】:2018-08-03 01:43:26
【问题描述】:

各位程序员们好,

我开始学习lua了。从自述文件中,我必须安装 luarocks 的“显示”,而问题出现了。当我输入“luarocks install display”时,

    Installing https://raw.githubusercontent.com/torch/rocks/master/display-scm-0.rockspec...
    Using https://raw.githubusercontent.com/torch/rocks/master/display-scm-0.rockspec... switching to 'build' mode

    Missing dependencies for display:
    async >= 1.0
    luasocket >= 2.0

    Using https://raw.githubusercontent.com/torch/rocks/master/async-scm-1.rockspec... switching to 'build' mode
    Cloning into 'async'...
    remote: Counting objects: 210, done.
    remote: Compressing objects: 100% (184/184), done.
    remote: Total 210 (delta 19), reused 172 (delta 19), pack-reused 0
    Receiving objects: 100% (210/210), 403.80 KiB | 437.00 KiB/s, done.
    Resolving deltas: 100% (19/19), done.
    make LUA_BINDIR=/home/marvin/torch/install/bin  
    LUA_LIBDIR=/home/marvin/torch/install/lib  
    LUA_INCDIR=/home/marvin/torch/install/include 
    basename: missing operand
    Try 'basename --help' for more information.
    make -C lhttp_parser  LUA= 
    LUA_BINDIR=/home/marvin/torch/install/bin  
    LUA_LIBDIR=/home/marvin/torch/install/lib  
    LUA_INCDIR=/home/marvin/torch/install/include
    make[1]: Entering directory '/tmp/luarocks_async-scm-1-9028/async/lhttp_parser'
    cc -c lhttp_parser.c -o lhttp_parser.o -Ihttp-parser -I 
    /home/marvin/torch/install/include -D_LARGEFILE_SOURCE -
    D_FILE_OFFSET_BITS=64 -Wall -Werror -fPICCPPFLAGS=-fPIC make -C http-parser http_parser.o
    make[2]: Entering directory '/tmp/luarocks_async-scm-1-9028/async/lhttp_parser/http-parser'
    cc -fPIC -I. -DHTTP_PARSER_STRICT=0  -Wall -Wextra -Werror -O3  -c 
    http_parser.c
    http_parser.c: In function ‘http_parser_parse_url’:
    http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
     found_at = 1;
     ~~~~~~~~~^~~
   http_parser.c:2096:7: note: here
   case s_req_server:
   ^~~~
   cc1: all warnings being treated as errors
   Makefile:35: recipe for target 'http_parser.o' failed
   make[2]: *** [http_parser.o] Error 1
   make[2]: Leaving directory '/tmp/luarocks_async-scm-1-9028/async/lhttp_parser/http-parser'
   Makefile:17: recipe for target 'http-parser/http_parser.o' failed
   make[1]: *** [http-parser/http_parser.o] Error 2
   make[1]: Leaving directory '/tmp/luarocks_async-scm-1-9028/async/lhttp_parser'
   Makefile:6: recipe for target 'lhttp_parser/lhttp_parser.so' failed
   make: *** [lhttp_parser/lhttp_parser.so] Error 2

   Error: Failed installing dependency: 
   https://raw.githubusercontent.com/torch/rocks/master/async-scm-1.rockspec - Build error: Failed building.

到目前为止我已经搜索但没有找到相关的解决方案,我认为问题存在于“异步”的安装中,但我不知道如何解决它。 感谢您的帮助!

最好, 马文

【问题讨论】:

    标签: linux lua luarocks


    【解决方案1】:

    我通过使用以下命令降级我的 gcc 版本解决了这个问题

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get 更新
    sudo apt-get install gcc-5 g++-5

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

    希望这会有所帮助。

    【讨论】:

    • 有效,但是,这必须在 sudo apt-get upgrade 之后重复。
    【解决方案2】:

    将名为cc 的文件添加到PATH 中的某处,内容如下,并在其上运行chmod +x cc

    /usr/bin/"${0##*/}" "$@" -Wno-implicit-fallthrough
    

    【讨论】:

      猜你喜欢
      • 2016-11-04
      • 2015-08-20
      • 2017-05-10
      • 2021-08-11
      • 1970-01-01
      • 2021-08-14
      • 2016-03-22
      • 2021-02-09
      • 2015-10-18
      相关资源
      最近更新 更多