专业阿里编译

请参考:alisql编译

写在前面

适用环境:mac os x(unix), linux 等 2016年阿里的云栖大会上,开源了alisql,称双11就是alisql的成功案例。而且还说vs mysql 5.7 ,性能有70%的提升。 不管真的假的,我都有写按捺不住了,所以就跌跌撞撞有了这编译安装的点点经验,在此分享。 声明,我使用的机器是mac os x.

下载alisql源码

alisql源码地址:https://github.com/alibaba/AliSQL
得到解压目录,结构如下:

meigangdeMacBook-Pro:envs meigang$ cd AliSQL-master/
meigangdeMacBook-Pro:AliSQL-master meigang$ ls
BUILD			cmake_install.cmake	mysys_ssl
CMakeCache.txt		cmd-line-utils		packaging
CMakeFiles		config.h.cmake		plugin
CMakeLists.txt		configure		regex
COPYING			configure.cmake		scripts
CPackConfig.cmake	dbug			source_downloads
CPackSourceConfig.cmake	extra			sql
CTestTestfile.cmake	include			sql-bench
Docs			info_macros.cmake	sql-common
Doxyfile-perfschema	install_manifest.txt	storage
INSTALL			libevent		strings
Makefile		libmysql		support-files
README			libmysqld		tests
README.md		libservices		unittest
VERSION			make_dist.cmake		vio
VERSION.dep		man			win
client			mysql-test		zlib
cmake			mysys

开始编译安装

首先如果你的机器环境不完整,可能在编译的时候会有问题,届时可以根据提示信息百度得到答案,切记。
(因为各自机器的环境都不可能完全一致,这也是为什么在Linux/unix的世界里有编译安装这一说,编译安装的程序一定是最适合自己机器的。)
编译时需要用到cmake(多数编译安装都需要),我机器上使用的是:

meigangdeMacBook-Pro:AliSQL-master meigang$ cmake -version
cmake version 3.0.2

然后开始执行编译步骤:

(1).执行 BUILD/autorun.sh 该操作会在alisql home目录生成configure的文件。

(2).执行 ./configure or ./configure --prefix=/home/xxx,

带上--prefix参数是指定安装的目的路径,不指定的话,默认是/usr/local/mysql

该操作用来生成给cmake使用的cmakelist.txt文件

meigangdeMacBook-Pro:AliSQL-master meigang$ ./configure
configure.pl : calling cmake /Users/meigang/envs/AliSQL-master 
-- Running cmake version 3.0.2
-- Found Git: /usr/bin/git (found version "2.7.4 (Apple Git-66)") 
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
getconf: no such configuration parameter `LEVEL1_DCACHE_LINESIZE'
-- MySQL 5.6.32
-- Packaging as: mysql-5.6.32-osx10.11-x86_64
-- Performing Test HAVE_LLVM_LIBCPP
-- Performing Test HAVE_LLVM_LIBCPP - Success
-- Looking for floor
-- Looking for floor - found
-- Looking for __infinity
-- Looking for __infinity - not found
-- Looking for __infinity in m
-- Looking for __infinity in m - not found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - not found
-- Looking for gethostbyname_r in nsl_r
-- Looking for gethostbyname_r in nsl_r - not found
-- Looking for gethostbyname_r in nsl
-- Looking for gethostbyname_r in nsl - not found
-- Looking for bind
-- Looking for bind - found
-- Looking for crypt
-- Looking for crypt - found
-- Looking for setsockopt
-- Looking for setsockopt - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for clock_gettime
-- Looking for clock_gettime - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Looking for include file alloca.h
-- Looking for include file alloca.h - found
-- Looking for include file aio.h
-- Looking for include file aio.h - found
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - found
-- Looking for include file crypt.h
-- Looking for include file crypt.h - not found
-- Looking for include file cxxabi.h
-- Looking for include file cxxabi.h - not found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
-- Looking for include file execinfo.h
-- Looking for include file execinfo.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file fenv.h
-- Looking for include file fenv.h - found
-- Looking for include file float.h
-- Looking for include file float.h - found
-- Looking for include file floatingpoint.h
-- Looking for include file floatingpoint.h - not found
-- Looking for include file fpu_control.h
-- Looking for include file fpu_control.h - not found
-- Looking for include file grp.h
-- Looking for include file grp.h - found
-- Looking for include file ieeefp.h
-- Looking for include file ieeefp.h - not found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include file langinfo.h
-- Looking for include file langinfo.h - found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for include file locale.h
-- Looking for include file locale.h - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - not found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file ndir.h
-- Looking for include file ndir.h - not found
-- Looking for include file netinet/in.h
-- Looking for include file netinet/in.h - found
-- Looking for include file paths.h
-- Looking for include file paths.h - found
-- Looking for include file port.h
-- Looking for include file port.h - not found
-- Looking for include file poll.h
-- Looking for include file poll.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file select.h
-- Looking for include file select.h - not found
-- Looking for include file semaphore.h
-- Looking for include file semaphore.h - found
-- Looking for include files sys/types.h, sys/dir.h
-- Looking for include files sys/types.h, sys/dir.h - found
-- Looking for include file sys/ndir.h
-- Looking for include file sys/ndir.h - not found
-- Looking for include file sys/pte.h
-- Looking for include file sys/pte.h - not found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file synch.h
-- Looking for include file synch.h - not found
-- Looking for include file sysent.h
-- Looking for include file sysent.h - not found
-- Looking for include file sys/cdefs.h
-- Looking for include file sys/cdefs.h - found
-- Looking for include file sys/file.h
-- Looking for include file sys/file.h - found
-- Looking for include file sys/fpu.h
-- Looking for include file sys/fpu.h - not found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file sys/ipc.h
-- Looking for include file sys/ipc.h - found
-- Looking for include file sys/malloc.h
-- Looking for include file sys/malloc.h - found
-- Looking for include file sys/mman.h
-- Looking for include file sys/mman.h - found
-- Looking for include file sys/prctl.h
-- Looking for include file sys/prctl.h - not found
-- Looking for include file sys/resource.h
-- Looking for include file sys/resource.h - found
-- Looking for include file sys/select.h
-- Looking for include file sys/select.h - found
-- Looking for include file sys/shm.h
-- Looking for include file sys/shm.h - found
-- Looking for include file sys/socket.h
-- Looking for include file sys/socket.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/stream.h
-- Looking for include file sys/stream.h - not found
-- Looking for include file sys/termcap.h
-- Looking for include file sys/termcap.h - not found
-- Looking for include files time.h, sys/timeb.h
-- Looking for include files time.h, sys/timeb.h - found
-- Looking for include files curses.h, term.h
-- Looking for include files curses.h, term.h - found
-- Looking for include file asm/termbits.h
-- Looking for include file asm/termbits.h - not found
-- Looking for include file termbits.h
-- Looking for include file termbits.h - not found
-- Looking for include file termios.h
-- Looking for include file termios.h - found
-- Looking for include file termio.h
-- Looking for include file termio.h - not found
-- Looking for include file termcap.h
-- Looking for include file termcap.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file utime.h
-- Looking for include file utime.h - found
-- Looking for include file varargs.h
-- Looking for include file varargs.h - not found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/utime.h
-- Looking for include file sys/utime.h - not found
-- Looking for include file sys/wait.h
-- Looking for include file sys/wait.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/vadvise.h
-- Looking for include file sys/vadvise.h - found
-- Looking for include file fnmatch.h
-- Looking for include file fnmatch.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Looking for include files stdlib.h, sys/un.h
-- Looking for include files stdlib.h, sys/un.h - found
-- Looking for include file vis.h
-- Looking for include file vis.h - found
-- Looking for include file wchar.h
-- Looking for include file wchar.h - found
-- Looking for include file wctype.h
-- Looking for include file wctype.h - found
-- Looking for include file sasl/sasl.h
-- Looking for include file sasl/sasl.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file signal.h
-- Looking for include file signal.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - not found
-- Looking for include file sys/event.h
-- Looking for include file sys/event.h - found
-- Looking for include file sys/queue.h
-- Looking for include file sys/queue.h - found
-- Looking for TAILQ_FOREACH
-- Looking for TAILQ_FOREACH - found
-- Looking for include file sys/ptem.h
-- Looking for include file sys/ptem.h - not found
-- Performing Test HAVE_WERROR_FLAG
-- Performing Test HAVE_WERROR_FLAG - Success
-- Performing Test HAVE_PTHREAD_ONCE_INIT
-- Performing Test HAVE_PTHREAD_ONCE_INIT - Success
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for _aligned_free
-- Looking for _aligned_free - not found
-- Looking for aio_read
-- Looking for aio_read - found
-- Looking for alarm
-- Looking for alarm - found
-- Looking for backtrace
-- Looking for backtrace - found
-- Looking for backtrace_symbols
-- Looking for backtrace_symbols - found
-- Looking for backtrace_symbols_fd
-- Looking for backtrace_symbols_fd - found
-- Looking for printstack
-- Looking for printstack - not found
-- Looking for bmove
-- Looking for bmove - not found
-- Looking for bsearch
-- Looking for bsearch - found
-- Looking for index
-- Looking for index - found
-- Looking for clock_gettime
-- Looking for clock_gettime - not found
-- Looking for cuserid
-- Looking for cuserid - not found
-- Looking for directio
-- Looking for directio - not found
-- Looking for _doprnt
-- Looking for _doprnt - not found
-- Looking for flockfile
-- Looking for flockfile - found
-- Looking for ftruncate
-- Looking for ftruncate - found
-- Looking for getline
-- Looking for getline - found
-- Looking for compress
-- Looking for compress - not found
-- Looking for crypt
-- Looking for crypt - found
-- Looking for dlerror
-- Looking for dlerror - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for fchmod
-- Looking for fchmod - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for fconvert
-- Looking for fconvert - not found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for fdatasync
-- Looking for fdatasync - not found
-- Looking for fedisableexcept
-- Looking for fedisableexcept - not found
-- Looking for fpsetmask
-- Looking for fpsetmask - not found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for getcwd
-- Looking for getcwd - found
-- Looking for gethostbyaddr_r
-- Looking for gethostbyaddr_r - not found
-- Looking for gethrtime
-- Looking for gethrtime - not found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for getpass
-- Looking for getpass - found
-- Looking for getpassphrase
-- Looking for getpassphrase - not found
-- Looking for getpwnam
-- Looking for getpwnam - found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for getwd
-- Looking for getwd - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for initgroups
-- Looking for initgroups - found
-- Looking for issetugid
-- Looking for issetugid - found
-- Looking for getuid
-- Looking for getuid - found
-- Looking for geteuid
-- Looking for geteuid - found
-- Looking for getgid
-- Looking for getgid - found
-- Looking for getegid
-- Looking for getegid - found
-- Looking for ldiv
-- Looking for ldiv - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for longjmp
-- Looking for longjmp - found
-- Looking for lstat
-- Looking for lstat - found
-- Looking for madvise
-- Looking for madvise - found
-- Looking for malloc_info
-- Looking for malloc_info - not found
-- Looking for memcpy
-- Looking for memcpy - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for mlock
-- Looking for mlock - found
-- Looking for mlockall
-- Looking for mlockall - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for mmap64
-- Looking for mmap64 - not found
-- Looking for perror
-- Looking for perror - found
-- Looking for poll
-- Looking for poll - found
-- Looking for port_create
-- Looking for port_create - not found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - not found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for pread
-- Looking for pread - found
-- Looking for pthread_attr_create
-- Looking for pthread_attr_create - not found
-- Looking for pthread_attr_getguardsize
-- Looking for pthread_attr_getguardsize - found
-- Looking for pthread_attr_getstacksize
-- Looking for pthread_attr_getstacksize - found
-- Looking for pthread_attr_setscope
-- Looking for pthread_attr_setscope - found
-- Looking for pthread_attr_setstacksize
-- Looking for pthread_attr_setstacksize - found
-- Looking for pthread_condattr_create
-- Looking for pthread_condattr_create - not found
-- Looking for pthread_condattr_setclock
-- Looking for pthread_condattr_setclock - not found
-- Looking for pthread_key_delete
-- Looking for pthread_key_delete - found
-- Looking for pthread_rwlock_rdlock
-- Looking for pthread_rwlock_rdlock - found
-- Looking for pthread_sigmask
-- Looking for pthread_sigmask - found
-- Looking for pthread_threadmask
-- Looking for pthread_threadmask - not found
-- Looking for pthread_yield_np
-- Looking for pthread_yield_np - found
-- Looking for putenv
-- Looking for putenv - found
-- Looking for readdir_r
-- Looking for readdir_r - found
-- Looking for readlink
-- Looking for readlink - found
-- Looking for re_comp
-- Looking for re_comp - not found
-- Looking for regcomp
-- Looking for regcomp - found
-- Looking for realpath
-- Looking for realpath - found
-- Looking for rename
-- Looking for rename - found
-- Looking for rwlock_init
-- Looking for rwlock_init - not found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for setfd
-- Looking for setfd - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for sigthreadmask
-- Looking for sigthreadmask - not found
-- Looking for sigwait
-- Looking for sigwait - found
-- Looking for sigaddset
-- Looking for sigaddset - found
-- Looking for sigemptyset
-- Looking for sigemptyset - found
-- Looking for sighold
-- Looking for sighold - found
-- Looking for sigset
-- Looking for sigset - found
-- Looking for sleep
-- Looking for sleep - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for stpcpy
-- Looking for stpcpy - found
-- Looking for strcoll
-- Looking for strcoll - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for strlcat
-- Looking for strlcat - found
-- Looking for strsignal
-- Looking for strsignal - found
-- Looking for fgetln
-- Looking for fgetln - found
-- Looking for strpbrk
-- Looking for strpbrk - found
-- Looking for strsep
-- Looking for strsep - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoul
-- Looking for strtoul - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for shmctl
-- Looking for shmctl - found
-- Looking for shmdt
-- Looking for shmdt - found
-- Looking for shmget
-- Looking for shmget - found
-- Looking for tell
-- Looking for tell - not found
-- Looking for tempnam
-- Looking for tempnam - found
-- Looking for thr_setconcurrency
-- Looking for thr_setconcurrency - not found
-- Looking for thr_yield
-- Looking for thr_yield - not found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for vprintf
-- Looking for vprintf - found
-- Looking for valloc
-- Looking for valloc - found
-- Looking for memalign
-- Looking for memalign - not found
-- Looking for chown
-- Looking for chown - found
-- Looking for nl_langinfo
-- Looking for nl_langinfo - found
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for clock_gettime
-- Looking for clock_gettime - not found
-- Looking for epoll_create
-- Looking for epoll_create - not found
-- Looking for epoll_ctl
-- Looking for epoll_ctl - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for kqueue
-- Looking for kqueue - found
-- Looking for kqueue
-- Looking for kqueue - found
-- Looking for signal
-- Looking for signal - found
-- Looking for timeradd
-- Looking for timeradd - found
-- Looking for timerclear
-- Looking for timerclear - found
-- Looking for timercmp
-- Looking for timercmp - found
-- Looking for timerisset
-- Looking for timerisset - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file sys/times.h
-- Looking for include file sys/times.h - found
-- Looking for include file asm/msr.h
-- Looking for include file asm/msr.h - not found
-- Looking for include file ia64intrin.h
-- Looking for include file ia64intrin.h - not found
-- Looking for times
-- Looking for times - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for read_real_time
-- Looking for read_real_time - not found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for time
-- Looking for time - found
-- Looking for rdtscll
-- Looking for rdtscll - not found
-- Looking for madvise
-- Looking for madvise - found
-- Looking for tzname
-- Looking for tzname - found
-- Looking for lrand48
-- Looking for lrand48 - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for TIOCGWINSZ
-- Looking for TIOCGWINSZ - found
-- Looking for FIONREAD
-- Looking for FIONREAD - found
-- Looking for TIOCSTAT
-- Looking for TIOCSTAT - found
-- Looking for FIONREAD
-- Looking for FIONREAD - found
-- Looking for finite
-- Looking for finite - found
-- Looking for log2
-- Looking for log2 - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for rint
-- Looking for rint - found
-- Performing Test HAVE_ISINF
-- Performing Test HAVE_ISINF - Success
-- Performing Test HAVE_FESETROUND
-- Performing Test HAVE_FESETROUND - Success
-- Check size of sigset_t
-- Check size of sigset_t - done
-- Check size of mode_t
-- Check size of mode_t - done
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long long
-- Check size of long long - done
-- Check size of off_t
-- Check size of off_t - done
-- Check size of uchar
-- Check size of uchar - failed
-- Check size of uint
-- Check size of uint - done
-- Check size of ulong
-- Check size of ulong - failed
-- Check size of int8
-- Check size of int8 - failed
-- Check size of uint8
-- Check size of uint8 - failed
-- Check size of int16
-- Check size of int16 - failed
-- Check size of uint16
-- Check size of uint16 - failed
-- Check size of int32
-- Check size of int32 - failed
-- Check size of uint32
-- Check size of uint32 - failed
-- Check size of u_int32_t
-- Check size of u_int32_t - done
-- Check size of int64
-- Check size of int64 - failed
-- Check size of uint64
-- Check size of uint64 - failed
-- Check size of time_t
-- Check size of time_t - done
-- Check size of struct timespec
-- Check size of struct timespec - done
-- Check size of bool
-- Check size of bool - failed
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- Performing Test HAVE_GETADDRINFO
-- Performing Test HAVE_GETADDRINFO - Success
-- Performing Test HAVE_SELECT
-- Performing Test HAVE_SELECT - Success
-- Performing Test HAVE_TIMESPEC_TS_SEC
-- Performing Test HAVE_TIMESPEC_TS_SEC - Failed
-- Performing Test QSORT_TYPE_IS_VOID
-- Performing Test QSORT_TYPE_IS_VOID - Success
-- Performing Test HAVE_SOCKET_SIZE_T_AS_socklen_t
-- Performing Test HAVE_SOCKET_SIZE_T_AS_socklen_t - Success
-- Performing Test HAVE_PTHREAD_YIELD_ZERO_ARG
-- Performing Test HAVE_PTHREAD_YIELD_ZERO_ARG - Failed
-- Checking stack direction : -1
-- Performing Test SIGNAL_RETURN_TYPE_IS_VOID
-- Performing Test SIGNAL_RETURN_TYPE_IS_VOID - Success
-- Looking for include files time.h, sys/time.h
-- Looking for include files time.h, sys/time.h - found
-- Looking for O_NONBLOCK
-- Looking for O_NONBLOCK - found
-- Performing Test C_HAS_inline
-- Performing Test C_HAS_inline - Success
-- Performing Test HAVE_PAUSE_INSTRUCTION
-- Performing Test HAVE_PAUSE_INSTRUCTION - Success
-- Looking for tcgetattr
-- Looking for tcgetattr - found
-- Performing Test HAVE_POSIX_SIGNALS
-- Performing Test HAVE_POSIX_SIGNALS - Success
-- Performing Test HAVE_BSS_START
-- Performing Test HAVE_BSS_START - Failed
-- Performing Test HAVE_WEAK_SYMBOL
-- Performing Test HAVE_WEAK_SYMBOL - Success
-- Performing Test HAVE_SOLARIS_STYLE_GETHOST
-- Performing Test HAVE_SOLARIS_STYLE_GETHOST - Failed
-- Performing Test HAVE_GCC_ATOMIC_BUILTINS
-- Performing Test HAVE_GCC_ATOMIC_BUILTINS - Success
-- Looking for netinet/in6.h
-- Looking for netinet/in6.h - not found
-- Check size of struct sockaddr_in6
-- Check size of struct sockaddr_in6 - done
-- Check size of struct in6_addr
-- Check size of struct in6_addr - done
-- Performing Test HAVE_SOCKADDR_STORAGE_SS_FAMILY
-- Performing Test HAVE_SOCKADDR_STORAGE_SS_FAMILY - Success
-- Performing Test HAVE_SOCKADDR_IN_SIN_LEN
-- Performing Test HAVE_SOCKADDR_IN_SIN_LEN - Success
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_LEN
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_LEN - Success
-- Performing Test STRUCT_DIRENT_HAS_D_INO
-- Performing Test STRUCT_DIRENT_HAS_D_INO - Success
-- Performing Test STRUCT_DIRENT_HAS_D_NAMLEN
-- Performing Test STRUCT_DIRENT_HAS_D_NAMLEN - Success
-- Looking for include file numaif.h
-- Looking for include file numaif.h - not found
-- Check size of mbstate_t
-- Check size of mbstate_t - done
-- Performing Test HAVE_LANGINFO_CODESET
-- Performing Test HAVE_LANGINFO_CODESET - Success
-- Looking for mbrlen
-- Looking for mbrlen - found
-- Looking for mbscmp
-- Looking for mbscmp - not found
-- Looking for mbsrtowcs
-- Looking for mbsrtowcs - found
-- Looking for wcrtomb
-- Looking for wcrtomb - found
-- Looking for mbrtowc
-- Looking for mbrtowc - found
-- Looking for wcscoll
-- Looking for wcscoll - found
-- Looking for wcsdup
-- Looking for wcsdup - found
-- Looking for wcwidth
-- Looking for wcwidth - found
-- Looking for wctype
-- Looking for wctype - found
-- Looking for iswlower
-- Looking for iswlower - found
-- Looking for iswupper
-- Looking for iswupper - found
-- Looking for towlower
-- Looking for towlower - found
-- Looking for towupper
-- Looking for towupper - found
-- Looking for iswctype
-- Looking for iswctype - found
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Check size of wctype_t
-- Check size of wctype_t - done
-- Check size of wint_t
-- Check size of wint_t - done
-- Found Curses: /usr/lib/libcurses.dylib  
-- Performing Test HAVE_DECL_TGOTO
-- Performing Test HAVE_DECL_TGOTO - Success
-- Looking for strvis
-- Looking for strvis - found
-- Looking for strunvis
-- Looking for strunvis - found
-- Looking for malloc_stats_print in jemalloc
-- Looking for malloc_stats_print in jemalloc - not found
-- Performing Test HAVE_WVLA
-- Performing Test HAVE_WVLA - Success
-- Looking for sched_getcpu
-- Looking for sched_getcpu - not found
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS - Success
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE - Success
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_64
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_64 - Success
-- Performing Test HAVE_IB_GCC_SYNC_SYNCHRONISE
-- Performing Test HAVE_IB_GCC_SYNC_SYNCHRONISE - Success
-- Performing Test HAVE_IB_GCC_ATOMIC_THREAD_FENCE
-- Performing Test HAVE_IB_GCC_ATOMIC_THREAD_FENCE - Success
-- Performing Test HAVE_IB_GCC_ATOMIC_TEST_AND_SET
-- Performing Test HAVE_IB_GCC_ATOMIC_TEST_AND_SET - Success
-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC
-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC - Success
-- Looking for asprintf
-- Looking for asprintf - found
-- Check size of pthread_t
-- Check size of pthread_t - done
-- Using cmake version 3.0.2
-- Not building NDB
-- Performing Test HAVE_PEERCRED
-- Performing Test HAVE_PEERCRED - Failed
-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: HAVE_CONFIG_H;GTEST_USE_OWN_TR1_TUPLE=1
-- CMAKE_C_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -Wno-null-conversion -Wno-unused-private-field
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/meigang/envs/AliSQL-master

(3).执行 sudo cmake 编译

因为我之前编译过一次,如下所示的编译输出就很快了。但是第一次是比较慢的,请耐心等待。

meigangdeMacBook-Pro:AliSQL-master meigang$ sudo make
Password:
Scanning dependencies of target INFO_BIN
[  0%] Built target INFO_BIN
Scanning dependencies of target INFO_SRC
[  0%] Built target INFO_SRC
Scanning dependencies of target jemalloc
[  0%] Built target jemalloc
[  2%] Built target zlib
[  3%] Built target yassl
[  5%] Built target taocrypt
[  8%] Built target edit
[ 12%] Built target strings
Scanning dependencies of target gen_dtrace_header
[ 12%] Built target gen_dtrace_header
[ 20%] Built target mysys
[ 20%] Built target dbug
[ 21%] Built target mysys_ssl
[ 21%] Built target comp_err
[ 21%] Built target GenError
[ 21%] Built target archive
[ 21%] Built target blackhole
[ 21%] Built target csv
[ 21%] Built target federated
[ 24%] Built target heap
[ 26%] Built target heap_embedded
[ 26%] Built target hp_test1
[ 26%] Built target hp_test2
[ 36%] Built target innobase
[ 40%] Built target myisam
[ 45%] Built target myisam_embedded
[ 45%] Built target myisam_ftdump
[ 45%] Built target myisamchk
[ 45%] Built target myisamlog
[ 45%] Built target myisampack
[ 47%] Built target myisammrg
[ 49%] Built target myisammrg_embedded
[ 56%] Built target perfschema
[ 56%] Built target mytap
[ 56%] Built target pfs_server_stubs
[ 56%] Built target pfs-t
[ 56%] Built target pfs_account-oom-t
[ 56%] Built target gen_lex_hash
[ 56%] Built target GenServerSource
[ 57%] Built target slave
[ 57%] Built target gen_lex_token
[ 57%] Built target GenDigestServerSource
[ 57%] Built target partition
[ 57%] Built target vio
[ 57%] Built target regex
[ 70%] Built target sql
[ 70%] Built target rpl
[ 71%] Built target binlog
[ 71%] Built target master
[ 72%] Built target pfs_connect_attr-t
[ 72%] Built target pfs_host-oom-t
[ 72%] Built target pfs_instr-oom-t
[ 72%] Built target pfs_instr-t
[ 72%] Built target pfs_instr_class-oom-t
[ 72%] Built target pfs_instr_class-t
[ 72%] Built target pfs_misc-t
[ 72%] Built target pfs_user-oom-t
[ 72%] Built target mysqld
[ 72%] Built target mysqlservices
[ 72%] Built target audit_null
[ 72%] Built target auth
[ 72%] Built target auth_test_plugin
[ 72%] Built target mysql_no_login
[ 72%] Built target qa_auth_client
[ 72%] Built target qa_auth_interface
[ 72%] Built target qa_auth_server
[ 72%] Built target daemon_example
[ 72%] Built target ftexample
[ 72%] Built target validate_password
[ 72%] Built target semisync_master
[ 72%] Built target semisync_slave
[ 72%] Built target test_udf_services
[ 72%] Built target re
[ 72%] Built target base64_test
[ 73%] Built target queues
[ 73%] Built target thr_lock
[ 74%] Built target clientlib
[ 74%] Built target libmysql
[ 74%] Built target mysqlclient
[ 74%] Built target symlink_libmysqlclient_r.18.dylib
[ 74%] Built target symlink_libmysqlclient_r.a
[ 74%] Built target symlink_libmysqlclient_r.dylib
[ 74%] Built target no_plan-t
[ 74%] Built target simple-t
[ 74%] Built target skip-t
[ 75%] Built target skip_all-t
[ 76%] Built target todo-t
[ 77%] Built target basic-t
[ 78%] Built target innochecksum
[ 79%] Built target my_print_defaults
[ 79%] Built target mysql_waitpid
[ 79%] Built target perror
[ 79%] Built target replace
[ 79%] Built target resolve_stack_dump
[ 80%] Built target resolveip
[ 81%] Built target mysql
[ 81%] Built target mysql_config_editor
[ 81%] Built target mysql_plugin
[ 81%] Built target comp_sql
[ 81%] Built target GenFixPrivs
[ 81%] Built target mysql_upgrade
[ 81%] Built target mysqladmin
[ 81%] Built target mysqlbinlog
[ 81%] Built target mysqlcheck
[ 81%] Built target mysqldump
[ 82%] Built target mysqlimport
[ 82%] Built target mysqlshow
[ 82%] Built target mysqlslap
[ 83%] Built target mysqltest
[ 83%] Built target bug25714
[ 83%] Built target mysql_client_test
[ 84%] Built target mysql_tzinfo_to_sql
[ 84%] Built target partition_embedded
[ 84%] Built target sqlgunitlib
[ 84%] Built target udf_example
[100%] Built target sql_embedded
[100%] Built target mysqlserver
[100%] Built target mysql_client_test_embedded
[100%] Built target mysql_embedded
[100%] Built target mysqltest_embedded
[100%] Built target my_safe_process

(4).执行 sudo cmake install 安装 我这里安装过了,就不贴日志了。

对alisql的启动前的设置

其实类似于mysql的编译安装,说实际的alisql vs mysql就是一个优化分支,主要体现在加了很多引擎, 而要测试alisql的性能,也应该建立在使用alisql提供的引擎来对比mysql的引擎了。

(1)cd /usr/local/mysql也就是自己的安装目录下

(2)copy一份alisql的my.cnf 修改成自己的,我这里帖出一份根据alisql github上wiki里的my-small.cnf改的配置文件。 放到/etc/my.cnf下。

参考 : my.cnf

(3)执行 scripts/mysql_install_db 这里不指定安装参数,会读取/etc/my.cnf配置的datadir等MySQL变量。

(4)安装完后,在/usr/local/mysql/data下就有了mysql,test,xx的默认mysql数据库,这个时候说明安装成功。

启动alisql

在alisql的安装根路径下,默认是/usr/local/mysql,执行命令:

support-files/mysql.server start  来启动。

meigangdeMacBook-Pro:mysql meigang$ sudo support-files/mysql.server start
Starting MySQL
... SUCCESS! 

登陆进入:

meigangdeMacBook-Pro:mysql meigang$ mysql -P3030 -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.6.32-log Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@localhost : (none) 15:23:11> status;
--------------
mysql  Ver 14.14 Distrib 5.6.32, for osx10.11 (x86_64) using  EditLine wrapper

Connection id:		48
Current database:	
Current user:		root@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server version:		5.6.32-log Source distribution
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8
Db     characterset:	utf8
Client characterset:	utf8
Conn.  characterset:	utf8
UNIX socket:		/tmp/mysql.sock
Uptime:			6 min 37 sec

Threads: 1  Questions: 102  Slow queries: 0  Opens: 70  Flush tables: 1  Open tables: 63  Queries per second avg: 0.256
--------------

root@localhost : (none) 15:23:14> 

关于遇到启动报错:ERROR! The server quit without updating PID file (/usr/local/mysql/data/meigangdeMacBook-Pro.local.pid).

请参考文章:http://www.th7.cn/db/mysql/201507/114009.shtml

特此分享,文中有错误之处,请指出,仅供参考。