哎,就硬盘还不是最掉价的,1999的自配主机,VIRTUALBOX里虚拟机,聊以自慰吧。...

本文介绍了Sysbench 0.4.12版本在编译过程中遇到的libtool版本过旧问题及解决方案,并针对运行时找不到MySQL共享库文件的问题提供了设置环境变量的方法。

安装时注意的问题,要是不测试MYSQL,则CONFIGURE参数和DISABLE-MYSQL,在编译时有提示的。

然后就是LIBTOOL包过老的问题,以及未安装LIBTOOL包的问题。

最后,是运行命令时的参数问题。

~~~~~~~~~~~~~

安装sysbench0.4.12,在执行make命名中,出现了如下的报错:

Bash代码 复制代码  收藏代码
  1. /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/mysql/lib -lmysqlclient_r -lpthread -lz -lm -lrt -ldl   -lrt -laio -lm    
  2. ../libtool: line 838: X--tag=CC: command not found   
  3. ../libtool: line 871: libtool: ignoring unknown tag : command not found   
  4. ../libtool: line 838: X--mode=link: command not found   
  5. ../libtool: line 1004: *** Warning: inferring the mode of operation is deprecated.: command not found   
  6. ../libtool: line 1005: *** Future versions of Libtool will require --mode=MODE be specified.: command not found   
  7. ../libtool: line 2231: X-g: command not found   
  8. ../libtool: line 2231: X-O2: command not found   
  9. ../libtool: line 1951: X-L/u01/mysql/lib: No such file or directory   
  10. ../libtool: line 2400: Xsysbench: command not found  
/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/mysql/lib -lmysqlclient_r -lpthread -lz -lm -lrt -ldl   -lrt -laio -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/u01/mysql/lib: No such file or directory
../libtool: line 2400: Xsysbench: command not found



这个错误的原因是sysbench源代码中自带的libtool版本太旧了,可以使用系统的libtool替代之,在sysbench的源代码根目录下执行如下的命令即可:

Bash代码 复制代码  收藏代码
  1. cp /usr/bin/libtool libtool  
cp /usr/bin/libtool libtool



第二个问题是安装完sysbench之后执行时报错:

Bash代码 复制代码  收藏代码
  1. ./sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory  
./sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory



这说明sysbench无法找到mysql的库文件,这很可能是环境变量LD_LIBRARY_PATH没有设置,设置后即可解决该问题:

Bash代码 复制代码  收藏代码
  1. export LD_LIBRARY_PATH=/usr/mysql/lib  
export LD_LIBRARY_PATH=/usr/mysql/lib



转载于:https://www.cnblogs.com/aguncn/p/3589575.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值