My guess is that you are missing some packages. The commands below should
get a plain vanilla Ubuntu 14.04 system up an running Thrift with
C++/Java/Python support. If you have conflicting packages already installed
(e.g. an existing different JDK, etc.) you may need to edit.
apt-get update && \
apt-get install -y \
automake \
bison \
flex \
g++ \
git \
libboost1.55-all-dev \
libevent-dev \
libssl-dev \
libtool \
make \
pkg-config \
wget \
\
ant \
maven \
openjdk-7-jdk \
\
python-all \
python-all-dbg \
python-all-dev \
python-setuptools \
python-support \
python-twisted \
python-zope.interface
git clone http://github.com/apache/thrift &&\
cd thrift &&\
./bootstrap.sh && \
./configure && \
make install && \
ldconfig
On Tue, Aug 4, 2015 at 9:15 AM, Jeon <[email protected]> wrote:
> I am trying to build Thrift.
>
> I've cloned Thrift source from git repository.
>
> When I look into `config.log` generated after `./configure`
>
> It is complaining about `yywrap'
>
> The important part is:
>
> configure:16225: checking for bison
> configure:16241: found /usr/bin/bison
> configure:16253: result: yes
> configure:16272: checking for bison version >= 2.5
> configure:16286: result: yes
> configure:16328: checking for bison
> configure:16344: found /usr/bin/bison
> configure:16355: result: bison -y
> configure:16371: checking for flex
> configure:16387: found /usr/local/bin/flex
> configure:16398: result: flex
> configure:16436: flex conftest.l
> configure:16440: $? = 0
> configure:16442: checking lex output file root
> configure:16456: result: lex.yy
> configure:16461: checking lex library
> configure:16475: gcc -o conftest -g -O2 conftest.c >&5
> conftest.c:23:0: warning: "BISON_VERSION" redefined [enabled by
> default]
> #define BISON_VERSION 3.0.2
> ^
> conftest.c:22:0: note: this is the location of the previous definition
> #define BISON_VERSION 0.0
> ^
> /tmp/ccSB2OwN.o: In function `input':
> /home/songsong/thrift/lex.yy.c:1173: undefined reference to `yywrap'
> /tmp/ccSB2OwN.o: In function `yylex':
> /home/songsong/thrift/lex.yy.c:871: undefined reference to `yywrap'
> /tmp/ccSB2OwN.o: In function `main':
> /home/songsong/thrift/conftest.l:18: undefined reference to `yywrap'
> collect2: error: ld returned 1 exit status
> configure:16475: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "thrift"
> | #define PACKAGE_TARNAME "thrift"
> ...
>
> I've google up for this problem,
> and I found that it is flex-related compile issue
> and that it can be solved by giving `-lfl` option to `gcc`
>
> But, as I have little knowledge about compiling, make and makefile,
> I have no idea in which file and in which line I should put `-lfl`, `
> configure.ac`, `Makefile`.
>
> Is there anyone who can give me a tiny hint of it?
>
> For detail information, I am using Ubuntu 14.04 (kernel 3.13.0-55-generic),
> Flex 2.5.39.
>
> Regards,
> Jeon.
>