无法在 Raspberry pi 4 上为 SAP 安装 Python 的 Pyrfc 库

问题描述 投票:0回答:1

想在 raspberry pi 4 上安装 pyrfc 但由于安装错误无法安装

我已经完成了pyrfc文档中提到的所有步骤 但是我无法在我的树莓派上安装它。 我正在使用 python 3.9.2

下面是我在运行 pip install pyrfc 后得到的错误日志。 请帮助

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyrfc
  Using cached pyrfc-2.7.1.tar.gz (262 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: setuptools in ./.local/lib/python3.9/site-packages (from pyrfc) (67.6.0)
Building wheels for collected packages: pyrfc
  Building wheel for pyrfc (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyrfc (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      750 Patch Level 11
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-39
      creating build/lib.linux-aarch64-cpython-39/pyrfc
      copying src/pyrfc/_exception.py -> build/lib.linux-aarch64-cpython-39/pyrfc
      copying src/pyrfc/__init__.py -> build/lib.linux-aarch64-cpython-39/pyrfc
      running build_ext
      building 'pyrfc.pyrfc' extension
      creating build/temp.linux-aarch64-cpython-39
      creating build/temp.linux-aarch64-cpython-39/src
      creating build/temp.linux-aarch64-cpython-39/src/pyrfc
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DNDEBUG -D_LARGEFILE_SOURCE -D_CONSOLE -D_FILE_OFFSET_BITS=64 -DSAPonUNIX -DSAPwithUNICODE -DSAPwithTHREADS -DSAPonLIN -I/usr/include/python3.9 -c src/pyrfc/_pyrfc.cpp -o build/temp.linux-aarch64-cpython-39/src/pyrfc/_pyrfc.o -Wall -O2 -fexceptions -funsigned-char -fno-strict-aliasing -Wall -Wno-uninitialized -Wno-deprecated-declarations -Wno-unused-function -Wcast-align -fPIC -pthread -minline-all-stringops -I/usr/local/sap/nwrfcsdk/include
      arm-linux-gnueabihf-gcc: error: unrecognized command-line option ‘-minline-all-stringops’
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyrfc
Failed to build pyrfc
ERROR: Could not build wheels for pyrfc, which is required to install pyproject.toml-based projects

python sap raspberry-pi4 pyrfc
1个回答
0
投票

这个错误信息

arm-linux-gnueabihf-gcc:错误:无法识别的命令行选项

-minline-all-stringops

arm-linux-gnueabihf-gcc 是 32 位

htis pyrfc setup.py

# https://launchpad.support.sap.com/#/notes/2573953
if sys.platform.startswith("linux"):
    os.system('strings $SAPNWRFC_HOME/lib/libsapnwrfc.so | grep "Patch Level"')
    LIBS = ["sapnwrfc", "sapucum"]
    MACROS = [
        ("NDEBUG", None),
        ("_LARGEFILE_SOURCE", None),
        ("_CONSOLE", None),
        ("_FILE_OFFSET_BITS", 64),
        ("SAPonUNIX", None),
        ("SAPwithUNICODE", None),
        ("SAPwithTHREADS", None),
        ("SAPonLIN", None),
    ]
    COMPILE_ARGS = [
        "-Wall",
        "-O2",
        "-fexceptions",
        "-funsigned-char",
        "-fno-strict-aliasing",
        "-Wall",
        "-Wno-uninitialized",
        "-Wno-deprecated-declarations",
        "-Wno-unused-function",
        "-Wcast-align",
        "-fPIC",
        "-pthread",
        "-minline-all-stringops",
        "-I{}/include".format(SAPNWRFC_HOME),
    ]
    LINK_ARGS = ["-L{}/lib".format(SAPNWRFC_HOME)]

所以你可能需要

aarch64-linux-gnu-gcc

© www.soinside.com 2019 - 2024. All rights reserved.