https://note.youdao.com/ynoteshare1/index.html?id=a7bcdc9e35398c39f905cb809b2e4bee&type=note
下载地址
Linux版本:
[root@gls68 ~]# lsb_release -a
LSB Version: :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.8 (Final)
Release: 6.8
Codename: Final
更新系统
######sudo yum -y update (系统更新为6.8) 暂时不用
安装平台开发环境
sudo yum -y groupinstall "Development Tools"
Installed:
autoconf.noarch 0:2.63-5.1.el6 automake.noarch 0:1.11.1-4.el6 bison.i686 0:2.4.1-5.el6 byacc.i686 0:1.9.20070509-7.el6
cscope.i686 0:15.6-7.el6 ctags.i686 0:5.8-2.el6 diffstat.i686 0:1.51-2.el6 doxygen.i686 1:1.6.1-6.el6
elfutils.i686 0:0.164-2.el6 flex.i686 0:2.5.35-9.el6 gcc.i686 0:4.4.7-17.el6 gcc-c++.i686 0:4.4.7-17.el6
gcc-gfortran.i686 0:4.4.7-17.el6 git.i686 0:1.7.1-4.el6_7.1 indent.i686 0:2.2.10-7.el6 intltool.noarch 0:0.41.0-1.1.el6
libtool.i686 0:2.2.6-15.5.el6 patchutils.i686 0:0.3.1-3.1.el6 rcs.i686 0:5.7-37.el6 redhat-rpm-config.noarch 0:9.0.3-51.el6.centos
rpm-build.i686 0:4.8.0-55.el6 subversion.i686 0:1.6.11-15.el6_7 swig.i686 0:1.3.40-6.el6 systemtap.i686 0:2.9-4.el6
Dependency Installed:
apr.i686 0:1.3.9-5.el6_2 apr-util.i686 0:1.3.9-3.el6_0.1 cloog-ppl.i686 0:0.15.7-1.2.el6
cpp.i686 0:4.4.7-17.el6 elfutils-libs.i686 0:0.164-2.el6 gdb.i686 0:7.2-90.el6
gettext-devel.i686 0:0.17-18.el6 gettext-libs.i686 0:0.17-18.el6 kernel-devel.i686 0:2.6.32-642.15.1.el6
libart_lgpl.i686 0:2.3.20-5.1.el6 libgcj.i686 0:4.4.7-17.el6 libgfortran.i686 0:4.4.7-17.el6
libproxy.i686 0:0.3.0-10.el6 libproxy-bin.i686 0:0.3.0-10.el6 libproxy-python.i686 0:0.3.0-10.el6
libstdc++-devel.i686 0:4.4.7-17.el6 mailcap.noarch 0:2.1.31-2.el6 mpfr.i686 0:2.4.1-6.el6
neon.i686 0:0.29.3-3.el6_4 pakchois.i686 0:0.4-3.2.el6 perl-Compress-Raw-Zlib.i686 1:2.021-141.el6_7.1
perl-Compress-Zlib.i686 0:2.021-141.el6_7.1 perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-4.el6_7.1
perl-HTML-Parser.i686 0:3.64-2.el6 perl-HTML-Tagset.noarch 0:3.20-4.el6 perl-IO-Compress-Base.i686 0:2.021-141.el6_7.1
perl-IO-Compress-Zlib.i686 0:2.021-141.el6_7.1 perl-URI.noarch 0:1.40-2.el6 perl-XML-Parser.i686 0:2.36-7.el6
perl-libwww-perl.noarch 0:5.833-3.el6 ppl.i686 0:0.10.2-11.el6 rsync.i686 0:3.0.6-12.el6
systemtap-client.i686 0:2.9-4.el6 systemtap-devel.i686 0:2.9-4.el6 systemtap-runtime.i686 0:2.9-4.el6
unzip.i686 0:6.0-4.el6 zip.i686 0:3.0-1.el6_7.1
Complete!
升级autoconf/automake/bison
sudo yum install -y wget
升级 autoconf
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr
make
sudo make install
cd ..
升级 automake
wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
tar xvf automake-1.14.tar.gz
cd automake-1.14
./configure --prefix=/usr
make
sudo make install
cd ..
升级 bison
wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
tar xvf bison-2.5.1.tar.gz
cd bison-2.5.1 ./configure --prefix=/usr
make
sudo make install
cd ..
安装C++依赖库
sudo yum -y install libevent-devel zlib-devel openssl-devel
更新 Boost >= 1.53
wget http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz
tar xvf boost_1_53_0.tar.gz
cd boost_1_53_0
./bootstrap.sh
./b2
如果报错
...failed updating 58 targets...
...skipped 12 targets...
...updated 898 targets...
cd
yum -y install bzip2-devel
yum -y install python-devel
cd boost_1_53_0
./b2
成功的输出
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/root/boost_1_53_0
The following directory should be added to linker library paths:
/root/boost_1_53_0/stage/lib
继续运行
sudo ./b2 install
cd ..
安装thrift-0.9.0
tar xvf thrift-0.9.0.tar.gz
cd thrift-0.9.0
./contrib/fb303/bootstrap.sh (这才是bootstrap.sh的路径)
./configure --with-lua=no
make
报错
/usr/local/include/c++/4.8.2/cstdlib:140:11: error: '::malloc' has not been declared
using ::malloc;
^
/usr/local/include/c++/4.8.2/cstdlib:153:11: error: '::realloc' has not been declared
using ::realloc;
^
make[4]: *** [Thrift.lo] Error 1
make[4]: Leaving directory `/root/tools/thrift-0.9.0/lib/cpp'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/root/tools/thrift-0.9.0/lib/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/tools/thrift-0.9.0/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/tools/thrift-0.9.0'
make: *** [all] Error 2
ln /usr
sudo make install
安装fb303
Facebook Bassline (included in thrift/contrib/fb303/)
fb303 r697294 or later is required.
(已经包含在Thrift中了,重新编译一下fb303就可以)
cd ./contrib/fb303/
./bootstrap.sh
./configure
make
make install
cd ..
下载scribe
解压
unzip master.zip
cd scribe-master
运行命令:
./bootstrap.sh --prefix=/usr/local/include/scribe --with-thriftpath=/usr/local/include/thrift/ --with-fb303path=/usr/local/include/thrift/fb303/ --with-boost=/usr/local/include/boost/
automake-1.14: error: global options already processed
vim configure.ac
# AM_INIT_AUTOMAKE (此行注释掉)
报错:
checking whether the Boost::System library is available… yes
checking whether the Boost::Filesystem library is available… yes
configure: error: Could not link against !
所有boost删除 重装,scribe重新下载
checking whether the Boost::System library is available… yes
checking whether the Boost::Filesystem library is available… yes
次二句是错误
configure: error: Could not link against ! (下面的configure会解决)
./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H"
make
make install
启动scribe时所报错误:
src/scribed: error while loading shared libraries: libboost_system.so.1.53.0: cannot open shared object file: No such file or directory
这个是不能正确加载boost所导致,我们需要去检查下/usr/lib或/usr/lib64/目录下有没有libboost_system.so.1.53.0这个文件.如果你的操作系统是64位,可以根据命令getconf LONG_BIT查看,那就需要将libboost_system.so.1.53.0放到/usr/lib6/目录下即可.至于libboost_system.so.1.53.0文件在哪里?可以通过命令
sudo find / -name libboost_system.so.1.53.0
查找下即可,找到后再通过软连接过去.
引起这个原因大部分还是操作系统是64位,而boost经默认安装libboost_system.so.1.53.0被放到/usr/local/lib/目录下,所以我们需要软连接过去即可,
命令:
sudo ln -s /usr/local/lib/libboost_system.so.1.53.0 /usr/lib64/libboost_system.so.1.53.0
类似的错误还有,thrift,libhdfs等,都可以用这种办法解决,类似错误:
参考:
解决configure: error: Could not link against !
问题描述:在./configure时出现error: Could not link against !
解决方法:来自 http://stackoverflow.com/questions/9132335/configure-error-could-not-link-against-boost-system
对于64位机:./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
对于32位机:./configure --with-boost-libdir=/usr/lib/i386-linux-gnu(测试可用)
另一说法:来自https://baoz.net/%E8%A7%A3%E5%86%B3configure-error-could-not-link-against-%E9%97%AE%E9%A2%98boost%E7%9B%B8%E5%85%B3/
在64位里编译boost相关程序的时候,会遇到configure: error: Could not link against !错误。
解决方法是用–with-boost-libdir=/usr/lib64 指定库文件位置即可解决。
scribe 关闭方法 直接在 htop kill 掉 进程
root@py-6:~/scribe/examples# echo "hello world"|./scribe_cat test
Traceback (most recent call last):
File "./scribe_cat", line 24, in <module>
from scribe import scribe
ImportError: No module named scribe
解决办法
在debian/ubuntu系列安装完毕后,python的scribe模块并没有在默认搜索路径中,所以:
cp -a /usr/lib/python2.7/site-packages/* /usr/lib/python2.7/dist-packages/
liunx下安装mysql,make时 *** No targets specified and no makefile found. stop.
(2012-05-24 15:52:28)
在自己虚拟机上配置完成,并能运行项目后。把方法整理后交给同事,以为完事了 甚是高兴 不幸 又出现错误 ,原本以下 四步 就可完成安装
# tar –zxvf mysql-5.0.95
# ./configure --prefix=/usr/local/mysql --with-charset=gbk
# make
# make install
但在make的时候 出现
make: *** No targets specified and no makefile found. stop.
仔细查看 ./configure时,报了下边几个错
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found(重点错误)
看错误提示 可知是找不到curses,, 所以是缺少ncurses安装包 造成的
解决方法如下:
我的系统是RedHat5系列:
yum list|grep ncurses
yum -y install ncurses-devel
yum install ncurses-devel
完成后,重新 ./configure --prefix=/usr/local/mysql --with-charset=gbk,make && make install
ok!
thrift: error while loading shared libraries: libstdc++.so.6: wrong ELF clas 32
解决: /usr/lib64/libstdc++.so.6 指向错误 ,换一个软连接(必须有此文件)
之后 thrift 的make 会替换掉软连接 (不知为何)
发现这个里面正是最新版本的动态库,可见,在升级gcc时,gcc编译会在gcc-temp目录中生成libstdc++.so.6,升级完毕,默认只会在/usr/local/lib64目录下包含最新的libstdc++.so.6动态库,而不会更新/usr/lib64目录下的libstdc++.so.6。而执行程序时,程序会优先从/usr/lib64目录下去寻找libstdc++.so.6,由于老版本的gcc在/usr/lib64中有一个旧版本的动态库libstdc++.so.6,导致程序以为自己找到了正确的动态库,实际上找到的却不是最新的。
Index of /gnu/gcc/gcc-4.4.7
gcc 版本过高 下载一个低级版本的,不要管高版本的
boost 问题 卸载 boost (删除boost文件夹) 重新下载
因为 其他 可以 make uninstall 卸载 ,它不可以
thriftl.ll:51:21: error: thrifty.h: No such file or directory