編譯安裝mysql(Ubuntu10 64位) http://www.cnblogs.com/2018/p/3482259.html 這個介紹了gcc形式編譯安裝mysql
那我們使用clang進行編譯一下看看具體的效果
編譯安裝
經試驗,主要解決如下的問題即可
v ABI_CHECK
n 這個問題表現是配置完成後,編譯時會出現
v Clang
n 或者在
export CXX=clang++
export CC=clang
最初我看了一下
clang vs calng++
http://stackoverflow.com/questions/14226840/c-11-threads-with-clang
如上處理就可以了編譯和安裝了,具體的腳本如下
if [ -d mysql-5.6.15 ]; then
echo "mysql
else
tar xzf mysql-5.6.15.tar.gz
fi
#cmake/abi_check.cmake ABI
# LINE30 SET(RUN_ABI_CHECK 0)
cp -f abi_check.cmake mysql-5.6.15/cmake/abi_check.cmake
mkdir -p build
pushd build
if [ -f CMakeCache.txt ]; then
make clean
rm -f CMakeCache.txt
fi
#
export CXX=clang++
export CC=clang
#
cmake ../mysql-5.6.15 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DCMAKE_BUILD_TYPE=Release \
-DSYSCONFDIR=/etc \
-DINSTALL_SBINDIR=/usr/local/mysql/bin \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_TCP_PORT=3306 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EMBEDDED_SERVER=0 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=0 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=0 \
-DWITH_MEMORY_STORAGE_ENGINE=0 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=0 \
-DWITH_EXTRA_CHARSETS=none \
-DWITH_DEBUG=0 \
-DWITH_ASAN=1 \
# -DENABLE_DOWNLOADS=0 \
#end of cmake
if [ $? -ne 0 ];
then
echo -e "\e[1;41m cmake's config error! \e[0m"
exit 1
fi
make
if [ $? -ne 0 ];
then
echo -e "\e[1;41m cmake done! \e[0m"
exit 1
fi
popd
echo "The package is in build directory!"
http://pan.baidu.com/s/1Cc7cr source/mysql5.6
mysql_clang.sh my.cnf abi_check.cmake