赞
踩
因为工作需要,要在mips64龙芯cpu上安装 python3.7.4
主要参考了这篇文章 :银河麒麟安装Python3.7.4以及升级自带OpenSSL
但在实际操作中,在configure阶段,碰到了一个问题。现将该问题的解决过程及原因记录下来。
在configure报错:
- checking for g++... no
- configure:
-
- By default, distutils will build C++ extension modules with "g++".
- If this is not intended, then set CXX on the configure command line.
-
- checking for the platform triplet based on compiler characteristics... mips64el-linux-gnuabi64
- configure: error: internal configure error for the platform triplet, please file a bug report
一开始以为是g++的问题。因为错误中显示checking for g++ ... no。花了很长时间在这个方向上,没有结果。但我在arm麒麟V10上做同样的操作,也是显示checking for g++ ... no。看来是找错方向了。
我直接打开configure文件,直接搜索 internal configure error for the platform triplet, please file a bug report
在5348行,找到了相关代码。
从代码中,我们可以看到,这个问题是因为$PLATFORM_TRIPLET变量 与$MULTIARCH不一致导致的。通过echo,将这两个变量打印出来,他们分别是:
PLATFORM_TRIPLET:mips64el-linux-gnuabi64;
MULTIARCH:mips64el-linux-gnu
查找这两个变量,在5337找到了PLATFORM_TRIPLET的定义。从上下文中,可以看出,该值是由conftest.out输出的,其源码是 conftest.c。
conftest.c的源码就在configure里,从5192行开始,使用cat命令,写入到conftest.c文件中。
如果直接修改这一段源码,将5271行中的内容
从
改为
那这个configure错误就解决了。
在mips64类型的cpu编译python时,python是将其平台设置为mips64-linux-gnuabi64。
但银河麒麟提供的平台是mips64-linux-gnu。所以在configure检查时,就报了这个错。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。