Proxy v7 => compilation problem with RedHat Enterprise Linux 5-32 bits and 64bits

Asked by Herve

Hi all,

We are trying to install the proxy in our architectura but we are getting compilation problems either in 32 bits and 64 bits.
It would be so nice to get some help.

Herve
www.lanetro.com

ERROR 32 bits
------------------------------------------------------------------------------
PROXY=> mysql-proxy v 0.7
OS => RedHat Enterprise Linux 5 - 32 bits
We downloaded the proxy code from: http://launchpad.net/mysql-proxy/trunk/0.7.0/+download/mysql-proxy-0.7.0.tar.gz

We installed:
- libevent-1.4.9-stable.tar.gz
- glib-2.18.4.tar.gz
- lua-5.1.4.tar.gz

We run the following command: export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
The instalation of mysql-proxy-0.7.0.tar.gz
./configure -> is successfull
But : make -> we get an error that stop compilation.

 gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/local/include/glib-2.0/glib -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -O2 -MT libmysql_proxy_la-network-mysqld-lua.lo -MD -MP -MF .deps/libmysql_proxy_la-network-mysqld-lua.Tpo -c network-mysqld-lua.c -fPIC -DPIC -o .libs/libmysql_proxy_la-network-mysqld-lua.o
mv -f .deps/libmysql_proxy_la-network-mysqld-lua.Tpo .deps/libmysql_proxy_la-network-mysqld-lua.Plo
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/local/include/glib-2.0/glib -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -O2 -MT libmysql_proxy_la-network-mysqld-proto.lo -MD -MP -MF .deps/libmysql_proxy_la-network-mysqld-proto.Tpo -c -o libmysql_proxy_la-network-mysqld-proto.lo `test -f 'network-mysqld-proto.c' || echo './'`network-mysqld-proto.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/local/include/glib-2.0/glib -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -O2 -MT libmysql_proxy_la-network-mysqld-proto.lo -MD -MP -MF .deps/libmysql_proxy_la-network-mysqld-proto.Tpo -c network-mysqld-proto.c -fPIC -DPIC -o .libs/libmysql_proxy_la-network-mysqld-proto.o
network-mysqld-proto.c: In function 'network_mysqld_proto_get_int8':
network-mysqld-proto.c:211: error: expected expression before '==' token
network-mysqld-proto.c: In function 'network_mysqld_proto_peek_int8':
network-mysqld-proto.c:231: error: expected expression before '==' token
network-mysqld-proto.c: In function 'network_mysqld_proto_get_int16':
network-mysqld-proto.c:252: error: expected expression before '==' token
network-mysqld-proto.c: In function 'network_mysqld_proto_peek_int16':
network-mysqld-proto.c:272: error: expected expression before '==' token
network-mysqld-proto.c: In function 'network_mysqld_proto_get_int24':
network-mysqld-proto.c:293: error: expected expression before '==' token
network-mysqld-proto.c: In function 'network_mysqld_proto_scramble':
network-mysqld-proto.c:842: error: 'GChecksum' undeclared (first use in this function)
network-mysqld-proto.c:842: error: (Each undeclared identifier is reported only once
network-mysqld-proto.c:842: error: for each function it appears in.)
network-mysqld-proto.c:842: error: 'cs' undeclared (first use in this function)
network-mysqld-proto.c:846: error: 'G_CHECKSUM_SHA1' undeclared (first use in this function)
make[3]: *** [libmysql_proxy_la-network-mysqld-proto.lo] Error 1
make[3]: se sale del directorio `/tmp/mysql-proxy-0.7.0/src'
make[2]: *** [all] Error 2
make[2]: se sale del directorio `/tmp/mysql-proxy-0.7.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/tmp/mysql-proxy-0.7.0'
make: *** [all] Error 2

ERROR 64 bits
------------------------------------------------------------------------------
PROXY=> mysql-proxy v 0.7
OS => RedHat Enterprise Linux 5 - 64 bits
We downloaded the proxy code from: http://launchpad.net/mysql-proxy/trunk/0.7.0/+download/mysql-proxy-0.7.0.tar.gz

We went through the same steps as before.

 gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-chassis-keyfile.lo -MD -MP -MF .deps/libmysql_chassis_la-chassis-keyfile.Tpo -c chassis-keyfile.c -fPIC -DPIC -o .libs/libmysql_chassis_la-chassis-keyfile.o
mv -f .deps/libmysql_chassis_la-chassis-keyfile.Tpo .deps/libmysql_chassis_la-chassis-keyfile.Plo
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-chassis-stats.lo -MD -MP -MF .deps/libmysql_chassis_la-chassis-stats.Tpo -c -o libmysql_chassis_la-chassis-stats.lo `test -f 'chassis-stats.c' || echo './'`chassis-stats.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-chassis-stats.lo -MD -MP -MF .deps/libmysql_chassis_la-chassis-stats.Tpo -c chassis-stats.c -fPIC -DPIC -o .libs/libmysql_chassis_la-chassis-stats.o
mv -f .deps/libmysql_chassis_la-chassis-stats.Tpo .deps/libmysql_chassis_la-chassis-stats.Plo
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -export-dynamic -no-undefined -dynamic -o libmysql-chassis.la -rpath /usr/local/lib libmysql_chassis_la-glib-ext.lo libmysql_chassis_la-lua-load-factory.lo libmysql_chassis_la-lua-scope.lo libmysql_chassis_la-chassis-plugin.lo libmysql_chassis_la-chassis-log.lo libmysql_chassis_la-chassis-mainloop.lo libmysql_chassis_la-chassis-keyfile.lo libmysql_chassis_la-chassis-stats.lo -levent -L/usr/local/lib -lglib-2.0 -L/usr/local/lib -llua -lm -Wl,--export-dynamic -L/usr/local/lib -lgmodule-2.0 -lglib-2.0
gcc -shared .libs/libmysql_chassis_la-glib-ext.o .libs/libmysql_chassis_la-lua-load-factory.o .libs/libmysql_chassis_la-lua-scope.o .libs/libmysql_chassis_la-chassis-plugin.o .libs/libmysql_chassis_la-chassis-log.o .libs/libmysql_chassis_la-chassis-mainloop.o .libs/libmysql_chassis_la-chassis-keyfile.o .libs/libmysql_chassis_la-chassis-stats.o -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib /usr/local/lib/libevent.so -L/usr/local/lib -llua -lm /usr/local/lib/libgmodule-2.0.so /usr/local/lib/libglib-2.0.so -Wl,--export-dynamic -Wl,-soname -Wl,libmysql-chassis.so.0 -o .libs/libmysql-chassis.so.0.0.0
/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/liblua.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [libmysql-chassis.la] Error 1
make[3]: se sale del directorio `/tmp/mysql-proxy-0.7.0/src'
make[2]: *** [all] Error 2
make[2]: se sale del directorio `/tmp/mysql-proxy-0.7.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/tmp/mysql-proxy-0.7.0'
make: *** [all] Error 2

Question information

Language:
English Edit question
Status:
Solved
For:
MySQL Proxy Edit question
Assignee:
No assignee Edit question
Solved by:
Herve
Solved:
Last query:
Last reply:
Revision history for this message
amardeep (amardeep) said :
#1

Hi There,

We have same problem while doing "make" on OS Centos5.2 and 5.3 64 bit.

Even we tried on ubuntu 8.10 32 bit and it gives these errors.

make all-recursive
make[1]: Entering directory `/home/test/mysql-proxy-0.7.0'
Making all in cmake
make[2]: Entering directory `/home/test/mysql-proxy-0.7.0/cmake'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/test/mysql-proxy-0.7.0/cmake'
Making all in src
make[2]: Entering directory `/home/test/mysql-proxy-0.7.0/src'
make all-am
make[3]: Entering directory `/home/test/mysql-proxy-0.7.0/src'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-lua-load-factory.lo -MD -MP -MF .deps/libmysql_chassis_la-lua-load-factory.Tpo -c -o libmysql_chassis_la-lua-load-factory.lo `test -f 'lua-load-factory.c' || echo './'`lua-load-factory.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-lua-load-factory.lo -MD -MP -MF .deps/libmysql_chassis_la-lua-load-factory.Tpo -c lua-load-factory.c -fPIC -DPIC -o .libs/libmysql_chassis_la-lua-load-factory.o
lua-load-factory.c:32:17: error: lua.h: No such file or directory
lua-load-factory.c:33:20: error: lualib.h: No such file or directory
lua-load-factory.c:34:21: error: lauxlib.h: No such file or directory
In file included from lua-load-factory.c:37:
lua-load-factory.h:30: error: expected ')' before '*' token
lua-load-factory.h:31: error: expected ')' before '*' token
lua-load-factory.c:71: error: expected ')' before '__attribute__'
lua-load-factory.c:111: error: expected ')' before '*' token
lua-load-factory.c:123: error: expected ')' before '*' token
make[3]: *** [libmysql_chassis_la-lua-load-factory.lo] Error 1
make[3]: Leaving directory `/home/test/mysql-proxy-0.7.0/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/test/mysql-proxy-0.7.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/test/mysql-proxy-0.7.0'
make: *** [all] Error 2

Any help will be appreciated.

Thanks,
Amardeep

Revision history for this message
amardeep (amardeep) said :
#2

Hi There,

We have same problem while doing "make" on OS Centos5.2 and 5.3 64 bit.

Even we tried on ubuntu 8.10 32 bit and it gives these errors.

make all-recursive
make[1]: Entering directory `/home/test/mysql-proxy-0.7.0'
Making all in cmake
make[2]: Entering directory `/home/test/mysql-proxy-0.7.0/cmake'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/test/mysql-proxy-0.7.0/cmake'
Making all in src
make[2]: Entering directory `/home/test/mysql-proxy-0.7.0/src'
make all-am
make[3]: Entering directory `/home/test/mysql-proxy-0.7.0/src'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-lua-load-factory.lo -MD -MP -MF .deps/libmysql_chassis_la-lua-load-factory.Tpo -c -o libmysql_chassis_la-lua-load-factory.lo `test -f 'lua-load-factory.c' || echo './'`lua-load-factory.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_la-lua-load-factory.lo -MD -MP -MF .deps/libmysql_chassis_la-lua-load-factory.Tpo -c lua-load-factory.c -fPIC -DPIC -o .libs/libmysql_chassis_la-lua-load-factory.o
lua-load-factory.c:32:17: error: lua.h: No such file or directory
lua-load-factory.c:33:20: error: lualib.h: No such file or directory
lua-load-factory.c:34:21: error: lauxlib.h: No such file or directory
In file included from lua-load-factory.c:37:
lua-load-factory.h:30: error: expected ')' before '*' token
lua-load-factory.h:31: error: expected ')' before '*' token
lua-load-factory.c:71: error: expected ')' before '__attribute__'
lua-load-factory.c:111: error: expected ')' before '*' token
lua-load-factory.c:123: error: expected ')' before '*' token
make[3]: *** [libmysql_chassis_la-lua-load-factory.lo] Error 1
make[3]: Leaving directory `/home/test/mysql-proxy-0.7.0/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/test/mysql-proxy-0.7.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/test/mysql-proxy-0.7.0'
make: *** [all] Error 2

Any help will be appreciated.

Thanks,
Amardeep

Revision history for this message
Herve (hcayard) said :
#3

Hi All,

After almost 1 week of work we have some news about our post.

We have been abble to compile mysql-proxy v 0.7 on RedHat Enterprise Linux 5 - 32 bits and 64 bits.
It has been quiet complicated but we finnaly made it by using.

1-For 32bits and 64bits
You need to have installed the following librairies: libstdc++, libstdc++-devel, libstdc++43-devel.

2-For 64 bits:
- edit file lua-5.1.4/src/Makefile
- add flag -fPIC within the compile rule => CFLAGS= -fPIC -O2 -Wall $(MYCFLAGS)
- Then you can compile again:
make clean
make linux
make install

Then compile mysql-proxy again through:
make clean
./configure
make
make install

3-For 32 bits:
You just need to install the librairies of point 1

Hope it will help.
Herve

Revision history for this message
amardeep (amardeep) said :
#4

Hi There,

Thanks for updating the thread and the information was really helpful. But i am still getting few error in make.

OS > CentOS 5.3 64 bit

I have installed all libraries as mentioned and using following versions.
glib-2.20.1
libevent-1.4.10-stable
lua-5.1.4
mysql-proxy-0.7.0

When i configure mysql proxy using this
./configure LDFLAGS="-lm -ldl" LUA_CFLAGS="-I/usr/local/include/" LUA_LIBS=/usr/local/lib/liblua.a GLIB_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" GLIB_LIBS="-L/usr/local/lib -lglib-2.0" GMODULE_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" GMODULE_LIBS="-L/usr/local/lib -lglib-2.0" GTHREAD_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" GTHREAD_LIBS="-L/usr/local/lib -lglib-2.0"

As it is not detecting the packages by default.

Configure goes fine make starts and goes fine but then throws the following error.

(cd .libs && rm -f libmysql-proxy.la && ln -s ../libmysql-proxy.la libmysql-proxy.la)
gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include/ -I/usr/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -DDATADIR="\"/usr/local/share/mysql-proxy\"" -DLIBDIR="\"/usr/local/lib/mysql-proxy\"" -g -O2 -MT mysql_binlog_dump-mysql-binlog-dump.o -MD -MP -MF .deps/mysql_binlog_dump-mysql-binlog-dump.Tpo -c -o mysql_binlog_dump-mysql-binlog-dump.o `test -f 'mysql-binlog-dump.c' || echo './'`mysql-binlog-dump.c
mv -f .deps/mysql_binlog_dump-mysql-binlog-dump.Tpo .deps/mysql_binlog_dump-mysql-binlog-dump.Po
/bin/sh ../libtool --tag=CC --mode=link gcc -DDATADIR="\"/usr/local/share/mysql-proxy\"" -DLIBDIR="\"/usr/local/lib/mysql-proxy\"" -g -O2 -lm -ldl -o mysql-binlog-dump mysql_binlog_dump-mysql-binlog-dump.o -L/usr/local/lib -lglib-2.0 -L/usr/local/lib -lglib-2.0 libmysql-chassis.la -L/usr/local/lib -lglib-2.0 libmysql-proxy.la
gcc -DDATADIR=\"/usr/local/share/mysql-proxy\" -DLIBDIR=\"/usr/local/lib/mysql-proxy\" -g -O2 -o .libs/mysql-binlog-dump mysql_binlog_dump-mysql-binlog-dump.o -L/usr/local/lib ./.libs/libmysql-chassis.so ./.libs/libmysql-proxy.so /usr/local/src/mysql-proxy-0.7.0/src/.libs/libmysql-chassis.so -lm -ldl /usr/local/lib/libevent.so -lnsl -lrt -lresolv /usr/local/lib/libglib-2.0.so -Wl,--rpath -Wl,/usr/local/lib
mysql_binlog_dump-mysql-binlog-dump.o: In function `main':
/usr/local/src/mysql-proxy-0.7.0/src/mysql-binlog-dump.c:1023: undefined reference to `g_thread_init'
./.libs/libmysql-chassis.so: undefined reference to `g_module_close'
./.libs/libmysql-chassis.so: undefined reference to `g_module_symbol'
./.libs/libmysql-chassis.so: undefined reference to `g_module_open'
./.libs/libmysql-chassis.so: undefined reference to `g_module_error'
collect2: ld returned 1 exit status
make[3]: *** [mysql-binlog-dump] Error 1
make[3]: Leaving directory `/usr/local/src/mysql-proxy-0.7.0/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/src/mysql-proxy-0.7.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/mysql-proxy-0.7.0'
make: *** [all] Error 2

Any suggestions?

Thanks,
Amardeep

Revision history for this message
amardeep (amardeep) said :
#5

Hi,

Further to my last mail the issue is sorted now problem was in the ./configure parameters which was passed.

Thanks,
Amardeep

Revision history for this message
Herve (hcayard) said :
#6

Great.