Open vieyahn2017 opened 5 years ago
首先可以查看下是否安装了 rpm -qa |grep bison
2018年08月29日 15:19:04 大东dev 阅读数:651 原文:https://blog.csdn.net/u011008379/article/details/80343422
最近遇到一个要编译的源码居然没有configure文件,网上找到一个编译的方法,只有命令,没有说明,适合救急使用。
aclocal
autoconf
autoheader
automake --add-missing
./configure
make
sudo make install
configure.ac:*: error: required file 'autoconf/ltmain.sh' not found https://blog.csdn.net/x356982611/article/details/78771582
简介 执行命令’automake –add-missing’出现错误
解决方法 安装libtools sudo apt install libtool
或者源码安装 (libtool-2.4.6.tar.gz)
执行
libtoolize --automake --copy --debug --force
[root@vm01 thrift-0.10.0]# automake --add-missing
configure.ac:90: installing './config.guess'
configure.ac:90: installing './config.sub'
configure.ac:27: installing './install-sh'
configure.ac:90: error: required file './ltmain.sh' not found
configure.ac:27: installing './missing'
Makefile.am:49: warning: '%'-style pattern rules are a GNU make extension
Makefile.am:53: warning: ':='-style assignments are not portable
Makefile.am:54: warning: ':='-style assignments are not portable
Makefile.am:55: warning: ':='-style assignments are not portable
Makefile.am:58: warning: subst $(space: non-POSIX variable name
Makefile.am:58: (probably a GNU make extension)
Makefile.am:74: warning: '%'-style pattern rules are a GNU make extension
Makefile.am:83: warning: foreach var,$(TIMES: non-POSIX variable name
Makefile.am:83: (probably a GNU make extension)
Makefile.am:105: warning: subst $(space: non-POSIX variable name
Makefile.am:105: (probably a GNU make extension)
Makefile.am: installing './INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
Makefile.am: installing './COPYING' using GNU General Public License v3 file
Makefile.am: Consider adding the COPYING file to the version control system
Makefile.am: for your code, to avoid questions about which license your project uses
compiler/cpp/Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'
lib/Makefile.am:107: warning: '%'-style pattern rules are a GNU make extension
lib/c_glib/test/Makefile.am:281: warning: '%'-style pattern rules are a GNU make extension
*****
test/py/Makefile.am:79: warning: '%'-style pattern rules are a GNU make extension
tutorial/go/Makefile.am:37: warning: realpath $(top_srcdir: non-POSIX variable name
tutorial/go/Makefile.am:37: (probably a GNU make extension)
无视这上面的错误往下走,configure,会报错 [root@vm01 thrift-0.10.0]# ./configure
checking for a BSD-compatible install... /bin/install -c
***
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in'
其中这些错:
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
使用命令:automake --add-missing --copy --foreign
执行automake --add-missing --copy --foreign configure.ac:90: error: required file './ltmain.sh' not found
这个错: 安装libtool
执行
libtoolize --automake --copy --debug --forc
再重新
automake --add-missing --copy --foreign
执行 ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
***
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
***
config.status: executing libtool commands
thrift 0.10.0
Building Plugin Support ...... : yes
Building C++ Library ......... : yes
Building C (GLib) Library .... : yes
Building Java Library ........ : no
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : yes
Building Haxe Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Dart Library ........ : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no
Building NodeJS Library ...... : no
Building Lua Library ......... : no
C++ Library:
Build TZlibTransport ...... : yes
Build TNonblockingServer .. : no
Build TQTcpServer (Qt4) .... : yes
Build TQTcpServer (Qt5) .... : no
Python Library:
Using Python .............. : /bin/python
Ruby Library:
Using Ruby ................ : /bin/ruby
If something is missing that you think should be present,
please skim the output of configure to find the missing
component. Details are present in config.log.
执行 make
make[3]: Entering directory `/root/thrift-0.10.0/lib/rb'
/bin/bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching source index from http://rubygems.org/
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Could not fetch specs from http://rubygems.org/
make[3]: *** [all-local] Error 17
make[3]: Leaving directory `/root/thrift-0.10.0/lib/rb'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/thrift-0.10.0/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/thrift-0.10.0'
make: *** [all] Error 2
执行 make install
Making install in rb
make[2]: Entering directory `/root/thrift-0.10.0/lib/rb'
/bin/bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching source index from http://rubygems.org/
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Could not fetch specs from http://rubygems.org/
make[2]: *** [all-local] Error 17
make[2]: Leaving directory `/root/thrift-0.10.0/lib/rb'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/root/thrift-0.10.0/lib'
make: *** [install-recursive] Error 1
1.出现如下错误,不能fetch指定网站 http://rubygems.org/。
/usr/bin/bundle install
Fetching source index from http://rubygems.org/
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Could not fetch specs from http://rubygems.org/
make[3]: *** [all-local] Error 17
解决: 通过查找资料,发现如下路径的Gemfile中有“source http://rubygems.org/ ”命令:
./test/rb/Gemfile
./lib/rb/Gemfile
所以,需要下载http://rubygems.org/网站相应的东西 方法一:修改Gemfile的地址,然后编译thrift:
./configure --with-boost=/usr/include --prefix=/home/wusong/thrift
然后make,出错;说明源没有添加成功; 方法二,重新添加本地源
./configure --with-boost=/usr/include --without-ruby --prefix=/home/wusong/thrift
某贴说最好在/usr/local/目录下安装thrift,
安装完成后,如果此目录不在path下,还得加入path
cp -r thrift-0.10.0 /usr/local/
./configure --with-boost=/usr/include --without-ruby
make
make install
export PATH=$PATH:/usr/local/bin
参考帖子如下:
安装thrift全过程 https://www.cnblogs.com/shihuc/p/5938656.html
THRIFT的使用及遇到的问题 https://www.cnblogs.com/zhaochunhua/p/7069054.html
Linux下安装Thrift https://blog.csdn.net/y472360651/article/details/79050571
centos 环境安装 及 thrift安装 https://blog.csdn.net/cherryqiao/article/details/72673866
Posted on 2016-10-08 14:32 shihuc 阅读(...) 评论(...) 编辑 收藏 为了研究基于thrift的RPC框架,其实,是想自己基于thrift写一个微服务的platform。首先就是安装Thrift,便于IDL架构生成java的接口文件。多的不说了,开始install的过程吧。
我的机器,环境信息如下: 联想笔记本,Centos6.8的系统。
步骤:
安装平台开发工具
yum -y groupinstall "Development Tools"
安装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/local
make
make install
安装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/local
make
make install
安装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/local
make
make install
安装C++库依赖相关的开发包
yum -y install libevent-devel zlib-devel openssl-devel
安装boost
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
注意,按照上面这些步骤操作,是不会成功的,在安装boost过程中的最后一步,会出一大堆的错误,错误信息满屏幕的刷。。。。 好多关于gcc-c++相关的错误,还有就是python相关的错误。一顿帖子的研究,最终发现,是C++库以及依赖的安装有问题,基于上面的基础,再执行一下下面的操作补充安装一下依赖包:
[root@CloudGame boost_1_53_0]# yum install gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel -y 再执行./bootstrap.sh以及./b2,就不再出错了,最终得到下面的report,表示boost安装成功:
按照网上传遍大江南北的做法,我失败了,这个网上千篇一律的版本是这么干的:
git clone https://git-wip-us.apache.org/repos/asf/thrift.git
cd thrift
./bootstrap.sh
./configure --with-lua=no
make
make install
https://www.cnblogs.com/zhaochunhua/p/7069054.html
centos 系统安装官方文档:http://thrift.apache.org/docs/install/centos
一、按该文档安装出现了一系列的问题,记录如下:
1.安装thrift时./bootstrap.sh出错,然后安装libevent问题解决 (首先:git gc,清除./configure 和make错误的信息)
# wget http://www.monkey.org/~provos/libevent-1.2.tar.gz
# tar zxvf libevent-1.2.tar.gz
# cd libevent-1.2
# ./configure –prefix=/usr
# make
# make install
2.安装thrift到make步骤时出现如下错误:
g++: error: /usr/lib64/libboost_unit_test_framework.a: No such file or directory
.../../../lib/cpp/.libs/libthriftnb.so: undefined reference to `evutil_make_socket_closeonexec'
../../../lib/cpp/.libs/libthriftnb.so: undefined reference to `evbuffer_get_length'
../../../lib/cpp/.libs/libthriftnb.so: undefined reference to `evbuffer_pullup'
collect2: error: ld returned 1 exit status
4.automake --add-missing”时出错及解决办法:
a. configure.ac: error: no proper invocaction of AM_INIT_AUTOMAKE was found.
b. Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
使用命令:automake --add-missing --copy --foreign
c. required file config.h.in' not found 解决:在执行automake --add-missing之前执行autoheader,生成config.h.in d. Libtool library used but
LIBTOOL' is undefined?
解决:重装libtool 然后再运行
try run “libtoolize” in that directory first, and then re-run autoreconf
e. /usr/share/automake-1.14/am/depend2.am: error: am__fastdepCXX does not appear in AM_CONDITIONAL
在configure.ac 中加入
AC_INIT
AM_INIT_AUTOMAKE
dnl add this AC_PROG_CXX
AC_PROG_LIBTOOL
本人安装thrift遇到了各种各样的坑,真是一波三折,差点放弃,希望thrift能把安装过程完善一下,让使用者投入更多的时间在使用上而不是安装上。
二、Thrift python使用过程遇到的错误:
No handlers could be found for logger "thrift.server.TServer"
参考网址:http://blog.csdn.net/mantoureganmian/article/details/48340215
thrift框架做的很好,封装的也很好,不仅仅有代码生成功能,而且还有错误处理机制。这种错误处理机制处理过程是:当Handler类中的出现错误时,一律提示:“No handlers could be found for logger "thrift.server.TServer"”。换句话说,当变量拼写错误时,不会提示某个变量未命名,而提示“No handlers could be found for logger "thrift.server.TServer"”,这样无疑增加了改错难度,坑啊!!!
对于此,比较好的解决方案是:使用try....except Exception as e:模块来手动打印错误。try模块代码示例如下:
```python
try:
a=b
except Exception as e:
print e
我代码出错的原因是:server端返回给了client端字符串为汉字,改成拼音问题解决。
thrift整体来说还是很好用的,特别是支持跨多种语言,减少了开发者间的通信难度。
本人菜鸟一枚,但不会在菜鸟的路上越走越远,thrift遇到问题还会持续更新。。。
2018年01月13日 12:31:11 奔跑的豆子_ 阅读数:6592 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/y472360651/article/details/79050571
Linux下安装Thrift 0.11.0版本下载地址:http://mirrors.hust.edu.cn/apache/thrift/0.11.0/thrift-0.11.0.tar.gz 执行如下命令安装Thrift依赖:
apt-get install automake bison flex g++ git libboost1.55 libevent-dev libssl-dev libtool make pkg-config
解压编译:
tar -zxvf thrift-0.11.0.tar.gz
cd thrift-0.11.0
./configure --with-cpp --with-boost --with-python --without-csharp --with-java --without-erlang --without-perl --with-php --without-php_extension --without-ruby --without-haskell --without-go
make
make install
在Master中Hbase安装目录下的bin目录启动thrift服务:
./hbase-daemon.sh start thrift
https://blog.csdn.net/cherryqiao/article/details/72673866
2017年05月24日 10:33:18 cherryqiao 阅读数:1816 一.centos环境安装及上网配置
1、下载配置完整开源库的centos包。(楼主最开始下载的官网包,各种库安装下来快要哭了,最后只能放弃)
2、CentOS 修改DNS
修改对应网卡的DNS的配置文件
# vi /etc/resolv.conf
修改以下内容
nameserver 8.8.8.8 #google域名服务器
3、CentOS 修改网关 修改对应网卡的网关的配置文件 [root@centos]# vi /etc/sysconfig/network
NETWORKING=yes(表示系统是否使用网络,一般设置为yes。如果设为no,则不能使用网络,而且很多系统服务程序将无法启动)
HOSTNAME=centos(设置本机的主机名,这里设置的主机名要和/etc/hosts中设置的主机名对应)
GATEWAY=192.168.1.1(设置本机连接的网关的IP地址。例如,网关为10.0.0.2)
4、CentOS 修改IP地址
修改对应网卡的IP地址的配置文件
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改以下内容
DEVICE=eth0 #描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth0
BOOTPROTO=static #设置网卡获得ip地址的方式,可能的选项为static,dhcp或bootp,分别对应静态指定的 ip地址,通过dhcp协议获得的ip地 址,通过bootp协议获得的ip地址
BROADCAST=192.168.0.255 #对应的子网广播地址
HWADDR=00:07:E9:05:E8:B4 #对应的网卡物理地址
IPADDR=12.168.1.2 #如果设置网卡获得 ip地址的方式为静态指定,此字段就指定了网卡对应的ip地址
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0 #网卡对应的网络掩码
NETWORK=192.168.1.0 #网卡对应的网络地址
ONBOOT=yes #系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备
5、重新启动网络配置
# service network restart
或
# /etc/init.d/network restart
楼主刚开始只是通过
ifconfig ens33 192.168.xx.xx up
route add default gw 192.168.22.1
nameserver 192.168.xx.xx
设置IP 网管和 DNS,结果重启后就失效了,所以,只能通过以上方法又重新设置。
二.thrift安装:
1、下载thrift依赖的东西
yum -y install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel Python-devel ruby-devel crypto-utils
openssl openssl-devel
2、下载最新版本thrift,网址:http://thrift.apache.org
3、tar -zxvf thrift-0.9.0.tar.gz
移到默认安装目录 cp -r thrift-0.9.0 /usr/local/ (默认安装目录?否则可能影响到生成的thrift bin文件虽然有生成,但是找不到,安装在这里的话可以生成的thrift就在/usr/local/bin里了,这时终端输入thrift就有了,否则command not found.当然/usr/local/bin原先应该设置在$PATH里)
4、cd /usr/local/thrift-0.9.0
./bootstrap.sh (有You should add the contents of ./aclocal/libtool.m4' to
aclocal.m4'. glibtoolize: You should add the contents of ./aclocal/ltoptions.m4' to
aclocal.m4'. glibtoolize ...关于libtoolize,不管,继续下面的命令)
5、./configure --with-boost=/usr/include/ 因为boost安装在/usr/include里? 非常重要:可能这里有一个关于libtool的错误Version mismatch error. This is libtool 2.2.4, but the libtool: definition of this LT_INIT comes from libtool 2.2.6. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.4 libtool: and run autoconf again.
6、make 7、make install
8、在终端输入thrift,有下面的东东,ok,install thrift success. thrift bin文件在/usr/local/bin里
Usage: thrift [options] file
Options:
-version Print the compiler version
-o dir Set the output directory for gen-* packages
(default: current directory)
-I dir Add a directory to the list of directories
searched for include directives
-nowarn Suppress all compiler warnings (BAD!)
楼主实际上未进行第一步,且安装目录没有放在/usr/local/下,果然就。。。。。
https://blog.csdn.net/renzhewudi77/article/details/85090967
2018年12月19日 10:57:42 Miss_Bueno 阅读数:171 本文主要分为三部分:安装thrift、使用实例程序通过thrift访问hbase及错误集锦。 第一部分:安装thrift 根据官网文档,thrift安装比较简单,但是在实际过程中仍然遇到不少问题,一般是依赖库的问题; 1.首先通过官网下载thrift 安装包,本人安装0.11.tar.gz 2.验证依赖:thrift至少需要两个依赖库,boost和libevent,因此需查看系统中是否有这两个库; 安装libevent: ./configure --prefix=/home/wss make make install 安装boost: ./boosttrap.sh --prefix =/home/wss/boost 编译:./b2 ./b2 install 3.解压缩,进入解压后的目录;
第二部分:使用实例程序通过thrift访问hbase 前提一:hbase 、hadoop 、thrift服务开启 前提二:要想能访问hbase,首先python安装路径下需存在thrift生成的访问hbase所需的python文件,否则会报错,出现:ImportError: No module named hbase 首先:在hbase 的lib文件夹下找到hbase-thrift.jar包; 复制到制定路径下,解压缩;然后通过以下命令产生gen-py文件, /home/wusong/thrift/bin/thrift --gen py /home/wusong/thrift/thrift/org/apache/hadoop/hbase/thrift/Hbase.thrift 然后将产生的gen-py文件下的hbase文件夹复制到python的安装路径下;cp -r gen-py/hbase/ /usr/lib/python2.7/site-packages/ 再次执行test.py文件,成功; 进入hbase shell,利用list,可看到数据表新建成功。
第三部分:错误
1.出现如下错误,不能fetch指定网站。 /usr/bin/bundle install Fetching source index from http://rubygems.org/ Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/ Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/ Could not fetch specs from http://rubygems.org/ make[3]: *** [all-local] Error 17 解决: 通过查找资料,发现如下路径的Gemfile中有“source http://rubygems.org/ ”命令: ./test/rb/Gemfile ./lib/rb/Gemfile 所以,需要下载http://rubygems.org/网站相应的东西 方法一:修改Gemfile的地址,然后编译thrift: ./configure --with-boost=/usr/include --prefix=/home/wusong/thrift 然后make,出错;说明源没有添加成功; 方法二,重新添加本地源
3.将上述问题解决,又出现问题新问题: 利用python test.py执行测试程序时,出现如下错误:找不到thrif模块,原因是在python安装目录site-packages下没有thrift**.egg-info。因为我在make install时修改了路径。 因此,需要重新make install,用root账户。 利用root用户安装,问题解决; 4.将上述问题解决,又出现问题新问题: python test.py执行测试程序时,出现:ImportError: No module named hbase 首先:在hbase 的lib文件夹下找到hbase-thrift.jar包; 复制到制定路径下,解压缩;然后通过以下命令产生gen-py文件, /home/wusong/thrift/bin/thrift --gen py /home/wusong/thrift/thrift/org/apache/hadoop/hbase/thrift/Hbase.thrift 然后将产生的gen-py文件复制到python的安装路径下;cp -r gen-py/ /usr/lib/python2.7/site-packages/ 错误; 最后发现,是需要将gen-py下的hbase路径放到python的路径下。复制之后,再次执行test.py文件,执行成功。 进入hbase shell,利用list,可看到数据表新建成功。 参考链接:
http://f.dataguru.cn/thread-38626-1-1.html
使用:https://blog.cloudera.com/blog/2013/09/how-to-use-the-hbase-thrift-interface-part-1/
Python向hbase插入数据实例代码: https://www.pythontab.com/html/2013/pythonhexinbiancheng_0122/155.html
thrift远程连接hbase:https://blog.csdn.net/zt_fucker/article/details/49099771
2019 install