Created
June 30, 2018 07:02
-
-
Save jaassoon/649a7df3619aeb8ac5d0c363c68dc63a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# buildcv2.sh | |
#!/bin/bash | |
yum -y install gcc gcc-c++ freetype-devel glib2-devel cairo-devel libtool | |
basePath=/mnt/Data/jason | |
python36Path=/mnt/Data/jason/env36 | |
#install colm | |
cd {basePath}/jp-ocr/3rdparty/{colm} | |
./autogen.sh | |
./configure | |
rm CMakeCache.txt | |
cmake -DCMAKE_INSTALL_PREFIX=/usr/local | |
make | |
make install | |
#install ragel | |
cd {basePath}/jp-ocr/3rdparty/{ragel} | |
./autogen.sh | |
./configure | |
make | |
make install | |
make clean | |
#install harfbuzz | |
cd {basePath}/jp-ocr/3rdparty/{harfbuzz} | |
./autogen.sh | |
./configure | |
rm -rf CMakeCache.txt CMakeFiles | |
mkdir build; cd build; cmake .. | |
make | |
make install | |
make clean | |
#install opencv include freetype | |
mkdir build | |
cd build | |
yum -y install harfbuzz-devel harfbuzz | |
rm -f CMakeCache.txt | |
basePath=/mnt/Data/jason | |
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/ \ | |
-DBUILD_opencv_python3=ON \ | |
-DBUILD_EXAMPLES=ON \ | |
-DOPENCV_EXTRA_MODULES_PATH=${basePath}/jp-ocr/3rdparty/opencv_contrib-3.4.1/modules | |
make -j5 | |
sudo make install | |
make clean | |
ln -s /lib64/python3.6/site-packages/cv2/cv2.cpython-36m-x86_64-linux-gnu.so \ | |
/mnt/Data/jason/env36/lib/python3.6/site-packages/ | |
find / -name "cv2.so" | |
#for mac | |
basePath=/Users/jason/Documents/github | |
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/ \ | |
-DOPENCV_EXTRA_MODULES_PATH=${basePath}/opencv_contrib/modules | |
### | |
-- Installing: /usr/local/lib/python2.7/site-packages/cv2.so | |
-- Set runtime path of "/usr/local/lib/python2.7/site-packages/cv2.so" to "/usr/local/lib64" | |
-- Installing: /usr/local/lib/python3.6/site-packages/cv2.cpython-36m-x86_64-linux-gnu.so | |
-- Set runtime path of "/usr/local/lib/python3.6/site-packages/cv2.cpython-36m-x86_64-linux-gnu.so" to "/usr/local/lib64" | |
###resoved by setting: ln -s /usr/bin/python3.6m /usr/bin/python3 | |
-- Python 3: | |
-- Interpreter: NO | |
-- Libraries: NO | |
-- numpy: NO (Python3 wrappers can not be generated) | |
-- packages path: - | |
-- | |
-- Python (for build): /usr/bin/python3.6m | |
#mac | |
-- Python 3: | |
-- Interpreter: /Library/Frameworks/Python.framework/Versions/3.5/bin/python3 (ver 3.5.2) | |
-- Libraries: /Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib (ver 3.5.2) | |
-- numpy: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include (ver 1.13.1) | |
-- packages path: lib/python3.5/site-packages | |
-- | |
-- Python (for build): /usr/bin/python2.7 | |
-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/
-DBUILD_opencv_python3=ON
-DBUILD_EXAMPLES=ON
-DOPENCV_EXTRA_MODULES_PATH=${basePath}/jp-ocr/3rdparty/opencv_contrib-3.4.3/modules
ln -s /usr/local/lib/python3.6/site-packages/cv2.cpython-36m-x86_64-linux-gnu.so
/mnt/Data/jason/env36/lib/python3.6/site-packages/