Home » Bugs, Debian, Featured, How-to, Linux, Shell

Compiling sysbench 0.4.12 for Debian

9 July 2009 19 Comments

On the Linux market are a lot of distributions and every distribution is unique in his way. Is normal to have different compilers and tools from distribution to distribution so is almost normal to have programs what doesn’t compile on all distributions. sysbench 0.4.12 is one of them.

Anyway the solution is simple and I will describe it very quickly how to compile sysbench under Debian. Probably it will work for other distributions if you have the same problem.

Let’s start with the error. I run the normal steps to compile the programs as described in README:

[rb@randombugs]$ ./configure --with-mysql-libs=/usr/local/mysql/lib/ --with-mysql-includes=/usr/local/mysql/include/
[rb@randombugs]$ make

and I get this error

[... some lines removed ...]
/bin/sh ../libtool --tag=CC   --mode=link gcc -pthread -g -O2      -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/usr/local/mysql/lib/ -lmysqlclient_r   -lrt -lm                                                                                                         
../libtool: line 838: X--tag=CC: command not found                                                                    
../libtool: line 871: libtool: ignoring unknown tag : command not found                                               
../libtool: line 838: X--mode=link: command not found                                                                 
../libtool: line 1004: *** Warning: inferring the mode of operation is deprecated.: command not found                 
../libtool: line 1005: *** Future versions of Libtool will require --mode=MODE be specified.: command not found       
../libtool: line 2231: X-g: command not found                                                                         
../libtool: line 2231: X-O2: command not found                                                                        
../libtool: line 1951: X-L/usr/local/mysql/lib/: No such file or directory                                            
../libtool: line 2400: Xsysbench: command not found                                                                   
../libtool: line 2405: X: command not found                                                                           
../libtool: line 2412: Xsysbench: command not found                                                                   
../libtool: line 2420: mkdir /.libs: No such file or directory                                                        
../libtool: line 2547: X-lmysqlclient_r: command not found                                                            
../libtool: line 2547: X-lrt: command not found                                                                       
../libtool: line 2547: X-lm: command not found                                                                        
../libtool: line 2629: X-L/root/sysbench-0.4.12/sysbench: No such file or directory                                   
../libtool: line 2547: X-lmysqlclient_r: command not found                                                            
../libtool: line 2547: X-lrt: command not found                                                                       
../libtool: line 2547: X-lm: command not found                                                                        
../libtool: line 2629: X-L/root/sysbench-0.4.12/sysbench: No such file or directory                                   
../libtool: line 2547: X-lmysqlclient_r: command not found                                                            
../libtool: line 2547: X-lrt: command not found                                                                       
../libtool: line 2547: X-lm: command not found                                                                        
../libtool: line 5162: Xgcc -pthread "" "" -o @OUTPUT@ sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o  tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/root/sysbench-0.4.12/sysbench -lmysqlclient_r -lrt -lm: No such file or directory                                                                                              
../libtool: line 5163: Xgcc -pthread "" "" -o @OUTPUT@ sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o  tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/root/sysbench-0.4.12/sysbench -lmysqlclient_r -lrt -lm: No such file or directory                                                                                              
../libtool: line 5168: X: command not found                                                                           
../libtool: line 5172: : command not found

Seeing a libtool error I started to recreate all automake utilities with autogen

[rb@randombugs]$ ./autogen.sh

Running autogen it (what is running autoconf) I get the following error:

./autogen.sh                                                                                  
sysbench/drivers/mysql/Makefile.am:17: library used but `RANLIB' is undefined                                         
sysbench/drivers/mysql/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                  
sysbench/drivers/mysql/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                  
sysbench/drivers/oracle/Makefile.am:17: library used but `RANLIB' is undefined                                        
sysbench/drivers/oracle/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                 
sysbench/drivers/oracle/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                 
sysbench/drivers/pgsql/Makefile.am:17: library used but `RANLIB' is undefined                                         
sysbench/drivers/pgsql/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                  
sysbench/drivers/pgsql/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                  
sysbench/tests/cpu/Makefile.am:17: library used but `RANLIB' is undefined                                             
sysbench/tests/cpu/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                      
sysbench/tests/cpu/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                      
sysbench/tests/fileio/Makefile.am:17: library used but `RANLIB' is undefined                                          
sysbench/tests/fileio/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                   
sysbench/tests/fileio/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                   
sysbench/tests/memory/Makefile.am:17: library used but `RANLIB' is undefined                                          
sysbench/tests/memory/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                   
sysbench/tests/memory/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                   
sysbench/tests/mutex/Makefile.am:17: library used but `RANLIB' is undefined                                           
sysbench/tests/mutex/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                    
sysbench/tests/mutex/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                    
sysbench/tests/oltp/Makefile.am:17: library used but `RANLIB' is undefined                                            
sysbench/tests/oltp/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                     
sysbench/tests/oltp/Makefile.am:17:   to `configure.ac' and run `autoconf' again.                                     
sysbench/tests/threads/Makefile.am:17: library used but `RANLIB' is undefined                                         
sysbench/tests/threads/Makefile.am:17:   The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'                  
sysbench/tests/threads/Makefile.am:17:   to `configure.ac' and run `autoconf' again.

The error is explicit enough so all what I made I just opened configure.ac and I add AC_PROG_RANLIB where I found the rest of AC_PROG* variables. After that I just run autogen.sh again, but this time I get another error.

configure.ac:75: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

Seeing this variable in configure.ca I just comment the variable and re run autogen.sh. This time all works flawlessly. After this I run

./configure && make && make install

with success.

In short. Edit configure.ca:

#AC_PROG_LIBTOOL
AC_PROG_RANLIB

and re-run

./autogen.sh

and your are ready to

./configure && make && make install

Good Luck !


19 Comments »

  • Matthew said:

    Rock on! Allowed me to compile sysbench 0.4.12 for RHEL5.4!

  • posidev said:

    Your solution worked for me and I managed to run sysbench on Ubuntu 9.04 ! Thanks for the info!
    Greetings,
    posidev

  • Running Sysbench 0.4.12 on Ubuntu 9.04 said:

    […] to the tip from  randombugs.com I managed to compile it properly.Here what you have to do in […]

  • Gk said:

    Great, thanks so much.

  • rkemendi said:

    Hi,

    Thanks for the ‘workaround’ , worked like a charm.(centos 5.2 x86_64 && sysbench 0.4.12).

  • Richard said:

    This also helped me with opensuse 11.2. While the error from autogen.sh did not happen to me, the solution was the same to the other error for anyone searching for an answer to this problem.

  • admin (author) said:

    I’m glad to see the fix is working on so many distributions! In the end all are GNU/Linux :)

    Regards

  • stybla said:

    Hello,

    thanks. It helped although, as in Richard’s case, % ./autogen.sh; has returned nothing.

    One thing though. There is a typo: “In short. Edit configure.ca” should read: ‘configure.ac’.

  • Brian said:

    Solution also works on:
    Red Hat Enterprise Linux Server release 5.5 (Tikanga)
    Red Hat Enterprise Linux ES release 4 (Nahant Update 8)

  • Sarah said:

    Thanks! Worked perfectly (once I installed automake too).

  • Vineet said:

    Thanks a lot for your help.

  • 解决ubuntu9.10下sysbench-0.4.12安装失败问题 -- DoMySQL -- 学习和分享MySQL技术! said:

    […] 1.如果这篇文章中说的可以解决,就提前恭喜你了 2.如果上述还不能解决,可以试试下面的方法 报错主要是2.2.6版本libtool引起的,删除sysbench-0.4.12目录下的libtool,然后,做个软连接ln -s /usr/bin/libtool,再进入make 和make install. […]

  • anki said:

    Thanks a lot! This post helped me compile sysbench on my ubuntu!!

  • Markus said:

    Thanks for this step by step guide. Had to tweak a few things but I got it working on my Red Hat Enterprise Linux Server 5.6. So thanks.

  • ren said:

    Thanks………….

  • Sysbench | IT World said:

    […] There is an interesting post at, with the solution: Compiling sysbench 0.4.12 for Debian. […]

  • Vovan said:

    Awesome, thanks man!

    You saved my time :)

  • SomeGuy said:

    Thanks for this post! Also fixed the issue on RedHat 5.8.

  • Terry said:

    Yeah, Solution also works on:
    CentOS 6.3

    Thanks a lot man:)

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.