Hypetable源码编译和打包
来源:互联网 发布:卡佩拉毒舌数据 编辑:程序博客网 时间:2024/05/16 18:06
1.源码编译
1.1源码下载
首先,创建源码保存目录
[jack@localhost ~]$ mkdir -p src
获取源码的两种方式
1)Hypertable官网(http://www.hypertable.com)下载tar包并解压。
cd ~/src
tar zxvf<path_to>/hypertable-<version>-src.tar.gz
2)从git仓库获取
cd ~/src
git clone git://github.com/hypertable/hypertable.git
确认hypertable source tree is
~/src/hypertable
1.2安装编译环境
参考[HowToBuild](http://code.google.com/p/hypertable/wiki/HowToBuild),注意选择对应的系统平台和版本,本文选择CentOS6.0 64-bit。编译时注意以下两点:
1) Ceph和kfs无需安装;
2) Jdk版本必须大于或等于1.6.0。
也可通过执行脚本:~/src/hypertable/bin/src-utils/htbuild --install dev_env,来安装编译环境,此方法要求编译机器连接到Internet。
1.3 编译配置
类似linux下源码编译的操作,即
cd ~/src/hypertable
cmake CMakeLists.txt
//注意-D前有空格
Cmake -DCMAKE_INSTALL_PREFIX=/home/jack/installdir
-DCMAKE_BUILD_TYPE=Release
-DPACKAGE_OS_SPECIFIC=1
-DVERSION_ADD_COMMIT_SUFFIX=1
CMakeLists.txt
更多的配置,参考如下,需要在cmake之后添加参数
1)指定安装路径($prefix e.g. /home/jack/installdir)
cmake -DCMAKE_INSTALL_PREFIX=$prefix CMakeLists.txt
2)指定编译类型(默认是Debug)
cmake-DCMAKE_BUILD_TYPE=ReleaseCMakeLists.txt
3)指定hypertable版本后缀(e.g. 0.9.7.15.d4ada73)
cmake-DVERSION_ADD_COMMIT_SUFFIX=1 CMakeLists.txt
4) 指定特定的操作系统(e.g. hypertable-0.9.7.15.d4ada73-linux-x86_64)
cmake -DPACKAGE_OS_SPECIFIC=1 CMakeLists.txt
1.4编译二进制
编辑 ~/.bash_profile文件,在文件后添加:export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/local/lib:usr/local/lib64
source ~/.bash_profile
make (or make -jnumber_of_cpu_or_cores_plus_1 for faster compile)
make install
安装成功后,目录树如:/home/jack/installdir/0.9.7.x
cd ~/installdir
mv 0.9.7.8.tarball 0.9.7.8
mkdir –p hypertable-0.9.7.8 -linux-x86_64/opt/hypertable
mv 0.9.7.8 hypertable-0.9.7.8-linux-x86_64/opt/hypertable/
tar –cjvf hypertable-0.9.7.8-linux-x86_64.tar.bz2 hypertable-0.9.7.8-linux-x86_64
2.2 自动打包
2.2.1修改脚本文件
编辑~/src/hypertable/bin/src-utils/htpkg文件
修改srcdir和thriftdir,指定为实际使用的路径
#srcdir=$HOME/Source/hypertable
#thriftdir=/usr/src/thrift
srcdir=/home/jack/src/hypertable
thriftdir=/home/jack/Downloads/thrift-0.8.0
2.2.2执行命令
./htpkg–help查看命令帮助
如果安装2.1 编辑了srcdir和thriftdir则运行命令为
sudo ./htpkg RPM TBZ2
否则要指定参数,如下:
sudo ./htpkg --build Release --srcdir/home/jack/src/hypertable
--thriftdir/home/jack/Downloads/thrift-0.8.0RPM TBZ2
注意:参数后不用=,直接空格跟Path
命令成功执行完毕,在当前目录下生成*.tar.bz2 二进制包
以上是README.md 种提供的方法,注意在运行命令前
执行以下操作:sudorm -rfCMakeFiles CMakeCache.txt cmake_install.cmakeMakefile
另外,这样执行时,容易出现的错误,就是提示Find*.cmake头文件或库文件路径错误信息,
错误信息节选如下:
Can't locate ExtUtils/MakeMaker.pm in @INC
make[3]: Leaving directory `/root/src/htbuild-dir/thrift/lib/rb'
Making all in perl
make[3]: Entering directory `/root/src/htbuild-dir/thrift/lib/perl'
Making all in test
make[4]: Entering directory `/root/src/htbuild-dir/thrift/lib/perl/test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/root/src/htbuild-dir/thrift/lib/perl/test'
make[4]: Entering directory `/root/src/htbuild-dir/thrift/lib/perl'
/usr/bin/perl Makefile.PL MAKEFILE=Makefile-perl.mk INSTALLDIRS=
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 20.
BEGIN failed--compilation aborted at Makefile.PL line 20.
make[4]: *** [Makefile-perl.mk] 错误 2
make[4]: Leaving directory `/root/src/htbuild-dir/thrift/lib/perl'
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/root/src/htbuild-dir/thrift/lib/perl'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/root/src/htbuild-dir/thrift/lib'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/root/src/htbuild-dir/thrift'
make: *** [all] 错误 2
解决方法
//安装MakeMaker:
yum -y install perl-ExtUtils-MakeMaker-Coverage.noarch
rpm -qa|grep -i makemake --color=auto perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64 perl-ExtUtils-MakeMaker-Coverage-0.05-8.el6.noarch
3.2 由libedit引起的错误
错误信息节选如下:
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory `/root/build/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/build/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec.dir/CheckEditline.cc.o
/usr/bin/c++ -o CMakeFiles/cmTryCompileExec.dir/CheckEditline.cc.o -c /root/src/hypertable/cmake/CheckEditline.cc
In file included from /root/src/hypertable/cmake/CheckEditline.cc:20:
/usr/include/editline/readline.h:91: 错误:expected initializer before ‘*’ token
/usr/include/editline/readline.h:92: 错误:expected initializer before ‘*’ token
/usr/include/editline/readline.h:121: 错误:‘FILE’在此作用域中尚未声明
/usr/include/editline/readline.h:121: 错误:expected primary-expression before ‘)’ token
/root/src/hypertable/cmake/CheckEditline.cc: In function ‘int main()’:
/root/src/hypertable/cmake/CheckEditline.cc:25: 错误:‘el_wset’在此作用域中尚未声明
/root/src/hypertable/cmake/CheckEditline.cc:27: 错误:‘el_wgets’在此作用域中尚未声明
gmake[1]: *** [CMakeFiles/cmTryCompileExec.dir/CheckEditline.cc.o] 错误 1
gmake[1]: Leaving directory `/root/build/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec/fast] 错误 2
解决方法
rpm -e libedit --nodeps
#wget http://www.thrysoee.dk/editline/libedit-20121213-3.0.tar.gz
./configure --enable-widec
make
make install
cd /usr/lib64/
ln -sf /usr/local/lib/libedit.so .
3.3 由于libboost_thread名称不一致引起的错误
错误信息节选如下:
Linking CXX executable container_test
CMakeFiles/container_test.dir/tests/container_test.cc.o: In function `boost::thread_group::join_all()':
container_test.cc:(.text._ZN5boost12thread_group8join_allEv[boost::thread_group::join_all()]+0xd2): undefined reference to `boost::thread::join_noexcept()'
CMakeFiles/container_test.dir/tests/container_test.cc.o: In function `void Hypertable::parallel_run<boost::_bi::bind_t<void, void (*)(int), boost::_bi::list1<boost::_bi::value<int> > > >(boost::_bi::bind_t<void, void (*)(int), boost::_bi::list1<boost::_bi::value<int> > >, unsigned long, bool)':
解决方法
进入libboost_thread所在的目录,执行以下命令:
ln -sf libboost_thread.so libboost_thread-mt.so
3.4 java版本过低引起的问题
错误信息节选如下:
[javac] 182 problems (5 errors, 177 warnings)
BUILD FAILED
/root/src/forht/thrift-0.8.0/lib/java/build.xml:95: Compile failed; see the compiler error output for details.
解决方法
更换高版本的jdk,如:jdk1.6.0_34
3.5 编译ruby或者执行gem时出现“ERROR: RDoc documentation generator not installed: no such file to load -- rdoc/rdoc”
错误信息节选如下:
ERROR: While executing gem ... (Gem::DocumentError)
ERROR: RDoc documentation generator not installed: no such file to load -- rdoc/rdoc
解决方法
执行sudo yum intall ruby-rdoc; sudo gem install rdoc
3.6 执行thrift编译的make命令时出现“rake aborted”错误
错误信息如下图:
解决方法
这是一个已知的thrift下ruby的bug。
如果不需要支持ruby的话,可以先执行“./configure --without-ruby”,再执行make命令即可。
1.1源码下载
首先,创建源码保存目录
[jack@localhost ~]$ mkdir -p src
获取源码的两种方式
1)Hypertable官网(http://www.hypertable.com)下载tar包并解压。
cd ~/src
tar zxvf<path_to>/hypertable-<version>-src.tar.gz
2)从git仓库获取
cd ~/src
git clone git://github.com/hypertable/hypertable.git
确认hypertable source tree is
~/src/hypertable
1.2安装编译环境
参考[HowToBuild](http://code.google.com/p/hypertable/wiki/HowToBuild),注意选择对应的系统平台和版本,本文选择CentOS6.0 64-bit。编译时注意以下两点:
1) Ceph和kfs无需安装;
2) Jdk版本必须大于或等于1.6.0。
也可通过执行脚本:~/src/hypertable/bin/src-utils/htbuild --install dev_env,来安装编译环境,此方法要求编译机器连接到Internet。
1.3 编译配置
类似linux下源码编译的操作,即
cd ~/src/hypertable
cmake CMakeLists.txt
//注意-D前有空格
Cmake -DCMAKE_INSTALL_PREFIX=/home/jack/installdir
-DCMAKE_BUILD_TYPE=Release
-DPACKAGE_OS_SPECIFIC=1
-DVERSION_ADD_COMMIT_SUFFIX=1
CMakeLists.txt
更多的配置,参考如下,需要在cmake之后添加参数
1)指定安装路径($prefix e.g. /home/jack/installdir)
cmake -DCMAKE_INSTALL_PREFIX=$prefix CMakeLists.txt
2)指定编译类型(默认是Debug)
cmake-DCMAKE_BUILD_TYPE=ReleaseCMakeLists.txt
3)指定hypertable版本后缀(e.g. 0.9.7.15.d4ada73)
cmake-DVERSION_ADD_COMMIT_SUFFIX=1 CMakeLists.txt
4) 指定特定的操作系统(e.g. hypertable-0.9.7.15.d4ada73-linux-x86_64)
cmake -DPACKAGE_OS_SPECIFIC=1 CMakeLists.txt
1.4编译二进制
编辑 ~/.bash_profile文件,在文件后添加:export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/local/lib:usr/local/lib64
source ~/.bash_profile
make (or make -jnumber_of_cpu_or_cores_plus_1 for faster compile)
make install
安装成功后,目录树如:/home/jack/installdir/0.9.7.x
本文中,生成目录树为/home/jack/installdir/0.9.7.8.tarball
2.制作二进制包
2.1 手动打包cd ~/installdir
mv 0.9.7.8.tarball 0.9.7.8
mkdir –p hypertable-0.9.7.8 -linux-x86_64/opt/hypertable
mv 0.9.7.8 hypertable-0.9.7.8-linux-x86_64/opt/hypertable/
tar –cjvf hypertable-0.9.7.8-linux-x86_64.tar.bz2 hypertable-0.9.7.8-linux-x86_64
2.2 自动打包
2.2.1修改脚本文件
编辑~/src/hypertable/bin/src-utils/htpkg文件
修改srcdir和thriftdir,指定为实际使用的路径
#srcdir=$HOME/Source/hypertable
#thriftdir=/usr/src/thrift
srcdir=/home/jack/src/hypertable
thriftdir=/home/jack/Downloads/thrift-0.8.0
2.2.2执行命令
./htpkg–help查看命令帮助
如果安装2.1 编辑了srcdir和thriftdir则运行命令为
sudo ./htpkg RPM TBZ2
否则要指定参数,如下:
sudo ./htpkg --build Release --srcdir/home/jack/src/hypertable
--thriftdir/home/jack/Downloads/thrift-0.8.0RPM TBZ2
注意:参数后不用=,直接空格跟Path
命令成功执行完毕,在当前目录下生成*.tar.bz2 二进制包
以上是README.md 种提供的方法,注意在运行命令前
执行以下操作:sudorm -rfCMakeFiles CMakeCache.txt cmake_install.cmakeMakefile
另外,这样执行时,容易出现的错误,就是提示Find*.cmake头文件或库文件路径错误信息,
该类型的文件存放在~/src/hypertable/cmake/ 目录下。如果在安装编译环境时安装的软件路径找不到,可以根据提示,修改对应的Find*.cmake文件
3.编译环境搭建及编译过程中遇到的问题
3.1 缺少perl MakeMaker的错误错误信息节选如下:
Can't locate ExtUtils/MakeMaker.pm in @INC
make[3]: Leaving directory `/root/src/htbuild-dir/thrift/lib/rb'
Making all in perl
make[3]: Entering directory `/root/src/htbuild-dir/thrift/lib/perl'
Making all in test
make[4]: Entering directory `/root/src/htbuild-dir/thrift/lib/perl/test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/root/src/htbuild-dir/thrift/lib/perl/test'
make[4]: Entering directory `/root/src/htbuild-dir/thrift/lib/perl'
/usr/bin/perl Makefile.PL MAKEFILE=Makefile-perl.mk INSTALLDIRS=
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 20.
BEGIN failed--compilation aborted at Makefile.PL line 20.
make[4]: *** [Makefile-perl.mk] 错误 2
make[4]: Leaving directory `/root/src/htbuild-dir/thrift/lib/perl'
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/root/src/htbuild-dir/thrift/lib/perl'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/root/src/htbuild-dir/thrift/lib'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/root/src/htbuild-dir/thrift'
make: *** [all] 错误 2
解决方法
//安装MakeMaker:
yum -y install perl-ExtUtils-MakeMaker-Coverage.noarch
rpm -qa|grep -i makemake --color=auto perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64 perl-ExtUtils-MakeMaker-Coverage-0.05-8.el6.noarch
3.2 由libedit引起的错误
错误信息节选如下:
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory `/root/build/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/build/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec.dir/CheckEditline.cc.o
/usr/bin/c++ -o CMakeFiles/cmTryCompileExec.dir/CheckEditline.cc.o -c /root/src/hypertable/cmake/CheckEditline.cc
In file included from /root/src/hypertable/cmake/CheckEditline.cc:20:
/usr/include/editline/readline.h:91: 错误:expected initializer before ‘*’ token
/usr/include/editline/readline.h:92: 错误:expected initializer before ‘*’ token
/usr/include/editline/readline.h:121: 错误:‘FILE’在此作用域中尚未声明
/usr/include/editline/readline.h:121: 错误:expected primary-expression before ‘)’ token
/root/src/hypertable/cmake/CheckEditline.cc: In function ‘int main()’:
/root/src/hypertable/cmake/CheckEditline.cc:25: 错误:‘el_wset’在此作用域中尚未声明
/root/src/hypertable/cmake/CheckEditline.cc:27: 错误:‘el_wgets’在此作用域中尚未声明
gmake[1]: *** [CMakeFiles/cmTryCompileExec.dir/CheckEditline.cc.o] 错误 1
gmake[1]: Leaving directory `/root/build/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec/fast] 错误 2
解决方法
rpm -e libedit --nodeps
#wget http://www.thrysoee.dk/editline/libedit-20121213-3.0.tar.gz
./configure --enable-widec
make
make install
cd /usr/lib64/
ln -sf /usr/local/lib/libedit.so .
3.3 由于libboost_thread名称不一致引起的错误
错误信息节选如下:
Linking CXX executable container_test
CMakeFiles/container_test.dir/tests/container_test.cc.o: In function `boost::thread_group::join_all()':
container_test.cc:(.text._ZN5boost12thread_group8join_allEv[boost::thread_group::join_all()]+0xd2): undefined reference to `boost::thread::join_noexcept()'
CMakeFiles/container_test.dir/tests/container_test.cc.o: In function `void Hypertable::parallel_run<boost::_bi::bind_t<void, void (*)(int), boost::_bi::list1<boost::_bi::value<int> > > >(boost::_bi::bind_t<void, void (*)(int), boost::_bi::list1<boost::_bi::value<int> > >, unsigned long, bool)':
解决方法
进入libboost_thread所在的目录,执行以下命令:
ln -sf libboost_thread.so libboost_thread-mt.so
3.4 java版本过低引起的问题
错误信息节选如下:
[javac] 182 problems (5 errors, 177 warnings)
BUILD FAILED
/root/src/forht/thrift-0.8.0/lib/java/build.xml:95: Compile failed; see the compiler error output for details.
解决方法
更换高版本的jdk,如:jdk1.6.0_34
3.5 编译ruby或者执行gem时出现“ERROR: RDoc documentation generator not installed: no such file to load -- rdoc/rdoc”
错误信息节选如下:
ERROR: While executing gem ... (Gem::DocumentError)
ERROR: RDoc documentation generator not installed: no such file to load -- rdoc/rdoc
解决方法
执行sudo yum intall ruby-rdoc; sudo gem install rdoc
3.6 执行thrift编译的make命令时出现“rake aborted”错误
错误信息如下图:
解决方法
这是一个已知的thrift下ruby的bug。
如果不需要支持ruby的话,可以先执行“./configure --without-ruby”,再执行make命令即可。
0 0
- Hypetable源码编译和打包
- jenkins源码编译和打包
- dubbo源码编译和打包
- 编译打包Apache源码
- JspsmartUpload源码编译打包和解决乱码方法
- spark源码打包编译步骤
- android ant 编译打包 和批量打包
- poi-3.8修改源码、编译、打包过程
- mahout源码编译重新打包过程
- poi-3.8修改源码、编译、打包过程
- red5源码编译并打包发布
- red5源码编译并打包发布
- cdh版本hive源码编译打包
- Ambari 2.5.2源码编译打包
- IzPack打包工具 源码编译、安装、使用
- 应用程序的编译和打包
- cocos2d-x 2.x 和cocos2d-x 3.x android.mk的一件打包自动编译修改后的源码
- Moblin:kernel编译和rpm打包(二):RPM打包
- SpringMVC基于注解的配置
- wince 6.0 VC工程 RadioButton的使用
- ArcGIS 10 新特性之表和属性
- 产品经理须知:机会成本和沉没成本
- 谈从10亿个数中找出前10万个最大的
- Hypetable源码编译和打包
- view更新 invalidate与postInvalidate区别
- 五个关键因素决定SEO优化方向
- java读取远程url图片,得到宽高
- umonut -f
- 程序基础
- Winform 调用WebService程序 图文
- VC中获取文件的相对路径与绝对路径
- 此类分得很乱。。很多杂题也算进来了