VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 3
声望: 1

今天在服务器 ubuntu18.04 上安装最新2.1.5版本的vnpy,遇到报错,结尾如下:

    gcc -pthread -shared -B /home/asuka/anaconda3/compiler_compat -L/home/asuka/anaconda3/lib -Wl,-rpath=/home/asuka/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd/vnctptd.o -Lvnpy/api/ctp/libs -Lvnpy/api/ctp -R$ORIGIN -lthostmduserapi_se -lthosttraderapi_se -o build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctptd.cpython-37m-x86_64-linux-gnu.so -lstdc++
    gcc: error: unrecognized command line option ‘-R’
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/asuka/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-4dmzbv71/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-4dmzbv71/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pk0m1mxd/install-record.txt --single-version-externally-managed --compile --install-headers /home/asuka/anaconda3/include/python3.7m/vnpy Check the logs for full command output.

搜了一圈,似乎是把上面代码中的 ‘-R$ORIGIN’ 改一下变为 ‘-Wl,-rpath=$ORIGIN’,就能安装下去了。

但自己不会弄,现放上论坛来求助~~


安装过程的一个小截图如下:
description

这一段的报错代码:

  running build_ext
  building 'vnpy.api.ctp.vnctptd' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/vnpy
  creating build/temp.linux-x86_64-3.7/vnpy/api
  creating build/temp.linux-x86_64-3.7/vnpy/api/ctp
  creating build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp
  creating build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
  gcc -pthread -B /home/asuka/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ivnpy/api/ctp/include -Ivnpy/api/ctp/vnctp -I/home/asuka/anaconda3/include/python3.7m -c vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp -o build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd/vnctptd.o -std=c++17 -O3 -Wno-delete-incomplete -Wno-sign-compare
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  gcc -pthread -shared -B /home/asuka/anaconda3/compiler_compat -L/home/asuka/anaconda3/lib -Wl,-rpath=/home/asuka/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd/vnctptd.o -Lvnpy/api/ctp/libs -Lvnpy/api/ctp -R$ORIGIN -lthostmduserapi_se -lthosttraderapi_se -o build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctptd.cpython-37m-x86_64-linux-gnu.so -lstdc++
  gcc: error: unrecognized command line option ‘-R’
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for vnpy
  Running setup.py clean for vnpy
Failed to build vnpy
DEPRECATION: Could not build wheels for vnpy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Administrator
avatar
加入于:
帖子: 4502
声望: 322

你的GCC版本太低了,请升级到最新版本后再安装编译

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】