netmrg 0.10pre1 on solaris 8 -> -lmysqlclient problem

Whizzer

29-07-2003 10:24:24

Hi,

I was testing this new netmrg because it looks pretty cool and it was developed to monitor lots of resources... Well, I'm monitoring over a 100 devices via mrtg on this moment.

So i was testing to set it up for solaris 8, but I get the following error during ./configure

# ./configure --host=sparc-sun-solaris2.8
<...>
checking for mysql_init in -lmysqlclient... no
configure error MySQL libraries not found.
configure error /bin/ksh './configure' failed for src
#

Since other apps do work with mysql, I think something is wrong in the netmrg app.... mysql is installed in /usr/local/mysql.

Any idea how to solve this problem?

balleman

29-07-2003 11:17:50

You can try specifying the path to MySQL using configure arguments, something like the following

[code1fd1e2d5056]./configure --with-mysql-include-dir=/usr/local/mysql/include --with-mysql-lib-dir=/usr/local/mysql/lib[/code1fd1e2d5056]

The complete set of options is available by running [code1fd1e2d5056]./configure --help=recursive[/code1fd1e2d5056]

Please let us know how you make out. We've not tested this on Solaris yet.

Whizzer

29-07-2003 13:10:28

Ah.. the help could be found by typing ./configure --help=recursive... Normally ./configure --help does fine...

But back to the problem Sorry, still doesn't work....

[code186823308e5]
# ./configure --host=sparc-sun-solaris2.8 --with-mysql-include-dir=/usr/local/mysql/include --with-mysql-lib-dir=/usr/local/mysql/lib
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for sparc-sun-solaris2.8-strip... no
checking for strip... strip
checking whether make sets $(MAKE)... (cached) yes
checking for rrdtool... /usr/local/rrdtool-1.0.40/bin/rrdtool
configure: creating ./config.status
config.status: creating Makefile
config.status: creating www/Makefile
config.status: creating bin/netmrg_cron.sh
config.status: creating etc/netmrg.conf
config.status: creating etc/netmrg.xml
config.status: creating src/include/netmrg.h
config.status: creating www/include/config.php
configure: configuring in src
configure: running /bin/ksh './configure' --prefix=/usr/local '--host=sparc-sun-solaris2.8' '--with-mysql-include-dir=/usr/local/mysql/include' '--with-mysql-lib-dir=/usr/local/mysql/lib' 'host_alias=sparc-sun-solaris2.8' --exec-prefix=/usr/local --cache-file=/dev/null --srcdir=.
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8
checking for a BSD-compatible install... ./../install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for sparc-sun-solaris2.8-strip... no
checking for strip... strip
checking for sparc-sun-solaris2.8-g++... sparc-sun-solaris2.8-g++
checking for C++ compiler default output... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether sparc-sun-solaris2.8-g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of sparc-sun-solaris2.8-g++... gcc3
checking for sparc-sun-solaris2.8-gcc... sparc-sun-solaris2.8-gcc
checking whether we are using the GNU C compiler... yes
checking whether sparc-sun-solaris2.8-gcc accepts -g... yes
checking for sparc-sun-solaris2.8-gcc option to accept ANSI C... none needed
checking dependency style of sparc-sun-solaris2.8-gcc... gcc3
checking how to run the C preprocessor... sparc-sun-solaris2.8-gcc -E
checking for a BSD-compatible install... ./../install-sh -c
checking whether to enable -Wall... no
checking for dlopen in -ldl... yes
checking for compress in -lz... yes
checking for pthread_exit in -lpthread... yes
checking for main in -lstdc++... yes
checking for mysql_init in -lmysqlclient... no
configure: error: MySQL libraries not found.
configure: error: /bin/ksh './configure' failed for src
#
#
# ls -l /usr/local/mysql/lib
total 3534
-rw-r--r-- 1 root mysql 15054 Aug 12 2002 libdbug.a
-rw-r--r-- 1 root mysql 767672 Mar 17 2001 libmygcc.a
-rw-r--r-- 1 root mysql 306282 Aug 12 2002 libmysqlclient.a
-rw-r--r-- 1 root mysql 313422 Aug 12 2002 libmysqlclient_r.a
-rw-r--r-- 1 root mysql 121444 Aug 12 2002 libmystrings.a
-rw-r--r-- 1 root mysql 223696 Aug 12 2002 libmysys.a
#
# ls -l /usr/local/mysql/include
total 718
-rw-r--r-- 1 root mysql 22185 Aug 12 2002 config-os2.h
-rw-r--r-- 1 root mysql 9394 Aug 12 2002 config-win.h
-rw-r--r-- 1 root mysql 21021 Aug 12 2002 config.h
-rw-r--r-- 1 root mysql 3445 Aug 12 2002 dbug.h
-rw-r--r-- 1 root mysql 2082 Aug 12 2002 errmsg.h
-rw-r--r-- 1 root mysql 1819 Aug 12 2002 ft_global.h
-rw-r--r-- 1 root mysql 4799 Aug 12 2002 getopt.h
-rw-r--r-- 1 root mysql 31525 Aug 12 2002 global.h
-rw-r--r-- 1 root mysql 2364 Aug 12 2002 hash.h
-rw-r--r-- 1 root mysql 5599 Aug 12 2002 heap.h
-rw-r--r-- 1 root mysql 5864 Aug 12 2002 m_ctype.h
-rw-r--r-- 1 root mysql 7594 Aug 12 2002 m_string.h
-rw-r--r-- 1 root mysql 3195 Aug 12 2002 merge.h
-rw-r--r-- 1 root mysql 2098 Aug 12 2002 my_alarm.h
-rw-r--r-- 1 root mysql 10856 Aug 12 2002 my_base.h
-rw-r--r-- 1 root mysql 1876 Aug 12 2002 my_bitmap.h
-rw-r--r-- 1 root mysql 21021 Aug 12 2002 my_config.h
-rw-r--r-- 1 root mysql 3294 Aug 12 2002 my_dir.h
-rw-r--r-- 1 root mysql 31525 Aug 12 2002 my_global.h
-rw-r--r-- 1 root mysql 1579 Aug 12 2002 my_list.h
-rw-r--r-- 1 root mysql 2696 Aug 12 2002 my_net.h
-rw-r--r-- 1 root mysql 1205 Aug 12 2002 my_no_pthread.h
-rw-r--r-- 1 root mysql 1712 Aug 12 2002 my_nosys.h
-rw-r--r-- 1 root mysql 21983 Aug 12 2002 my_pthread.h
-rw-r--r-- 1 root mysql 25751 Aug 12 2002 my_sys.h
-rw-r--r-- 1 root mysql 2479 Aug 12 2002 my_tree.h
-rw-r--r-- 1 root mysql 14025 Aug 12 2002 myisam.h
-rw-r--r-- 1 root mysql 3445 Aug 12 2002 myisammrg.h
-rw-r--r-- 1 root mysql 9292 Aug 12 2002 myisampack.h
-rw-r--r-- 1 root mysql 10787 Aug 12 2002 mysql.h
-rw-r--r-- 1 root mysql 8677 Aug 12 2002 mysql_com.h
-rw-r--r-- 1 root mysql 580 Aug 12 2002 mysql_version.h
-rw-r--r-- 1 root mysql 8188 Aug 12 2002 mysqld_error.h
-rw-r--r-- 1 root mysql 1866 Aug 12 2002 mysys_err.h
-rw-r--r-- 1 root mysql 6868 Aug 12 2002 nisam.h
-rw-r--r-- 1 root mysql 2140 Aug 12 2002 queues.h
-rw-r--r-- 1 root mysql 5869 Aug 12 2002 raid.h
-rw-r--r-- 1 root mysql 1605 Aug 12 2002 sslopt-case.h
-rw-r--r-- 1 root mysql 1296 Aug 12 2002 sslopt-longopts.h
-rw-r--r-- 1 root mysql 1239 Aug 12 2002 sslopt-usage.h
-rw-r--r-- 1 root mysql 1013 Aug 12 2002 sslopt-vars.h
-rw-r--r-- 1 root mysql 4907 Aug 12 2002 t_ctype.h
-rw-r--r-- 1 root mysql 2782 Aug 12 2002 thr_alarm.h
-rw-r--r-- 1 root mysql 3907 Aug 12 2002 thr_lock.h
-rw-r--r-- 1 root mysql 3024 Aug 12 2002 violite.h
-rw-r--r-- 1 root mysql 4132 Aug 12 2002 widec.h
#
[/code186823308e5]

Any other crazy ideas left???? As soon as it is running on Solaris, I'll try it on AIX 5.1... Just to let you know....

ruler

29-07-2003 15:11:40

Try doing..

gcc -L/usr/local/mysql/lib -lmysqlclient

It should return an error for a main declaration not found, if it's installed properly. This can help the netmrg dev team to see if it's an actual error in the Makefile somewhere, as I haven't downloaded this yet myself.

[quotea2f3a1bb3e="Whizzer"]Ah.. the help could be found by typing ./configure --help=recursive... Normally ./configure --help does fine...

But back to the problem Sorry, still doesn't work....

[code1a2f3a1bb3e]
# ./configure --host=sparc-sun-solaris2.8 --with-mysql-include-dir=/usr/local/mysql/include --with-mysql-lib-dir=/usr/local/mysql/lib
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for sparc-sun-solaris2.8-strip... no
checking for strip... strip
checking whether make sets $(MAKE)... (cached) yes
checking for rrdtool... /usr/local/rrdtool-1.0.40/bin/rrdtool
configure: creating ./config.status
config.status: creating Makefile
config.status: creating www/Makefile
config.status: creating bin/netmrg_cron.sh
config.status: creating etc/netmrg.conf
config.status: creating etc/netmrg.xml
config.status: creating src/include/netmrg.h
config.status: creating www/include/config.php
configure: configuring in src
configure: running /bin/ksh './configure' --prefix=/usr/local '--host=sparc-sun-solaris2.8' '--with-mysql-include-dir=/usr/local/mysql/include' '--with-mysql-lib-dir=/usr/local/mysql/lib' 'host_alias=sparc-sun-solaris2.8' --exec-prefix=/usr/local --cache-file=/dev/null --srcdir=.
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8
checking for a BSD-compatible install... ./../install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for sparc-sun-solaris2.8-strip... no
checking for strip... strip
checking for sparc-sun-solaris2.8-g++... sparc-sun-solaris2.8-g++
checking for C++ compiler default output... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether sparc-sun-solaris2.8-g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of sparc-sun-solaris2.8-g++... gcc3
checking for sparc-sun-solaris2.8-gcc... sparc-sun-solaris2.8-gcc
checking whether we are using the GNU C compiler... yes
checking whether sparc-sun-solaris2.8-gcc accepts -g... yes
checking for sparc-sun-solaris2.8-gcc option to accept ANSI C... none needed
checking dependency style of sparc-sun-solaris2.8-gcc... gcc3
checking how to run the C preprocessor... sparc-sun-solaris2.8-gcc -E
checking for a BSD-compatible install... ./../install-sh -c
checking whether to enable -Wall... no
checking for dlopen in -ldl... yes
checking for compress in -lz... yes
checking for pthread_exit in -lpthread... yes
checking for main in -lstdc++... yes
checking for mysql_init in -lmysqlclient... no
configure: error: MySQL libraries not found.
configure: error: /bin/ksh './configure' failed for src
#
#
# ls -l /usr/local/mysql/lib
total 3534
-rw-r--r-- 1 root mysql 15054 Aug 12 2002 libdbug.a
-rw-r--r-- 1 root mysql 767672 Mar 17 2001 libmygcc.a
-rw-r--r-- 1 root mysql 306282 Aug 12 2002 libmysqlclient.a
-rw-r--r-- 1 root mysql 313422 Aug 12 2002 libmysqlclient_r.a
-rw-r--r-- 1 root mysql 121444 Aug 12 2002 libmystrings.a
-rw-r--r-- 1 root mysql 223696 Aug 12 2002 libmysys.a
#
# ls -l /usr/local/mysql/include
total 718
-rw-r--r-- 1 root mysql 22185 Aug 12 2002 config-os2.h
-rw-r--r-- 1 root mysql 9394 Aug 12 2002 config-win.h
-rw-r--r-- 1 root mysql 21021 Aug 12 2002 config.h
-rw-r--r-- 1 root mysql 3445 Aug 12 2002 dbug.h
-rw-r--r-- 1 root mysql 2082 Aug 12 2002 errmsg.h
-rw-r--r-- 1 root mysql 1819 Aug 12 2002 ft_global.h
-rw-r--r-- 1 root mysql 4799 Aug 12 2002 getopt.h
-rw-r--r-- 1 root mysql 31525 Aug 12 2002 global.h
-rw-r--r-- 1 root mysql 2364 Aug 12 2002 hash.h
-rw-r--r-- 1 root mysql 5599 Aug 12 2002 heap.h
-rw-r--r-- 1 root mysql 5864 Aug 12 2002 m_ctype.h
-rw-r--r-- 1 root mysql 7594 Aug 12 2002 m_string.h
-rw-r--r-- 1 root mysql 3195 Aug 12 2002 merge.h
-rw-r--r-- 1 root mysql 2098 Aug 12 2002 my_alarm.h
-rw-r--r-- 1 root mysql 10856 Aug 12 2002 my_base.h
-rw-r--r-- 1 root mysql 1876 Aug 12 2002 my_bitmap.h
-rw-r--r-- 1 root mysql 21021 Aug 12 2002 my_config.h
-rw-r--r-- 1 root mysql 3294 Aug 12 2002 my_dir.h
-rw-r--r-- 1 root mysql 31525 Aug 12 2002 my_global.h
-rw-r--r-- 1 root mysql 1579 Aug 12 2002 my_list.h
-rw-r--r-- 1 root mysql 2696 Aug 12 2002 my_net.h
-rw-r--r-- 1 root mysql 1205 Aug 12 2002 my_no_pthread.h
-rw-r--r-- 1 root mysql 1712 Aug 12 2002 my_nosys.h
-rw-r--r-- 1 root mysql 21983 Aug 12 2002 my_pthread.h
-rw-r--r-- 1 root mysql 25751 Aug 12 2002 my_sys.h
-rw-r--r-- 1 root mysql 2479 Aug 12 2002 my_tree.h
-rw-r--r-- 1 root mysql 14025 Aug 12 2002 myisam.h
-rw-r--r-- 1 root mysql 3445 Aug 12 2002 myisammrg.h
-rw-r--r-- 1 root mysql 9292 Aug 12 2002 myisampack.h
-rw-r--r-- 1 root mysql 10787 Aug 12 2002 mysql.h
-rw-r--r-- 1 root mysql 8677 Aug 12 2002 mysql_com.h
-rw-r--r-- 1 root mysql 580 Aug 12 2002 mysql_version.h
-rw-r--r-- 1 root mysql 8188 Aug 12 2002 mysqld_error.h
-rw-r--r-- 1 root mysql 1866 Aug 12 2002 mysys_err.h
-rw-r--r-- 1 root mysql 6868 Aug 12 2002 nisam.h
-rw-r--r-- 1 root mysql 2140 Aug 12 2002 queues.h
-rw-r--r-- 1 root mysql 5869 Aug 12 2002 raid.h
-rw-r--r-- 1 root mysql 1605 Aug 12 2002 sslopt-case.h
-rw-r--r-- 1 root mysql 1296 Aug 12 2002 sslopt-longopts.h
-rw-r--r-- 1 root mysql 1239 Aug 12 2002 sslopt-usage.h
-rw-r--r-- 1 root mysql 1013 Aug 12 2002 sslopt-vars.h
-rw-r--r-- 1 root mysql 4907 Aug 12 2002 t_ctype.h
-rw-r--r-- 1 root mysql 2782 Aug 12 2002 thr_alarm.h
-rw-r--r-- 1 root mysql 3907 Aug 12 2002 thr_lock.h
-rw-r--r-- 1 root mysql 3024 Aug 12 2002 violite.h
-rw-r--r-- 1 root mysql 4132 Aug 12 2002 widec.h
#
[/code1a2f3a1bb3e]

Any other crazy ideas left???? As soon as it is running on Solaris, I'll try it on AIX 5.1... Just to let you know....[/quotea2f3a1bb3e]

Whizzer

29-07-2003 16:47:58

You mean the following

[code1fdbe8d5cbb]
# gcc -L/usr/local/mysql/lib -lmysqlclient
Undefined first referenced
symbol in file
main /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3/crt1.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
#
[/code1fdbe8d5cbb]

????

balleman

29-07-2003 22:55:14

That gcc output looks fine to me.

What version of MySQL do you have installed?

Could you check for mysql_init in your mysql.h? That's the function that our configure script is looking for.

keb

30-07-2003 00:55:19

Whizzer,

Try running the following.

[code1545b7fd6f2]nm /usr/local/mysql/lib/libmysqlclient.a | grep mysql_init[/code1545b7fd6f2]

You can also run that on libmysqlclient.so, if it's there. You should see output similar to

00003254 T mysql_init

Whizzer

30-07-2003 03:34:16

balleman

[code1e0b017030a]
# grep mysql_init /usr/local/mysql/include/mysql.h
MYSQL * STDCALL mysql_init(MYSQL *mysql);
#
[/code1e0b017030a]

keb
[code1e0b017030a]
# nm /usr/local/mysql/lib/libmysqlclient.a | grep mysql_init
0000000000002bb8 T mysql_init
#
[/code1e0b017030a]

Does that answer your question?? O... Mysql version

[code1e0b017030a]
# /usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql Ver 11.18 Distrib 3.23.52, for sun-solaris2.8 (sparc)
#
# /usr/local/mysql/bin/mysqld --version
/usr/local/mysql/bin/mysqld Ver 3.23.52 for sun-solaris2.8 on sparc
#
[/code1e0b017030a]

keb

30-07-2003 17:41:08

It looks like you have the devel files installed, but not the shared (.so) files. Try locating libmysqlclient.so on your system. If it is found, use that base directory as the mysql-lib-dir. If not found, please verify that the mysql-shared stuff is installed.

keb

06-08-2003 21:01:31

Any luck with the Solaris install? I'm really curious to know how the install issues are going, and I'm also fairly interested in the AIX install test. =)

Whizzer

07-08-2003 02:57:10

Sorry that I have been quiet the last couple of days, I have no other excuse than swimming due to the hot weather......

It seems that I don't have to .so file... The version of mysql which I have, is a binary download of www.mysql.com, to be more specific mysql-3.23.52-sun-solaris2.8-sparc.tar

And indeed, no .so file....

[code129e9a5c992]
# tar tvf mysql-3.23.52-sun-solaris2.8-sparc.tar | grep -i libmysqlclient
-rw-r--r-- 502/1003 306282 Aug 12 11:22 2002 mysql-3.23.52-sun-solaris2.8-sparc/lib/libmysqlclient.a
-rw-r--r-- 502/1003 313422 Aug 12 11:21 2002 mysql-3.23.52-sun-solaris2.8-sparc/lib/libmysqlclient_r.a
[/code129e9a5c992]

hmmmmmmmmmmmmmmmmmmmmm, does this mean it leaves me no other option that to build a newer version of mysql myself? Not that I'm afraid of it, but any other program (just compiled snort 2.0.0) works with mysql support.

keb

07-08-2003 13:54:21

Hmm...I'll see if I can run through snort source to pull out useful options for detecting and building against mysql libraries.

If you feel like compiling the newest mysql for solaris sparc, that'd be cool. At least it'll give us info on what users of Solaris may need to do in order to get NetMRG to install.

Whizzer

19-08-2003 12:36:53

Well, it's holiday season, so please don't mind my often late replies...

I'm trying to build a new version of MySQL from source, but this gives me some errors which I first have to solve... So please be patient...

keb

21-11-2003 17:40:34

Just following up to see if you've been able to get NetMRG compiled. NetMRG 0.10 has several bug fixes over previous versions, and the latest CVS snapshot includes several more fixes. If possible, please try installing the latest CVS snapshot and let us know of any problems encountered.

Unfortunately, we do not have access to a Solaris box for testing at this time, so any feedback you can provide would be greatly appreciated.

- Kevin

[quoted5bbe7d3c7="Whizzer"]I'm trying to build a new version of MySQL from source, but this gives me some errors which I first have to solve... So please be patient...[/quoted5bbe7d3c7]