【问题标题】:Can't build Twisted==20.3.0 on Linux using gcc 4.8.5无法使用 gcc 4.8.5 在 Linux 上构建 Twisted==20.3.0
【发布时间】:2020-12-08 21:53:12
【问题描述】:

我试图在 Python 3.8 上安装 Twisted。我知道 Twisted 还不支持 Python 3.8,这就是 pip install 尝试从源代码构建它的原因。但是我的 Linux 机器上的 gcc 版本较低,我不想升级它。有没有办法告诉pip 使用gcc 4.8.5 来构建twisted?

这是我直接从pip install Twisted==20.3.0得到的错误

... ...
running build_ext
    building 'twisted.test.raiser' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    creating build/temp.linux-x86_64-3.8/src/twisted
    creating build/temp.linux-x86_64-3.8/src/twisted/test
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fPIC -I/path/to/venv38/include -I/path/to/python3.8 -c src/twisted/test/raiser.c -o build/temp.linux-x86_64-3.8/src/twisted/test/raiser.o
    gcc: error: unrecognized command line option ‘-fno-semantic-interposition’
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /path/to/venv38/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ovoof0ve/twisted/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ovoof0ve/twisted/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-3ftmx451/install-record.txt --single-version-externally-managed --compile --install-headers /path.to/venv38/include/site/python3.8/Twisted Check the logs for full command output.
$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)

【问题讨论】:

    标签: python linux gcc twisted


    【解决方案1】:

    GCC 5.3 添加了一个新选项:-fno-semantic-interposition

    【讨论】:

    • 我得到了那个部分。我的问题是我可以使用 GCC 4.8.5 构建 Twisted。我没有升级 GCC 的选项。
    猜你喜欢
    • 2018-05-30
    • 2022-08-14
    • 2022-06-28
    • 1970-01-01
    • 1970-01-01
    • 2012-08-24
    • 1970-01-01
    • 1970-01-01
    • 2015-01-16
    相关资源
    最近更新 更多