postgresql上安装sysbench-0.5

环境
centos 6.8
pg9.6
sysbench-0.5
[postgres@node2]$ tar -xvf sysbench-0.5.tar.gz
[postgres@node2 sysbench-0.5]$ ll
total 100
-rw-r--r--. 1 postgres postgres  3074 Oct 19  2012 autogen.sh
-rw-r--r--. 1 postgres postgres  7585 Oct 19  2012 ChangeLog
drwxr-xr-x. 2 postgres postgres  4096 Jun  8  2013 config
-rw-r--r--. 1 postgres postgres 11022 Oct 19  2012 configure.ac
-rw-r--r--. 1 postgres postgres 17992 Oct 19  2012 COPYING
drwxr-xr-x. 3 postgres postgres  4096 Jun  8  2013 doc
-rw-r--r--. 1 postgres postgres  7122 Oct 19  2012 install-sh
drwxr-xr-x. 2 postgres postgres  4096 Jun  8  2013 m4
-rw-r--r--. 1 postgres postgres   840 Oct 19  2012 Makefile.am
-rw-r--r--. 1 postgres postgres 10266 Oct 19  2012 missing
-rw-r--r--. 1 postgres postgres  1988 Oct 19  2012 mkinstalldirs
-rw-r--r--. 1 postgres postgres  3044 Oct 19  2012 README
-rw-r--r--. 1 postgres postgres   953 Oct 19  2012 README-WIN.txt
drwxr-xr-x. 5 postgres postgres  4096 Jun  8  2013 sysbench
-rw-r--r--. 1 postgres postgres    26 Oct 19  2012 TODO
[postgres@node2 sysbench-0.5]$ sh autogen.sh 
automake 1.10.x (aclocal) wasn't found, exiting
解决方法 安装automake依赖包
[root@node2 ~]# yum install automake
[postgres@node2 sysbench-0.5]$ sh autogen.sh 
libtoolize 1.4+ wasn't found, exiting
解决方法  安装libtool依赖包
[root@node2 ~]# yum install libtool
[postgres@node2 sysbench-0.5]$ sh autogen.sh 
autogen.sh: running `aclocal -I m4' 
autogen.sh: running `libtoolize --copy --force' 
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autogen.sh: running `autoheader' 
autogen.sh: running `automake -c --foreign --add-missing' 
configure.ac:23: installing `config/compile'
configure.ac:11: installing `config/config.guess'
configure.ac:11: installing `config/config.sub'
configure.ac:16: installing `config/install-sh'
configure.ac:16: installing `config/missing'
sysbench/Makefile.am: installing `config/depcomp'
autogen.sh: running `autoconf' 
Libtoolized with: libtoolize (GNU libtool) 2.2.6b
Automade with: automake (GNU automake) 1.11.1
Configured with: autoconf (GNU Autoconf) 2.63
[postgres@node2 sysbench-0.5]$ ll
total 996
-rw-rw-r--. 1 postgres postgres 317842 Apr 11 07:36 aclocal.m4
-rw-r--r--. 1 postgres postgres   3074 Oct 19  2012 autogen.sh
drwxr-xr-x. 2 postgres postgres   4096 Apr 11 07:36 autom4te.cache
-rw-r--r--. 1 postgres postgres   7585 Oct 19  2012 ChangeLog
drwxr-xr-x. 2 postgres postgres   4096 Apr 11 07:36 config
-rwxrwxr-x. 1 postgres postgres 567878 Apr 11 07:36 configure
-rw-r--r--. 1 postgres postgres  11022 Oct 19  2012 configure.ac
-rw-r--r--. 1 postgres postgres  17992 Oct 19  2012 COPYING
drwxr-xr-x. 3 postgres postgres   4096 Apr 11 07:36 doc
-rw-r--r--. 1 postgres postgres   7122 Oct 19  2012 install-sh
drwxr-xr-x. 2 postgres postgres   4096 Apr 11 07:36 m4
-rw-r--r--. 1 postgres postgres    840 Oct 19  2012 Makefile.am
-rw-rw-r--. 1 postgres postgres  24419 Apr 11 07:36 Makefile.in
-rw-r--r--. 1 postgres postgres  10266 Oct 19  2012 missing
-rw-r--r--. 1 postgres postgres   1988 Oct 19  2012 mkinstalldirs
-rw-r--r--. 1 postgres postgres   3044 Oct 19  2012 README
-rw-r--r--. 1 postgres postgres    953 Oct 19  2012 README-WIN.txt
drwxr-xr-x. 5 postgres postgres   4096 Apr 11 07:36 sysbench
-rw-r--r--. 1 postgres postgres     26 Oct 19  2012 TODO
[postgres@node2 sysbench-0.5]$ ./configure  --without-mysql --with-pgsql 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether gcc and cc understand -c and -o together... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether __SUNPRO_C is declared... no
checking "C Compiler version"... "gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)"
checking whether to compile with MySQL support... (cached) no
checking whether to compile with Drizzle support... (cached) yes
checking whether to compile with Oracle support... (cached) no
checking whether to compile with PostgreSQL support... (cached) yes
checking whether to compile with Lua support... (cached) yes
checking whether SHM_HUGETLB is declared... yes
checking whether O_SYNC is declared... yes
checking for xsltproc... xsltproc
checking whether xsltproc works... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for sqrt in -lm... yes
checking for ld used by GCC... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for libdrizzle... no
checking for pg_config... /opt/postgresdb//bin/pg_config
checking PostgreSQL C flags... -I/opt/postgresdb/include
checking PostgreSQL linker flags... -L/opt/postgresdb/lib -lpq
checking libaio.h usability... no
checking libaio.h presence... no
checking for libaio.h... no
checking for malloc in -lumem... no
checking for malloc in -lmtmalloc... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/aio.h usability... no
checking sys/aio.h presence... no
checking for sys/aio.h... no
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking thread.h usability... no
checking thread.h presence... no
checking for thread.h... no
checking for unistd.h... (cached) yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of size_t... 8
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking whether clock_gettime is declared... yes
checking for library containing clock_gettime... -lrt
checking for alarm... yes
checking for directio... no
checking for fdatasync... yes
checking for gettimeofday... yes
checking for lrand48... yes
checking for memalign... yes
checking for memset... yes
checking for mkstemp... yes
checking for popen... yes
checking for posix_memalign... yes
checking for pthread_yield... yes
checking for _setjmp... yes
checking for setvbuf... yes
checking for sqrt... yes
checking for strdup... yes
checking for thr_setconcurrency... no
checking for valloc... yes
checking for pthread_once... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/xsl/Makefile
config.status: creating doc/xsl/catalog.xml
config.status: creating doc/Makefile
config.status: creating sysbench/Makefile
config.status: creating sysbench/drivers/Makefile
config.status: creating sysbench/drivers/mysql/Makefile
config.status: creating sysbench/drivers/drizzle/Makefile
config.status: creating sysbench/drivers/oracle/Makefile
config.status: creating sysbench/drivers/pgsql/Makefile
config.status: creating sysbench/tests/Makefile
config.status: creating sysbench/tests/cpu/Makefile
config.status: creating sysbench/tests/fileio/Makefile
config.status: creating sysbench/tests/memory/Makefile
config.status: creating sysbench/tests/threads/Makefile
config.status: creating sysbench/tests/mutex/Makefile
config.status: creating sysbench/tests/db/Makefile
config.status: creating sysbench/scripting/Makefile
config.status: creating sysbench/scripting/lua/Makefile
config.status: creating sysbench/scripting/lua/src/Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[postgres@node2 sysbench-0.5]$ make
Making all in doc
make[1]: Entering directory `/tmp/sysbench-0.5/doc'
Making all in xsl
make[2]: Entering directory `/tmp/sysbench-0.5/doc/xsl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/sysbench-0.5/doc/xsl'
make[2]: Entering directory `/tmp/sysbench-0.5/doc'
touch manual.html
make[2]: Leaving directory `/tmp/sysbench-0.5/doc'
make[1]: Leaving directory `/tmp/sysbench-0.5/doc'
Making all in sysbench
make[1]: Entering directory `/tmp/sysbench-0.5/sysbench'
Making all in drivers
make[2]: Entering directory `/tmp/sysbench-0.5/sysbench/drivers'
Making all in pgsql
make[3]: Entering directory `/tmp/sysbench-0.5/sysbench/drivers/pgsql'
gcc -DHAVE_CONFIG_H -I. -I../../../config  -I/opt/postgresdb/include -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3  -MT libsbpgsql_a-drv_pgsql.o -MD -MP -MF .deps/libsbpgsql_a-drv_pgsql.Tpo -c -o libsbpgsql_a-drv_pgsql.o `test -f 'drv_pgsql.c' || echo './'`drv_pgsql.c
drv_pgsql.c:95: warning: excess elements in struct initializer
drv_pgsql.c:95: warning: (near initialization for ‘pgsql_drv_caps’)
drv_pgsql.c: In function ‘pgsql_drv_describe’:
drv_pgsql.c:202: error: ‘table_name’ undeclared (first use in this function)
drv_pgsql.c:202: error: (Each undeclared identifier is reported only once
drv_pgsql.c:202: error: for each function it appears in.)
make[3]: *** [libsbpgsql_a-drv_pgsql.o] Error 1
make[3]: Leaving directory `/tmp/sysbench-0.5/sysbench/drivers/pgsql'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/sysbench-0.5/sysbench/drivers'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/sysbench-0.5/sysbench'
make: *** [all-recursive] Error 1
解决方式:
[postgres@node2 pgsql]$ pwd
/tmp/sysbench-0.5/sysbench/drivers/pgsql
[postgres@node2 pgsql]$ vi drv_pgsql.c
注释掉: /* (void)table_name; /* unused */这行
int pgsql_drv_describe(drv_caps_t *caps)
{
  PGconn *con;
 /* (void)table_name; /* unused */

  *caps = pgsql_drv_caps;

  /* Determine the server version */

执行make clean / ./configure / make /make install ,安装成功!

在centos7上在sh autogen.sh时会出现错误Can't execute automake  
[postgres@node2 sysbench-0.5]# vi configure.ac  
添加一行 AM_PROG_AR  
 
 
AC_PROG_CC  
  
AM_PROG_AR  
  
AC_PROG_CPP  

configure  报错:  
configure: error: *** pthread_once() is not available on this platform ***  
注释掉使用到的地方:  
    285 #AC_CHECK_FUNC(pthread_once, ,  
    286 #              AC_MSG_ERROR([*** pthread_once() is not available on this platform ***])  
    287 #)  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值