栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 软件开发 > 后端开发 > Python

记录ubuntu 14.04编译鸿蒙OS

Python 更新时间:发布时间: 百科书网 趣学号

源码下载 zh-cn/device-dev/get-code/sourcecode-acquire.md · OpenHarmony/docs - Gitee.com

配置git
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
下载repo和源码
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'

安装nodejs npm Ubuntu中安装最新 Node.js 和 npm - 黄树超 - 博客园

提示python版本过低,安装管理多个python版本

1.查看python有哪些版本使用命令

whereis python

如果安装Python3以上之后,使用pip命令出现了问题,提示说找不到ssl模块
首先安装openssl
sudo apt-get install openssl
sudo apt-get install libssl-dev

编译安装3.6.2
wget获取安装包:
wget http://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
解压安装包:
tar -xvzf Python-3.6.2.tgz
检查安装平台属性,系统是否有编译时所需要额库,以及库的版本是否满足编译需要,添加ssl支持
./configure --with-ssl
编译源码
make -j3

成功编译之后,安装
sudo make install


2.这么多版本如何切换呢

使用 sudo update-alternatives --install

link:指向/etc/alternatives/的符号引用

name:这个链接组的名称

path:这个命令对应的可执行文件的实际路径

priority:优先级,在auto模式下,数字较大的选项有较高的优先级

例如

sudo update-alternatives --install /usr/local/bin/python python /usr/local/bin/python3.6 2

添加完后

sudo update-alternatives --list python 查看结果

sudo update-alternatives --config python 来选择python版本

代码下载完成之后使用

./build/prebuilts_download.sh下载工具的链

如果此时编译会提示编译器版本低,14.04 自带的gcc-4.8版本较低需要升级

相关场景:在做某个操作时提示“/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found”
gcc官方下载网址: Index of /gnu/gcc  下载gcc源码包
安装过程:此过程比较长

tar -jxvf gcc-6.1.0.tar.bz2
cd gcc-6.1.0
./contrib/download_prerequisites
mkdir build
cd build
../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make -j3
sudo make install

升级完成后,系统还是使用旧版本的gcc,需要再进行以下操作:

否则编译./build.sh --product-name Hi3516DV300提示依赖GLIBCXX_3.4.21

centos 是如下操作

cp /usr/local/lib64/libstdc++.so.6.0.22 /lib64
cd /lib64
rm -rf libstdc++.so.6
ln -s libstdc++.so.6.0.22 libstdc++.so.6

此时执行如下命令就行可以看到GLIBCXX_3.4.22了:

strings /lib64/libstdc++.so.6 | grep GLIBC

ubuntu是如下操作

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC

重建软链接

sudo rm -r /usr/lib/x86_64-linux-gnu/libstdc++.so.6

sudo ln -s /usr/local/lib64/libstdc++.so.6.0.22 libstdc++.so.6

这步要sure 对,否则会找不到c++库影响系统

 

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/294544.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号