从源构建SciPy时出现分段错误(核心转储)

p5fdfcr1  于 2022-11-10  发布在  其他
关注(0)|答案(1)|浏览(105)

我尝试按照本教程中提到的步骤在Linux机器上从源代码构建SciPy库。
在第13步中,当尝试使用python3 runtests.py -v测试构建时,会引发分段错误。
我使用的是名为scipydev的conda虚拟环境
以下是相关日志:

scipy/sparse/linalg/_isolve/tests/test_gcrotmk.py .......                                                                                                                                           [ 54%]
scipy/sparse/linalg/_isolve/tests/test_iterative.py ...........................xxxxX............................                                                                                    [ 55%]
scipy/sparse/linalg/_isolve/tests/test_lgmres.py ........                                                                                                                                           [ 55%]
scipy/sparse/linalg/_isolve/tests/test_lsmr.py ...............                                                                                                                                      [ 55%]
scipy/sparse/linalg/_isolve/tests/test_lsqr.py .....                                                                                                                                                [ 55%]
scipy/sparse/linalg/_isolve/tests/test_minres.py .......                                                                                                                                            [ 55%]
scipy/sparse/linalg/_isolve/tests/test_utils.py .                                                                                                                                                   [ 55%]
scipy/sparse/linalg/tests/test_expm_multiply.py .................                                                                                                                                   [ 55%]
scipy/sparse/linalg/tests/test_interface.py ..............                                                                                                                                          [ 55%]
scipy/sparse/linalg/tests/test_matfuncs.py ............................Fatal Python error: Segmentation fault

Current thread 0x00007f9bed60f740 (most recent call first):
  File "/home/bharath/scipy/scipy/build/testenv/lib/python3.8/site-packages/scipy/linalg/_basic.py", line 223 in solve
  File "/home/bharath/scipy/scipy/build/testenv/lib/python3.8/site-packages/scipy/sparse/linalg/_matfuncs.py", line 708 in _solve_P_Q
  File "/home/bharath/scipy/scipy/build/testenv/lib/python3.8/site-packages/scipy/sparse/linalg/_matfuncs.py", line 672 in _expm
  File "/home/bharath/scipy/scipy/build/testenv/lib/python3.8/site-packages/scipy/sparse/linalg/_matfuncs.py", line 590 in expm
  File "/home/bharath/scipy/scipy/build/testenv/lib/python3.8/site-packages/scipy/sparse/linalg/tests/test_matfuncs.py", line 516 in test_pascal
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/python.py", line 192 in pytest_pyfunc_call
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/python.py", line 1718 in runtest
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 168 in pytest_runtest_call
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 261 in <lambda>
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 340 in from_call
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 260 in call_runtest_hook
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 221 in call_and_report
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 132 in runtestprotocol
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/main.py", line 347 in pytest_runtestloop
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/main.py", line 322 in _main
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/main.py", line 268 in wrap_session
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/main.py", line 315 in pytest_cmdline_main
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/bharath/anaconda3/envs/scipydev/lib/python3.8/site-packages/_pytest/config/__init__.py", line 165 in main
  File "/home/bharath/scipy/scipy/build/testenv/lib/python3.8/site-packages/scipy/_lib/_testutils.py", line 69 in __call__
  File "runtests.py", line 334 in main
  File "runtests.py", line 612 in <module>
Segmentation fault (core dumped)

我怀疑可能是LAPACK或BLAS库导致的,但我不是很确定。任何帮助都将不胜感激。
操作系统:Ubuntu 20.04.3
Python皮:3.8
麻木:1.22.2
最新提交:公元前31年

zour9fqk

zour9fqk1#

不一定是答案,但可能是线索。
当从源代码构建python包时,一些代码需要C编译器,在安装之前检查您有什么和需要什么是很重要的,然后获得必要的编译器版本。
这是个罕见的病例,但还是值得一试。

相关问题