Skip to content

Instantly share code, notes, and snippets.

@sknjpn
Created December 25, 2019 02:43
Show Gist options
  • Save sknjpn/1ce20b7db1b2c8c35680bcba1138e4fc to your computer and use it in GitHub Desktop.
Save sknjpn/1ce20b7db1b2c8c35680bcba1138e4fc to your computer and use it in GitHub Desktop.
# update
sudo apt update
sudo apt upgrade -y
# install packages
sudo apt install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev unzip libgl-dev libturbojpeg-dev libgl-dev libglu-dev libopenal-dev libogg-dev libvorbis-dev
# download
cd ~
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-9.2.0/gcc-9.2.0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz
wget https://www.angelcode.com/angelscript/sdk/files/angelscript_2.33.0.zip
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
git clone https://github.com/Siv3D/OpenSiv3D.git
# unzip
tar xf gcc-9.2.0.tar.gz
tar -zxvf boost_1_70_0.tar.gz
unzip angelscript_2.33.0.zip
# checkout
cd opencv_contrib
git checkout -b 4.0.1 refs/tags/4.0.1
cd ../opencv
git checkout -b 4.0.1 refs/tags/4.0.1
# install gcc 9.2
# url = https://solarianprogrammer.com/2016/10/07/building-gcc-ubuntu-linux/
cd ~/gcc-9.2.0
./contrib/download_prerequisites
mkdir build
cd build
./../configure --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-9.2 --enable-checking=release --enable-languages=c,c++ --disable-bootstrap --disable-multilib --program-suffix=-9.2
make -j6
sudo make install-strip
# set env value
cd ~
echo 'export PATH=/usr/local/gcc-9.2/bin:$PATH' >> .bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/gcc-9.2/lib64:$LD_LIBRARY_PATH' >> .bashrc
echo 'export CXX=g++-9.2' >> .bashrc
echo 'export CC=gcc-9.2' >> .bashrc
source ~/.bashrc
# install opencv 4.0.1
# url = http://beetreehitsuji.hatenablog.com/entry/2019/02/14/154829
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D OPENCV_GENERATE_PKGCONFIG=ON ..
make -j6
sudo make install
# install boost 1_70_0
cd ~/boost_1_70_0
./bootstrap.sh
sudo ./b2 install -j4
# install angelscript 2.33.0
cd ~/sdk/angelscript/project/gnuc
make -j4
sudo apt install
# build OpenSiv3D
cd ~
mkdir OpenSiv3D/Linux/build
mkdir OpenSiv3D/Linux/App/build
cd OpenSiv3D/Linux/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j6
@sknjpn
Copy link
Author

sknjpn commented Jun 15, 2020

sudo apt install libopengl-dev libglew-dev libudev-dev libgif-dev libwebp-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment