天天看點

環境安裝

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