相關介紹資料如下:
Boost編譯
http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download 下載文件
http://www.boost.org/users/history/version_1_55_0.html 官方對於clang的說明情況
關於clang的驗證
Linux:
Clang: 3.3, 3.2, 3.1, 3.0
如上可見,這個官方已經驗證過
ICE編譯
http://www.zeroc.com/download/Ice/3.5/Ice-3.5.1.tar.gz
http://www.zeroc.com/download/Ice/3.5/ThirdParty-Sources-3.5.1.tar.gz
http://www.zeroc.com/download/Ice 這裡有所有的版本
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
這個官方已經聲明對於Linux下的clang不支持,不過很多人已經驗證過【在zeroc的論壇搜索clang可以看到】
首先在如下站點下載這些
http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.55.0%2F&ts=1387440583&use_mirror=jaist
http://www.zeroc.com/download/Ice/3.5/Ice-3.5.1.tar.gz
http://www.zeroc.com/download/Ice/3.5/ThirdParty-Sources-3.5.1.tar.gz
開工前首先需要把clang安裝好,具體參考 http://www.cnblogs.com/2018/p/3464638.html
如下是具體的配置步驟
boost boost_1_55_0.tar.gz
bootstrap.sh
16,17,18
LIBDIR=/root/work/clang+llvm-3.3-amd64-Ubuntu-10.04.4/lib/c++
INCLUDEDIR=/root/work/clang+llvm-3.3-amd64-Ubuntu-10.04.4/lib/c++/v1
LIBS="c++"
211
TOOLSET=clang
使用
ICE Ice-3.5.1.tar.gz ThirdParty-Sources-3.5.1.tar.gz
mcpp bzip
Ice-3.5.1/cpp/config/Make.rules
CC=clang
CXX=clang++
CPP=clang -E
Ice-3.5.1/cpp/config/Make.rules.Linux
模仿
bzlib.h
libbz2.a
make
如上即可使用
使用
#Ice
clang++ -c -I. -I/root/work/tmp/Ice-3.5.1/cpp/include Hello.cpp
clang++ -c -I. -I/root/work/tmp/Ice-3.5.1/cpp/include Client.cpp
clang -std=c++11 -stdlib=libc++ -I/root/work/clang+llvm-3.3-amd64-Ubuntu-10.04.4/lib/c++/v1 -c c11.cpp
clang++ -stdlib=libc++ -L/root/work/libs -o client Hello.o Client.o c11.o -lIce -lIceUtil -lc++
詳細的代碼和例子參考 http://pan.baidu.com/s/1nGab5
Clanghttp://pan.baidu.com/s/1nGab5 參考其他的
其中一個例子測試了的二進制性能還是比較高的。
#!/bin/bash
:<<EOF
#
#target=x86_64-linux-gnu
#Thread model: posix
#gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
###
EOF
pushd pkg
#2 boost
tar -xzvf boost_1_55_0.tar.gz -C .
cp -f pack/bootstrap.sh boost_1_55_0/.
#compile boost
pushd boost_1_55_0
./bootstrap.sh
./b2
#now boost_1_55_0/stage/lib
popd
#3 ICE
tar -xzvf Ice-3.5.1.tar.gz -C .
cp pack/Make.rules Ice-3.5.1/cpp/config/.
cp pack/Make.rules.Linux Ice-3.5.1/cpp/config/.
#dep mcpp
tar -xzvf ThirdParty-Sources-3.5.1.tar.gz -C .
pushd ThirdParty-Sources-3.5.1
tar -xzvf mcpp-2.7.2.tar.gz -C .
popd
pushd ThirdParty-Sources-3.5.1/mcpp-2.7.2
patch -p0 < ../mcpp/patch.mcpp.2.7.2
./configure CFLAGS=-fPIC --enable-mcpplib --disable-shared
cp -f ../../pack/mcpp_Makefile src/Makefile
pushd src
make
popd
popd
cp -f ThirdParty-Sources-3.5.1/mcpp-2.7.2/src/mcpp_out.h Ice-3.5.1/cpp/src/.
cp -f ThirdParty-Sources-3.5.1/mcpp-2.7.2/src/mcpp_lib.h Ice-3.5.1/cpp/src/.
cp -f ThirdParty-Sources-3.5.1/mcpp-2.7.2/src/.libs/libmcpp.a Ice-3.5.1/cpp/lib/.
#dep bz2
mkdir -p bzip2
tar -xzvf bzip2-1.0.6.tar.gz -C bzip2
pushd bzip2
cp -f ../pack/bzMakefile bzip2/Makefile
make
popd
cp -f bzip2/bzlib.h Ice-3.5.1/cpp/src/.
cp -f bzip2/libbz2.a Ice-3.5.1/cpp/lib/.
#compile ICE using clang
pushd Ice-3.5.1/cpp/src
make
popd
#libIce.so libIceUtil.so
#ICE sample
cp -f pack/config.* Ice-3.5.1/cpp/demo/Ice/hello/.
pushd Ice-3.5.1/cpp/demo/Ice/hello
make
popd
#deploy library
cp -f Ice-3.5.1/cpp/lib/libIce* /usr/lib/.
#copy ICE
mkdir -p ../test/ice
cp -f Ice-3.5.1/cpp/demo/Ice/hello/client ../test/ice/.
cp -f Ice-3.5.1/cpp/demo/Ice/hello/server ../test/ice/.
cp -f Ice-3.5.1/cpp/demo/Ice/hello/config.* ../test/ice/.
#cleanup
rm -r -f bzip2
rm -r -f ThirdParty-Sources-3.5.1
rm -r -f Ice-3.5.1
###
popd
詳細資料參考 http://pan.baidu.com/s/1nGab5