Ubuntu 20.04开发环境记录

-------------git command for submodule------------
git submodule update --init
git clone *** --recurse-submoduls
--------------------------------------------------

Base Environment

sudo snap install cmake --classic

sudo apt-get install git gitg meld vim tree openssl gperf bison flex libssl-dev openjdk-8-jdk openssh-server python3-dev python3-numpy python3-pip libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libatlas-base-dev libboost-all-dev libhdf5-dev libgoogle-glog-dev tesseract-ocr libtesseract-dev libleptonica-dev protobuf-compiler libavresample-dev libeigen3-dev ccache

Java 
sudo apt-get install openjdk-8-jdk
choose java : 
    sudo update-alternatives --config java
    
QV2ray

vmess://ewogICJ2IjogIjIiLAogICJwcyI6ICJ3dWxhYmluZ19saWdodHByb3h5LnRlcm1pbnVzLnBsdXMiLAogICJhZGQiOiAibGlnaHRwcm94eS50ZXJtaW51cy5wbHVzIiwKICAicG9ydCI6ICI0NDMiLAogICJpZCI6ICI5YTZjZjdlYi0yOGM4LTQzYTItYThkNy0xYTIxNGI1MTRmZWMiLAogICJhaWQiOiAiMiIsCiAgIm5ldCI6ICJ3cyIsCiAgInR5cGUiOiAibm9uZSIsCiAgImhvc3QiOiAibGlnaHRwcm94eS50ZXJtaW51cy5wbHVzIiwKICAicGF0aCI6ICIvOTA0ZDM3OTBmNy8iLAogICJ0bHMiOiAidGxzIgp9Cg==


-------------------OpenSceneGraph build env--------------
sudo apt-get install libcurl4-openssl-dev libxml2-dev libfreetype6-dev libvncserver-dev libgstreamer1.0-dev libsdl2-dev libgtkgl2.0-dev libgtkglextmm-x11-1.2-dev libpng-dev libjpeg-dev libtiff-dev libgif-dev libpoppler-dev librsvg2-dev libilmbase-dev libopenexr-dev libdcmtk-dev libnvtt-dev libasio-dev libgdal-dev libflann-dev
--------------------------------------------------------

-------------------OpenVINO env--------------------------
sudo apt-get install intel-opencl-icd

install path:/opt/intel/openvino_2021
env setup script, add the following code to ~/.bashrc
source /opt/intel/openvino_2021/bin/setupvars.sh

add the following dir to /etc/ld.so.conf
/opt/intel/openvino_2021/inference_engine/lib/intel64
--------------------------------------------------------

---------------tesseract ocr engine---------------------------------------

sudo apt-get install tesseract-ocr libtesseract-dev libleptonica-dev

ocr chinese traineddata 
wget https://github.com/tesseract-ocr/tessdata/raw/4.00/chi_sim.traineddata

save to location:
/usr/share/tesseract-ocr/4.00/tessdata
---------------------------------------------------------------------------

OpenGL support
sudo apt-get install build-essential libgl1-mesa-dev freeglut3-dev libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev

OpenCV depend library
sudo apt-get install libavresample-dev libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

cmake -DOPENCV_GENERATE_PKGCONFIG=1 -DWITH_CUDA=1 -DOPENCV_DNN_CUDA=1 -DCUDA_ARCH_BIN="5.2;6.0;6.1;7.0;7.5" -DWITH_INF_ENGINE=1 -DWITH_NGRAPH=1 -DOPENCV_EXTRA_MODULES_PATH="../../opencv_contrib/modules" ..

FFMpeg depend library

sudo apt-get install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  pkg-config \
  texinfo \
  wget \
  zlib1g-dev

sudo apt-get install nasm yasm \
 libx264-dev \
 libx265-dev libnuma-dev \
 libvpx-dev \
 libfdk-aac-dev \
 libmp3lame-dev \
 libopus-dev

Curl support 
sudo apt-get install libcurl4-openssl-dev curl

build for ffmpeg

git clone ssh://10.0.1.100:/core/git/ffmpeg.git -b release/4.1

./configure \
  --enable-shared \
  --enable-gpl \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree

make
sudo make install

sudo ldconfig

MySQL Client
sudo apt-get install libmysqlclient20 libmysqlclient-dev

Boost support

wget http://10.0.1.100:/core/data/env/boost/boost_1_68_0.tar.gz
./bootstrap.shudo upd
./b2 -j12
sudo ./b2 install

Build for OpenCV

git clone ssh://10.0.1.100:/core/git/opencv.git -b 3.4.5

mkdir build; cd build 

Ubuntu 16.04
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -DWITH_FFMPEG=1 ..

Ubuntu 18.04
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -DWITH_FFMPEG=1 -DENABLE_PRECOMPILED_HEADERS=OFF ..

make
sudo make install

Mongodb Support on Ubuntu 18.04

sudo apt-get install mongodb

Mongodb C driver
sudo apt-get install cmake libssl-dev libsasl2-dev libbson-dev

wget http://10.0.1.100/core/data/mongo-c-driver-1.14.0.tar.gz
tar -xvf mongo-c-driver-1.14.0.tar.gz
cd mongo-c-driver-1.14.0/
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
cmake --build . --parallel
sudo cmake --install .

Mongodb CXX driver
git clone https://github.com/mongodb/mongo-cxx-driver.git
cd mongo-cxx-driver/build
cmake -DBSONCXX_POLY_USE_BOOST=1  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
sudo cmake --install .

MySql Support on Ubuntu 16.04 

reference: https://www.cnblogs.com/Siegel/p/6964956.html

sudo apt-get install mysql-server 
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient20 libmysqlclient-dev


MySQL Support on Ubuntu 18.04

sudo apt-get install mysql-server 
sudo apt-get install mysql-client mysql-workbench
sudo apt-get install libmysqlclient21 libmysqlclient-dev

Set mysql root password
https://www.cnblogs.com/hxl77/p/8556178.html

update user set authentication_string=PASSWORD(123456) where User='root';
update user set plugin="mysql_native_password";
flush privileges;

phpmyadmin support

sudo apt-get install apache2
sudo apt-get install phpmyadmin

Update phpmyadmin
wget http://10.0.1.100/core/data/env/mysql/phpMyAdmin-4.8.4-all-languages.zip

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

problem solve:
http://www.cnblogs.com/sunshine-H/p/9592668.html

sudo vim /etc/php/7.0/apache2/php.ini
change:-lcurl
;extension=php_mbstring.dll 
To:
extension=php_mbstring.so

sudo service apache2 restart

Access: http://localhost/phpmyadmin/


build for QT 6

sudo apt install bison build-essential clang flex gperf libatspi2.0-dev libbluetooth-dev libclang-dev libcups2-dev libdrm-dev libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev libgstreamer1.0-dev libhunspell-dev libnss3-dev libpulse-dev libssl-dev libts-dev libx11-dev libx11-xcb-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libxkbfile-dev libxrandr-dev libxrender-dev libxshmfence-dev libxshmfence1 llvm ninja-build nodejs

Ubuntu 18.04.1 arm build Qt 5.14.0

问题1、在Ubuntu 18.04.1 arm系统编译Qt 5.13.0执行make install报“linuxdmabufclientbufferintegration.h:92:5: error: ‘PFNEGLBINDWAYLANDDISPLAYWL’ does not name a type”错,详细报错如下:

【解决方法】

修改qtwayland/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h文件,在56行增加“#include

然后再次执行make install编译安装;

问题2:在Ubuntu 18.04.1 arm系统编译Qt 5.13.0执行make install报“/usr/bin/ld: cannot find -lclip2tri”、“/usr/bin/ld: cannot find -lpoly2tri”、“/usr/bin/ld: cannot find -lclipper”等错误,详细报错如下:

【解决方法】

执行apt-get -y install perl*安装perl,然后执行“make clean”,接着执行“make && make install”重新编译并安装。

build QtCreator 5.0

cmake -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.14.0/lib/cmake ..

install QtCreator from binary file

wget http://10.0.1.100:/core/data/env/qt/qt-creator-opensource-linux-x86_64-4.8.0.run

chmod +x qt-creator-opensource-linux-x86_64-4.8.0.run

wget http://10.0.1.100:/core/data/env/qt/QtDoc5.12.0.tar.gz

vi .profile
PATH=/usr/local/Qt-5.12.0/bin:$PATH
export PATH

Ubuntu 18.04 
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'


CUDA support

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

CUDA support

ubuntu-drivers devices

ubuntu-drivers autoinstall 

chmod +x cuda_8.0.61_375.26_linux.run

sudo ./cuda_8.0.61_375.26_linux.run

sudo gedit ~/.bashrc

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

source ~/.bashrc

cuDNN support

tar -vxf cudnn-8.0-linux-x64-v7.1.tgz cuda/

sudo cp cuda/include/cudnn.h /usr/local/cuda/include/

sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/


sudo vim /etc/ld.so.conf.d/cuda.conf 

/usr/local/cuda/lib64

sudo ldconfig

./opencv/samples/dnn/example_dnn_object_detection --config=./darknet/cfg/yolov3.cfg --model=./darknet/yolov3.weights --classes=./opencv/samples/data/dnn/object_detection_classes_yolov3.txt --width=416 --height=416 --scale=0.00392 --rgb

Openpose support 

Caffe support 

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler

sudo apt-get install --no-install-recommends libboost-all-dev

sudo apt-get install libgflags-dev

sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler

sudo apt-get install libblas-dev

sudo apt-get install libatlas-base-dev

wget http://10.0.1.100:/core/data/env/openpose/openpose.tar.xz

tar xvf openpose.tar.xz

cd openpose
cd build 
cmake ..
make -j8
sudo make install 

cd build 


install MarkUp Tool

git clone https://github.com/tzutalin/labelImg.git

Python 3 + Qt5 (Recommended)

sudo apt-get install pyqt5-dev-tools
sudo pip3 install -r requirements/requirements-linux-python3.txt
make qt5py3
python3 labelImg.py
python3 labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

support opencv_contrib

git clone https://github.com/opencv/opencv_contrib.git
cd  opencv_contrib
mkdir build
cd build  
cmake -DOPENCV_EXTRA_MODULES_PATH=/modules -DBUILD_EXAMPLES=ON
make 
sudo make install

--------------------gexf support-------------------------
https://gephi.org/gexf/format/

sudo apt-get install libxml2-dev
---------------------------------------------------------

--------------------restbed support----------------------
https://github.com/Corvusoft/restbed

sudo apt-get install librestbed-dev
---------------------------------------------------------


--------------------Unreal Engine 4----------------------
Clone EpicGames/UnrealEngine repository

git clone https://github.com/EpicGames/UnrealEngine -b release

cd UnrealEngine

./Setup.sh
./GenerateProjectFiles.sh

make CrashReportClient ShaderCompileWorker UnrealLightmass UnrealPak UE4Editor -j12

-----------------OpenSceneGraph support------------------
http://www.openscenegraph.org/index.php    `

git clone  https://github.com/openscenegraph/OpenSceneGraph.git
cd OpenSceneGraph
mkdir build 
cd build
cmake ..
make -j4
sudo make install
---------------------------------------------------------

---------------------GDAL support------------------------
https://gdal.org/

https://github.com/OSGeo/gdal/releases/tag/v3.2.1

wget https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz
tar -xvf gdal-3.2.1.tar.gz

./configure 

make -j4

sudo make install
---------------------------------------------------------

--------------------PROJ support-------------------------
git clone https://github.com/OSGeo/PROJ.git

git checkout 6.3.1 -b 6.3.1

sudo apt-get install sqlite3 libsqlite3-dev

mkdir build 

cd build 

cmake ..

make -j4

sudo make install 
---------------------------------------------------------

--------------------osgQt support------------------------
git clone https://github.com/openscenegraph/osgQt.git

mkdir build 
cd build 
cmake ..
make -j4
sudo make install 

---------------------------------------------------------

----------------mapbox-gl-native support-----------------

sudo apt-get install libglfw3-dev libuv0.10-dev

git clone [email protected]:opensource/mapbox-gl-native.git

git submodule update --init --recursive
cmake . -B build
cmake --build build -j4
MAPBOX_ACCESS_TOKEN=my_access_token_here ./build/platform/glfw/mbgl-glfw
sudo cp libqmapboxgl.so /usr/local/lib/

---------------------------------------------------------

-------------------openvdb support-----------------------

apt-get install -y libboost-iostreams-dev
apt-get install -y libboost-system-dev
apt-get install -y libtbb-dev

git clone [email protected]:Blosc/c-blosc.git
cd c-blosc
git checkout tags/v1.5.0 -b v1.5.0
mkdir build
cd build
cmake ..
make -j4
make install
cd ../..

Building OpenVDB
sudo apt-get install libjemalloc-dev
sudo apt-get install libilmbase-dev

wget https://github.com/intel/tbb/releases/download/2019_U6/tbb2019_20190410oss_lin.tgz
tar -zxvf tbb2019_20190410oss_lin.tgz
cd tbb2019_20190410oss/bin
source tbbvars.sh intel64 linux auto_tbbroot
cd ../examples/task/tree_sum
make
./tree_sum

git clone [email protected]:AcademySoftwareFoundation/openvdb.git
cd openvdb
mkdir build
cd build
cmake ..
make -j4
make install
---------------------------------------------------------

---------------------pcl support-------------------------

sudo apt-get install libeigen3-dev
sudo apt-get install libflann1.9
sudo apt-get install libflann-dev
sudo apt-get install liblas-dev 
sudo apt-get install liblas-c-dev 
git clone https://github.com/PointCloudLibrary/pcl.git
git checkout pcl-1.11.1 -b pcl-1.11.1

mkdir build
cd build 
cmake-gui ..
make -j4
sudo make install 
---------------------------------------------------------

---------------------VTK support-------------------------

git clone https://github.com/Kitware/VTK.git
git checkout v8.2.0 -b v8.2.0

mkdir build
cd build 
cmake-gui ..
make -j4
sudo make install 
---------------------------------------------------------

---------------------qthttpserver---------------------

export CMAKE_MODULE_PATH=/usr/local/Qt6/lib/cmake/:$CMAKE_MODULE_PATH

----------------------------------------------------------

你可能感兴趣的:(ubuntu,qt,opencv,ffmpeg)