当前位置: 移动技术网 > IT编程>数据库>Mysql > 使用git bash编译安装sysbench时遇到的坑

使用git bash编译安装sysbench时遇到的坑

2018年09月12日  | 移动技术网IT编程  | 我要评论
 
preface
 
    when i was compiling the sysbench just now,i encountered some failures in the precedure.i'll show the issue and workaround below.
 
issues
 
1. executing autogen.sh script turned out to be error.
[root@docker1 sysbench]# ./autogen.sh
-bash: ./autogen.sh: /bin/sh^m: bad interpreter: no such file or directory
[root@docker1 sysbench]# cat autogen.sh 
#!/bin/sh
 
autoreconf -vi
 
even i directly run "autoreconf -vi" command,it still showed error
 
[root@docker1 sysbench]# autoreconf -vi
autoreconf: entering directory `.'
autoreconf: configure.ac: not using gettext
autoreconf: running: aclocal -i m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
.ibtoolize: ac_config_macro_dir([m4]) conflicts with aclocal_amflags=-i m4
autoreconf: libtoolize failed with exit status: 1
 
then,i found a workaround:
 
because i've used "git clone" to download the source package of sysbench directly without disabling the transcoding first.
 
after that,the shell could be executed,but when i continue to execute configure and make,there were still some errors found.
 
2. executing make turned out to be error.
[root@docker1 sysbench]# ./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib && make && make install
...
in file included from lj_ffrecord.c:1197:0:
lj_recdef.h:225:1: error: ?.ecff_rawlen?.undeclared here (not in a function)
 recff_rawlen,
 ^
make[3]: *** [lj_ffrecord.o] error 1
make[3]: leaving directory `/opt/mysql/sysbench/third_party/luajit/tmp/luajit/src'
make[2]: *** [src/luajit] error 2
make[2]: leaving directory `/opt/mysql/sysbench/third_party/luajit/tmp/luajit'
make[1]: *** [lib/libluajit-5.1.a] error 2
make[1]: leaving directory `/opt/mysql/sysbench/third_party/luajit'
make: *** [all-recursive] error 1
 
[root@docker1 luajit]# pwd
/opt/mysql/sysbench/third_party/luajit
[root@docker1 luajit]# find . -type f -print0 | xargs -0 dos2unix
 
then,the luajit issue was okay.
 
==== successfully installed luajit 2.1.0-beta3 to /opt/mysql/sysbench/third_party/luajit ====
 
note: the development releases deliberately do not install a symlink for luajit
you can do this now by running this command (with sudo):
 
  ln -sf luajit-2.1.0-beta3 /opt/mysql/sysbench/third_party/luajit/bin/luajit
 
make[2]: warning: clock skew detected. your build may be incomplete.
make[2]: leaving directory `/opt/mysql/sysbench/third_party/luajit/tmp/luajit'
make[1]: warning: clock skew detected. your build may be incomplete.
make[1]: leaving directory `/opt/mysql/sysbench/third_party/luajit'
making all in third_party/concurrency_kit
make[1]: entering directory `/opt/mysql/sysbench/third_party/concurrency_kit'
make[1]: warning: file `makefile' has modification time 143 s in the future
rm -rf tmp
mkdir tmp
tar -c . -cf - ck | tar -xf - -c tmp/
chmod -r u+w tmp
cd tmp/ck && \
cc="gcc -std=gnu99" \
cflags="-o3 -funroll-loops -ggdb3 -march=core2 -d_gnu_source " \
ldflags="-l/usr/local/lib" \
  ./configure \
  --prefix=/opt/mysql/sysbench/third_party/concurrency_kit && \
make && \
make install
/bin/sh: ./configure: /bin/sh^m: bad interpreter: no such file or directory
make[1]: *** [lib/libck.a] error 126
make[1]: leaving directory `/opt/mysql/sysbench/third_party/concurrency_kit'
make: *** [all-recursive] error 1
 
then,i used dos2unix to transcode all the files in "/opt/mysql/sysbench/third_party" and it began to go on.but i was not be happy for long.errors appeared one by one,faint!
 
lua/internal/sysbench.histogram.lua.h:137:3: warning: missing terminating " character [enabled by default]
lua/internal/sysbench.histogram.lua.h:137:1: error: missing terminating " character
make[2]: *** [sb_lua.o] error 1
make[2]: leaving directory `/opt/mysql/sysbench/src'
make[1]: *** [all-recursive] error 1
make[1]: leaving directory `/opt/mysql/sysbench/src'
make: *** [all-recursive] error 1
 
this time i decided to transcode the whole files in "/opt/mysql/sysbench/src",but it turned out to be useless.okay,then i gave up for continuing seeking the way to find it out.i downloaded the sysbench package again and disable transcoding automatically method by executing command below:
 
git config --global core.autocrlf false
git config --global core.safecrlf true
git config --global core.eol lf
 
another make error shew up.
 
making all in lua
make[2]: entering directory `/opt/mysql/sysbench/src/lua'
make[2]: warning: file `makefile' has modification time 479 s in the future
making all in internal
make[3]: entering directory `/opt/mysql/sysbench/src/lua/internal'
make[3]: warning: file `makefile' has modification time 479 s in the future
make all-am
make[4]: entering directory `/opt/mysql/sysbench/src/lua/internal'
make[4]: warning: file `makefile' has modification time 478 s in the future
make[4]: nothing to be done for `all-am'.
make[4]: warning: clock skew detected. your build may be incomplete.
make[4]: leaving directory `/opt/mysql/sysbench/src/lua/internal'
make[3]: warning: clock skew detected. your build may be incomplete.
make[3]: leaving directory `/opt/mysql/sysbench/src/lua/internal'
make[3]: entering directory `/opt/mysql/sysbench/src/lua'
make[3]: warning: file `makefile' has modification time 478 s in the future
make[3]: nothing to be done for `all-am'.
make[3]: warning: clock skew detected. your build may be incomplete.
make[3]: leaving directory `/opt/mysql/sysbench/src/lua'
make[2]: warning: clock skew detected. your build may be incomplete.
make[2]: leaving directory `/opt/mysql/sysbench/src/lua'
making all in .
make[2]: entering directory `/opt/mysql/sysbench/src'
make[2]: warning: file `.deps/sysbench.po' has modification time 536 s in the future
make[2]: nothing to be done for `all-am'.
make[2]: warning: clock skew detected. your build may be incomplete.
make[2]: leaving directory `/opt/mysql/sysbench/src'
make[1]: warning: clock skew detected. your build may be incomplete.
make[1]: leaving directory `/opt/mysql/sysbench/src'
making all in tests
make[1]: entering directory `/opt/mysql/sysbench/tests'
make[1]: warning: file `makefile' has modification time 478 s in the future
make[1]: nothing to be done for `all'.
make[1]: warning: clock skew detected. your build may be incomplete.
make[1]: leaving directory `/opt/mysql/sysbench/tests'
make[1]: entering directory `/opt/mysql/sysbench'
make[1]: warning: file `makefile' has modification time 478 s in the future
make[1]: nothing to be done for `all-am'.
make[1]: warning: clock skew detected. your build may be incomplete.
make[1]: leaving directory `/opt/mysql/sysbench'
make: warning: clock skew detected. your build may be incomplete.
 
there's a solution here:
 
but i waited for the count down over and then make it again.it was done successfully in the end.
 
[root@docker1 third_party]# sysbench -v
sysbench 1.1.0-431660d (using bundled luajit 2.1.0-beta3)
 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网