安裝nasm:(gcc 4.8.5)
axel
tar -zxvf nasm-2.15.02
cd nasm-2.15.02
./configure
make
sudo make install
安裝h264:(gcc 4.8.5)
git clone
cd openh264
git checkout -b v2.1.1
make arch=x86_64
sudo make install
安裝x264: (gcc 4.8.5)
git clone
cd x264
./configure --enable-shared --enable-static --disable-asm
make
sudo
make
install
cd ffmpeg-4.3
vi fftools/makefile
# 修改 $$(objs-$(1)): cflags += -fpic $(cflags-$(1))
用(gcc 4.8.5)編譯:
./configure --enable-shared --enable-pic --enable-libopenh264 --enable-encoder=libopenh264 --enable-decoder=libopenh264 --enable-gpl --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264
make
sudo
make
install
export pkg_config_path=/usr/local/lib/pkgconfig;/usr/local/lib64/pkgconfig;
$pkg_config_path
或者:vi /etc/ld.so.conf.d/local.conf
# 加入:/usr/local/lib
用gcc 4.8.5編譯:
cd opencv-4.3.0
vi cmakelists.txt
修改:
# add by sam
add_compile_options(-fpic -wl,-bsymbolic)
# or
set(cmake_c_flags "$ -fpic -wl,-bsymbolic")
set(cmake_cxx_flags "$ -fpic -wl,-bsymbolic")
mkdir build
cd build
cmake -d with_cuda=off \
-d cmake_build_type=release \
-d opencv_generate_pkgconfig=on \
-d cmake_install_prefix=/usr/local \
-d with_ipp=off \
-d with_ffmpeg=on \
-d opencv_extra_modules_path=
../../opencv_contrib-4.3.0/modules \
-d build_tests=off \
-d build_perf_tests=off \
-d install_python_examples=off \
-d install_c_examples=off \
-d build_examples=off \
-s .. \
-b ./
make -j4
sudo
make
install
export ld_library_path=
$ld_library_path:/usr/local/lib:/usr/local/lib64
安裝node-gyp:
su root
npminstall -g node-gyp
切換gcc到v7版本,gcc4會有編譯錯誤:
sudo yum groupinstall 'development tools'
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
修改package.json:
"opencv4nodejs"
:
npm
install opencv-build
安裝opencv4nodejs
npm
install opencv4nodejs
這個安裝方式會更新opencv4nodejs,可以編譯出opencv4nodejs.node,算是成功了。
實際上,最後仍然有個error,可以如下處理:
vi node_modules/opencv4nodejs/binding.gyp
找到cflags,修改為:
"cflags" : [
"-std=c++11","-wno-misleading-indentation"
],
用npm install opencv4nodejs方式會覆蓋修改,採用以下無更新安裝方式:
cd node_modules/opencv4nodejs/
# env
export opencv4nodejs_disable_autobuild=1
export opencv_include_dir=/usr/local/include/opencv4
export opencv_lib_dir=/usr/local/lib64
# node-gyp configure
# node install/install.js
在CentOS 7上編譯Qtum
在centos上編譯qtum是一件非常麻煩的事情,因為centos提供的boost庫過於老舊。而我們需要自己去手動編譯boost庫。新增epel release倉庫,然後安裝一些編譯工具 sudo yum install epel release gcc c git我們需要至少1.58.0版本的bo...
PHP在CentOS7上的編譯安裝
first,wget the source code to local directory you can access the php official site.然後使用 wget 之後即可顯示出響應的php對應版本資料夾 首先,配置好yum源 包含epel 後執行以下命令 yum y grou...
在CentOS7上安裝RabbitMQ
首先需要安裝erlang,參考 安裝過程中會有提示,一路輸入 y 即可。完成後安裝rabbitmq yum install rabbitmq server 3.6.6 1.el7.noarch.rpm完成後啟動服務 service rabbitmq server start可以檢視服務狀態 這裡可以...