Discussion:
[Gluster-users] Gluster Compilation error: undefined reference to `yylex'
Rob Syme
2016-04-29 10:01:05 UTC
Permalink
Hi all

When compiling Gluster, make fails with:
...
Making all in src
CC glusterfsd-mgmt.o
CC glusterfsd.o
CCLD glusterfsd
/foo/bar/lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
Makefile:509: recipe for target 'glusterfsd' failed
make[3]: *** [glusterfsd] Error 1
Makefile:456: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:588: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:487: recipe for target 'all' failed
make: *** [all] Error 2

Even though the error is coming from flex, It seems that gluster should
supply the yylex function by auto-generated code that is the result of
calling lex on a '.l' file (
https://www.mail-archive.com/tools-***@mail.opensolaris.org/msg00601.html
)

I'm using: flex v2.6.0, bison v3.0.4, pkg-config v0.29, liburcu v0.9.2,
python v2.7.0, gcc v4.9.3 on linux (full dependency graph here:
Loading Image...). Any pointers are appreciated.

-r
Atin Mukherjee
2016-04-29 16:10:01 UTC
Permalink
Have you run ./autogen.sh && ./configure prior to make?

-Atin
Sent from one plus one
Post by Rob Syme
Hi all
...
Making all in src
CC glusterfsd-mgmt.o
CC glusterfsd.o
CCLD glusterfsd
/foo/bar/lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
Makefile:509: recipe for target 'glusterfsd' failed
make[3]: *** [glusterfsd] Error 1
Makefile:456: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:588: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:487: recipe for target 'all' failed
make: *** [all] Error 2
Even though the error is coming from flex, It seems that gluster should
supply the yylex function by auto-generated code that is the result of
calling lex on a '.l' file (
)
I'm using: flex v2.6.0, bison v3.0.4, pkg-config v0.29, liburcu v0.9.2,
http://i.imgur.com/xdn8trW.png). Any pointers are appreciated.
-r
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
Kaushal M
2016-05-02 03:18:32 UTC
Permalink
Post by Rob Syme
Hi all
...
Making all in src
CC glusterfsd-mgmt.o
CC glusterfsd.o
CCLD glusterfsd
/foo/bar/lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
Makefile:509: recipe for target 'glusterfsd' failed
make[3]: *** [glusterfsd] Error 1
Makefile:456: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:588: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:487: recipe for target 'all' failed
make: *** [all] Error 2
Even though the error is coming from flex, It seems that gluster should
supply the yylex function by auto-generated code that is the result of
calling lex on a '.l' file
I'm using: flex v2.6.0, bison v3.0.4, pkg-config v0.29, liburcu v0.9.2,
http://i.imgur.com/xdn8trW.png). Any pointers are appreciated.
Newer versions of flex (I don't know from which version) ship a .so,
which automake tries to link with whatever it is building by adding a
'-lfl' linker flag.
This causes the build failure. To avoid this, pass an empty 'LEXLIB='
option to the configure script, as in
`./configure <other-options> LEXLIB=`

This will allow the compilation and linking to happen properly.
Post by Rob Syme
-r
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
TomK
2016-05-03 01:55:23 UTC
Permalink
Hey All,

New here and first time posting. I've made a typo in configuration and
entered:

gluster volume create mdsglusterv01 transport rdma
mdskvm-p01:/mnt/p01-d01/glusterv01/

but couldn't start since rdma didn't exist:

[***@mdskvm-p01 glusterfs]# ls -altri
/usr/lib64/glusterfs/3.7.11/rpc-transport/*
135169384 -rwxr-xr-x. 1 root root 99648 Apr 18 08:21
/usr/lib64/glusterfs/3.7.11/rpc-transport/socket.so
[***@mdskvm-p01 glusterfs]#

So how do I reconfigure gluster to remove the rdma option and redefine
this brick?

[***@mdskvm-p01 glusterfs]# gluster volume info

Volume Name: mdsglusterv01
Type: Distribute
Volume ID: 84df37b3-3c68-4cc0-9383-3ff539a4d785
Status: Stopped
Number of Bricks: 1
Transport-type: rdma
Bricks:
Brick1: mdskvm-p01:/mnt/p01-d01/glusterv01
Options Reconfigured:
performance.readdir-ahead: on
[***@mdskvm-p01 glusterfs]#

I figure I can add in a dummy block device however wanted to find out if
there's anyway to change the above or redefine it before I do that.

Cheers,
Tom K.
-------------------------------------------------------------------------------------

Living on earth is expensive, but it includes a free trip around the sun.
Chen Chen
2016-05-03 02:17:38 UTC
Permalink
Hi Tom,

You may try:
gluster volume set volname config.transport tcp

ref:
http://www.gluster.org/community/documentation/index.php/RDMA_Transport#Changing_Transport_of_Volume

Best regards,
Chen
Post by TomK
Hey All,
New here and first time posting. I've made a typo in configuration and
gluster volume create mdsglusterv01 transport rdma
mdskvm-p01:/mnt/p01-d01/glusterv01/
/usr/lib64/glusterfs/3.7.11/rpc-transport/*
135169384 -rwxr-xr-x. 1 root root 99648 Apr 18 08:21
/usr/lib64/glusterfs/3.7.11/rpc-transport/socket.so
So how do I reconfigure gluster to remove the rdma option and redefine
this brick?
Volume Name: mdsglusterv01
Type: Distribute
Volume ID: 84df37b3-3c68-4cc0-9383-3ff539a4d785
Status: Stopped
Number of Bricks: 1
Transport-type: rdma
Brick1: mdskvm-p01:/mnt/p01-d01/glusterv01
performance.readdir-ahead: on
I figure I can add in a dummy block device however wanted to find out if
there's anyway to change the above or redefine it before I do that.
Cheers,
Tom K.
-------------------------------------------------------------------------------------
Living on earth is expensive, but it includes a free trip around the sun.
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
--
Chen Chen
Shanghai SmartQuerier Biotechnology Co., Ltd.
Add: Add: 3F, 1278 Keyuan Road, Shanghai 201203, P. R. China
Mob: +86 15221885893
Email: ***@smartquerier.com
Web: www.smartquerier.com
TomK
2016-05-03 03:46:13 UTC
Permalink
Thanks very much!

Did that then recovered the ID as well using the below off of google:

vol=mdsglusterv01
brick=/mnt/p01-d01/glusterv01
setfattr -n trusted.glusterfs.volume-id \
-v 0x$(grep volume-id /var/lib/glusterd/vols/$vol/info \
| cut -d= -f2 | sed 's/-//g') $brick

Another question I had is, if I add a 2TB LUN brick to gluster, w/ the
LUN existing on this physical node where I also have KVM running, will
the KVM guests write directly to the LUN @ FC speeds or would the writes
occur via glusterfs and the transport I selected below? Is gluster
intelligent enough to recognize that a particular brick exists on the
same physical from which writes are occurring and allow direct writes to
the brick via what ever medium it's mounted on (NFS, FC, FCoE, iSCSI etc)?

Disk /dev/sdb: 2199.0 GB, 2199023255552 bytes, 4294967296 sectors

[***@mdskvm-p01 ~]# gluster volume info

Volume Name: mdsglusterv01
Type: Distribute
Volume ID: 84df37b3-3c68-4cc0-9383-3ff539a4d785
Status: Started
Number of Bricks: 1
Transport-type: tcp,rdma
Bricks:
Brick1: mdskvm-p01:/mnt/p01-d01/glusterv01
Options Reconfigured:
config.transport: tcp,rdma
performance.readdir-ahead: on
[***@mdskvm-p01 ~]#

Cheers,
Tom K.
-------------------------------------------------------------------------------------

Living on earth is expensive, but it includes a free trip around the sun.
Post by Chen Chen
Hi Tom,
gluster volume set volname config.transport tcp
http://www.gluster.org/community/documentation/index.php/RDMA_Transport#Changing_Transport_of_Volume
Best regards,
Chen
Post by TomK
Hey All,
New here and first time posting. I've made a typo in configuration and
gluster volume create mdsglusterv01 transport rdma
mdskvm-p01:/mnt/p01-d01/glusterv01/
/usr/lib64/glusterfs/3.7.11/rpc-transport/*
135169384 -rwxr-xr-x. 1 root root 99648 Apr 18 08:21
/usr/lib64/glusterfs/3.7.11/rpc-transport/socket.so
So how do I reconfigure gluster to remove the rdma option and redefine
this brick?
Volume Name: mdsglusterv01
Type: Distribute
Volume ID: 84df37b3-3c68-4cc0-9383-3ff539a4d785
Status: Stopped
Number of Bricks: 1
Transport-type: rdma
Brick1: mdskvm-p01:/mnt/p01-d01/glusterv01
performance.readdir-ahead: on
I figure I can add in a dummy block device however wanted to find out if
there's anyway to change the above or redefine it before I do that.
Cheers,
Tom K.
-------------------------------------------------------------------------------------
Living on earth is expensive, but it includes a free trip around the sun.
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
Kaleb S. KEITHLEY
2016-05-04 18:03:56 UTC
Permalink
Post by Kaushal M
Post by Rob Syme
I'm using: flex v2.6.0, bison v3.0.4, pkg-config v0.29, liburcu v0.9.2,
http://i.imgur.com/xdn8trW.png). Any pointers are appreciated.
Newer versions of flex (I don't know from which version) ship a .so,
which automake tries to link with whatever it is building by adding a
'-lfl' linker flag.
This causes the build failure. To avoid this, pass an empty 'LEXLIB='
option to the configure script, as in
`./configure <other-options> LEXLIB=`
On Fedora, RHEL, CentOS, at least, libfl.a (no libfl.so*) comes from the
flex-devel RPM. flex-devel isn't needed to build gluster — you can
remove it.

On Debian-based distributions it comes from the libfl-dev pkg.
--
Kaleb
Kaleb S. KEITHLEY
2016-05-04 17:44:44 UTC
Permalink
Post by Rob Syme
Hi all
...
Making all in src
CC glusterfsd-mgmt.o
CC glusterfsd.o
CCLD glusterfsd
/foo/bar/lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
Makefile:509: recipe for target 'glusterfsd' failed
make[3]: *** [glusterfsd] Error 1
Makefile:456: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:588: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:487: recipe for target 'all' failed
make: *** [all] Error 2
Even though the error is coming from flex, It seems that gluster should
supply the yylex function by auto-generated code that is the result of
calling lex on a '.l' file
Take a look at .../libglusterfs/src/Makefile. You'll see that lex and
yacc (flex and bison) are run with -p graphyy, meaning that the lexical
analyzer and parser functions' names are graphyylex() and graphyyparse()
— both contained in libglusterfs.so.

This is standard practice when building yacc-and-lex-based parsers into
libraries; it allows an application to link with other libraries that
might also contain their own yacc-and-lex-based parsers.

I don't know what /foo/bar/lib/libfl.so is, or why it expects the
lexical analyzer to be named yylex(), but that's the crux of your
problem. You could try editing the .../glusterfsd/src/Makefile to remove
--quiet options and run `make V=1` in the .../glusterfsd/src directory
for more verbose output and that may provide better hints. All our
linux, *BSD, and Mac boxes don't have a libfl.so and don't try to link
with it.

And perhaps if we knew what platform you're trying to build on we could
give you a better answer. (But if it's OpenSolaris, well, you're
probably pretty much on your own there.)
Post by Rob Syme
I'm using: flex v2.6.0, bison v3.0.4, pkg-config v0.29, liburcu v0.9.2,
python v2.7.0, gcc v4.9.3 on linux (full dependency graph
here: http://i.imgur.com/xdn8trW.png). Any pointers are appreciated.
-r
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
--
Kaleb
Loading...