Ubuntu编译环境构建(ssh)

# Jason Gao 
# [email protected]
# Now in Xidian University

1 基础构建

sudo apt-get install subversion git-core git-svn

sudo apt-get install make gcc g++ libX11-dev libXt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev

sudo apt-get install cmake

2 cmake

(ln -s 最好手动,最后要确认一下,为了区分最好命名为cmake-ssl)

sudo apt-get install openssl libssl-dev

mkdir ~/Support && cd Support  

cmake_package="cmake-3.0.0"; wget http://www.cmake.org/files/v3.0/$cmake_package.tar.gz -v -O $cmake_package.tar.gz && tar -xzvf $cmake_package.tar.gz; cd $cmake_package && cmake -DCMAKE_USE_OPENSSL:BOOL=ON && make -j4

for tool in cmake ccmake ctest cpack; do sudo ln -s ~/Support/$cmake_package/bin/$tool /usr/local/bin/$tool; done

3 QT

(不用openssl可以省略中间步骤,configure时记得删除openssl参数)

cd ~/Support   

cwd=$(pwd)

rm -f get-and-build-openssl-for-slicer.sh
wget https://gist.githubusercontent.com/jcfr/9513568/raw/21f4e4cabca5ad03435ecc17ab546dab5e2c1a2f/get-and-build-openssl-for-slicer.sh
chmod u+x get-and-build-openssl-for-slicer.sh 
./get-and-build-openssl-for-slicer.sh 


wget http://packages.kitware.com/download/item/6175/qt-everywhere-opensource-src-4.8.6.tar.gz
md5=`md5sum ./qt-everywhere-opensource-src-4.8.6.tar.gz | awk ‘{ print $1 }‘` &&
[ $md5 == "2edbe4d6c2eff33ef91732602f3518eb" ] || echo "MD5 mismatch. Problem downloading Qt"

tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz
mv qt-everywhere-opensource-src-4.8.6 qt-everywhere-opensource-release-src-4.8.6
mkdir qt-everywhere-opensource-release-build-4.8.6
cd qt-everywhere-opensource-release-src-4.8.6
./configure -prefix $cwd/qt-everywhere-opensource-release-build-4.8.6/                       -release                    -opensource -confirm-license                    -no-qt3support                    -webkit                    -nomake examples -nomake demos                    -openssl -I $cwd/openssl-1.0.1e/include   -L $cwd/openssl-1.0.1e && make -j7 && make install

Tips for me

  • 用QTCREATOR时记得cmake别选错了,现在有两个版本的cmake,而且cmake-gui版本应该较低
  • QT库默认是找不到的,自行输入qmake的位置
  • QT install之前build文件夹中是没什么东西的T.T,不要再找了…
  • 带有Superbuild的工程,用qtcreator打开时不要打开CMakeLists.txt!

OK it’s done!

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。