docker pull nvidia/cuda:10.2-cudnn7-devel-centos7
docker run -it --name felaim_sever_centos7 nvidia/cuda:10.2-cudnn7-devel-centos7 /bin/bash
yum update
yum upgrade
yum -y install wget
最好是用5.4.0版本的,4.8.5对有些软件安装会有问题例如OpenCV4.2的GPU版本
gcc --version
yum install bzip2
cd /usr/local/src
wget https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2
tar -jxvf gcc-5.4.0.tar.bz2
cd gcc-5.4.0
./contrib/download_prerequisites
mkdir gcc-build-5.4.0
cd gcc-build-5.4.0
/usr/local/src/gcc-5.4.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
出现问题,没有安装make
make -j4 //开四个线程进行编译
bash: make: command not found
解决方法
yum -y install gcc automake autoconf libtool make
安装
make install
更新软链接
cd /usr/bin/
mv gcc gcc_back
mv g++ g++_back
ln -s /usr/local/bin/gcc gcc
ln -s /usr/local/bin/g++ g++
docker commit -a "runoob.com" -m "my apache" a404c6c174a2 mymysql:v1
OPTIONS说明:
-a :提交的镜像作者;
-c :使用Dockerfile指令来创建镜像;
-m :提交时的说明文字;
-p :在commit时,将容器暂停。
重新定义tag的名字
#docker tag 镜像id 要推入仓库的用户名/要推入的仓库名:新定义的tag
docker tag e12a9ec48ab7 felaim/felaim_sever:myproject
#docker push 要推入仓库的用户名/要推入的仓库名:镜像标签
docker push felaim/felaim_sever:myproject
wget ftp.gnu.org/gnu/gdb/gdb-7.8.tar.gz
tar -xzvf gdb-7.8.tar.gz
cd gdb-7.8
./configure
make
出现错误
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/usr/local/src/gdb-7.8'
make: *** [all] Error 2
yum -y install ncurses-devel
重新configu后,make,make install
For example, if you simply want to build and install CMake from source,
you can build directly in the source tree::
$ ./bootstrap && make && sudo make install
报错
gmake: `cmake' is up to date.
/usr/local/src/cmake-3.15.7/Bootstrap.cmk/cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/src/cmake-3.15.7/Bootstrap.cmk/cmake)
/usr/local/src/cmake-3.15.7/Bootstrap.cmk/cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/local/src/cmake-3.15.7/Bootstrap.cmk/cmake)
解决方法
cp /usr/local/lib64/libstdc++.so.6.0.21 /usr/lib64/
cd /usr/lib64/
rm -f libstdc++.so.6
ln -s libstdc++.so.6.0.21 libstdc++.so.6
问题解决后运行gmake
gmake
make install
cmake -version
bash: locate: command not found
yum install mlocate
出现问题
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
updatedb
安装tf1.14对应的protobuf需要3.7.1版本的,所以先提前安装好,这样OpenCV链接之间链接3.7.1版本的即可
下载对应版本的protobuf(git clone怎么选择tag和version)
使用–branch指定分支,也得多试几次,开手机热点比较快
git clone --branch v3.7.1 https://github.com/protocolbuffers/protobuf.git
cd protobuf
//配置脚本
./autogen.sh
//编译与安装
./configure
make
make check
sudo make install
sudo ldconfig # refresh shared library cache.
protoc --version
出现warning(暂未解决)
=== configuring in third_party/googletest (/home/software/protobuf/third_party/googletest)
configure: WARNING: no configuration information is in third_party/googletest
下载对应安装包
mkdir build
cd build
cmake ..
make install
yum install unzip
./bazel-0.24.1-installer-linux-x86_64.sh --user
export PATH="$PATH:$HOME/bin"
下载对应版本, TensorRT-6.0.1.8.CentOS-7.6.x86_64-gnu.cuda-10.2.cudnn7.6.tar.gz
tar -zxvf TensorRT-6.0.1.8.CentOS-7.6.x86_64-gnu.cuda-10.2.cudnn7.6.tar.gz
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
./configure中path的设置
/usr/local/cuda,/usr/local/cuda/bin,/usr/local/cuda/lib64,/usr/local/cuda/include,/home/software/TensorRT-6.0.1.8,/usr/lib/x86_64-linux-gnu,/usr/include,/usr/lib64
patch command is not found, please install it and referenced by '//third_party/eigen3:eigen3'
yum -y install patch
ERROR: /root/.cache/bazel/_bazel_root/79617ab99e45fd3cf89b3b67f497350d/external/nccl_archive/BUILD.bazel:67:1: fatbinary external/nccl_archive/device_dlink_hdrs.fatbin failed (Exit 1)
fatbinary fatal : Unknown option '-bin2c-path'
Target //tensorflow:libtensorflow_cc.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
安装OpenCV4.2版本,安装对应依赖项
sudo yum -y install epel-release
sudo yum -y install qt5-qtbase-devel gtk2-devel libpng-devel jasper-devel openexr-devel libwebp-devel libjpeg-turbo-devel freeglut-devel mesa-libGL mesa-libGL-devel libtiff-devel libdc1394-devel tbb-devel eigen3-devel boost boost-thread boost-devel libv4l-devel gstreamer-plugins-base-devel
mkdir /home/software/
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cp -r ./opencv_contrib ./opencv/
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_CUDA=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" -D WITH_CUBLAS=1 -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/ ..
gcc, g++升级: