环境安装

2 篇文章 0 订阅
1 篇文章 0 订阅

docker

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
docker -v

gcc

下载 http://mirror.hust.edu.cn/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2
tar -xvf gcc-5.4.0.tar.gz
cd gcc-5.4.0
./contrib/download_prerequisites
mkdir build
cd build
…/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
make install
gcc -v
g++ -v
问题:如果显示版本没有更新,可能是因为安装到/usr/local/bin里面,而不是/usr/bin里面,
find / -name “libstdc++.so*” 如果看到新版g++安装到/usr/local/里面,可以配置PATH路径
vim ~/.bashrc
末尾添加
export PATH=/usr/local/bin:${PATH}
然后 source ~/.bashrc

cmake

wget https://cmake.org/files/v3.10/cmake-3.10.3.tar.gz
tar -zxvf cmake-3.10.3.tar.gz
cd cmake-3.10.3
./configure
make
make install

Git

yum remove git
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto perl-devel perl-CPAN autoconf*
wget https://github.com/git/git/archive/v2.2.1.tar.gz
tar zxvf v2.2.1.tar.gz
cd git-2.2.1
make configure
./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
make all doc
make install install-doc install-html
echo "export PATH=/usr/local/git/bin:$PATH" >> /etc/bashrc
source /etc/bashrc

python3

# 去官网下载源码 /https://www.python.org/downloads/source/
# 提前安装依赖
yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
yum -y install libffi libffi-devel
yum -y install ncurses ncurses-devel
#./configure --prefix=/usr/python --enable-shared CFLAGS=-fPIC
# 这里加上--enable-shared和-fPIC之后可以将python3的动态链接库编译出来,默认情况编译完lib下面只有python3.xm.a这样的文件,python本身可以正常使用,但是如果编译第三方库需要python接口的比如caffe等,则会报错;所以这里建议按照上面的方式配置,另外如果openssl不使用系统yum安装的,而是使用自己编译的比较新的版本可以使用--with-openssl=/usr/local/openssl这种方式指定,后面目录为openssl实际安装的目录,另外编译完还要将openssl的lib目录加入ld运行时目录中即可.
./configure --prefix=/usr/python 
make -j2
make install
ln -s /usr/python/bin/python3 /usr/bin/python3
ln -s /usr/python/bin/pip3 /usr/bin/pip3

pip

# 去官网找setuptools https://pypi.org/
# 安装pip需要setuptools
wget https://files.pythonhosted.org/packages/1d/64/a18a487b4391a05b9c7f938b94a16d80305bf0369c6b0b9509e86165e1d3/setuptools-41.0.1.zip
cd setuptools-41.0.1
python3 setup.py build
python3 setup.py install

问题:Compression requires the (missing) zlib module,用yum安装zlib
yum install zlib
yum install zlib-devel

bazel

下载安装文件 https://github.com/bazelbuild/bazel/releases/tag/0.24.1
在这里插入图片描述
sh bazel-0.24.1-installer-linux-x86_64.sh

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值