Power安装linux-BIG ENDIAN mysql编译安装

一.安装系统,不选择额外的软件
mkvdev -vadapter vhost0 -vdev hdisk2 -dev db_mysql01_sys
mkvdev -vadapter vhost0 -vdev hdisk3 -dev mysql01_data01
mkvdev -vadapter vhost0 -fbo -dev cd0
******************************************************************************
The command's response was not recognized.  This may or may not indicate a proem.
******************************************************************************
# 物理机存在cd0物理设备

loadopt -vtd cd01 -disk SLES-11-SP4-DVD-ppc64-GM-DVD1.iso

unloadopt -vtd cd0
unloadopt -vtd cd1
二.第一次编译cmake、mysql-失败
2.1编译安装cmake-错误

https://cmake.org/download/

  • 1.先安装gcc-c++编译环境
mkdir /usr/local/cmake-3.4.1
ln -s /usr/local/cmake-3.4.1 /usr/local/cmake
KYL-DB-MYSQL01:/mysqlData/mysql_backup/cmake-3.4.1 # zypper install gcc-c++
正在装载安装源数据...
正在读取已安装的包...
正在解析包的依赖性...

将安装以下新包:
  gcc gcc43 gcc43-c++ gcc-c++ glibc-devel libstdc++43-devel
  linux-kernel-headers

否则报错./bootstrap: line 558: pgcc: command not found

  • 2.安装cmake
./bootstrap --prefix=/usr/local/cmake-3.4.1
gmake && make install
2.25.6mysql编译安装-失败
  • 1.建用户目录
groupadd mysql
useradd mysql -g mysql
mkdir /usr/local/mysql5.6.27
ln -s /usr/local/mysql5.6.27 /usr/local/mysql
# suse没有adduser命令
mkdir -p /usr/local/mysql/ /mysqlData/{data,tmp} /mysqlLog/logs/

vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql:/bin:/usr/local/cmake/bin
export PATH
  • 2.安装缺失的依赖包
zypper install ncurses-devel bison
  • 3.默认安装的是openssl
libopenssl0_9_8-0.9.8j-0.70.1
openssl-0.9.8j-0.70.1
  • 3.编译安装mysql
tar -zxvf mysql-5.6.27.tar.gz
cd mysql-5.6.27
cmake linux-ppc64 . 
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.6.27 
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.6.27/mysql.sock  
-DDEFAULT_CHARSET=utf8  
-DDEFAULT_COLLATION=utf8_general_ci  
-DWITH_INNOBASE_STORAGE_ENGINE=1  
-DWITH_ARCHIVE_STORAGE_ENGINE=1  
-DWITH_BLACKHOLE_STORAGE_ENGINE=1  
-DMYSQL_DATADIR=/mysqlData/data  
-DMYSQL_TCP_PORT=3306  
-DENABLE_DOWNLOADS=1  
-DWITH_EMBEDDED_SERVER=1  
-DWITH_SSL=yes  
# 报错
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
   used as include directory in directory /mysqlData/mysql_backup/mysql-5.6.27/CMakeFiles/CMakeTmp
   used as include directory in directory /mysqlData/mysql_backup/mysql-5.6.27/CMakeFiles/CMakeTmp
   used as include directory in directory /mysqlData/mysql_backup/mysql-5.6.27/CMakeFiles/CMakeTmp
# 去掉ssl后依然报错
[ 29%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/api/api0api.cc.o
In file included from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/ut0ut.h:36,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/univ.i:602,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/api/api0api.cc:27:
/mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/os0sync.h:504:4: error: #error "Unsupported platform"
In file included from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/sync0sync.h:833,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/mem0mem.h:34,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/data0data.h:33,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/que0que.h:30,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/include/api0misc.h:32,
                 from /mysqlData/mysql_backup/mysql-5.6.27/storage/innobase/api/api0api.cc:38:
# 安装at7.0编译环境
# https://blog.csdn.net/chaigang/article/details/80481588
# ftp://ftp.unicamp.br/pub/linuxpatch/toolchain/at/suse/SLES_11/at7.0/
zypper install 
advance-toolchain-at7.0-runtime-7.0-9.ppc64.rpm 
advance-toolchain-at7.0-devel-7.0-9.ppc64.rpm 
advance-toolchain-at7.0-mcore-libs-7.0-9.ppc64.rpm 
advance-toolchain-at7.0-perf-7.0-9.ppc64.rpm
# 只是加了个/opt/at7.0/bin环境变量,依然报上面的错
# 增加at的环境变量,再次报一样的错
export CMAKE_PREFIX_PATH=/opt/at7.0/
  • 4.归根结底,cmake的问题,不能使用普通的gcc编译
2.2.重新编译安装cmake、mysql-成功
  • 1.命令
rm -rf /usr/local/cmake
cd cmake-3.4.1
./bootstrap --prefix=/usr/local/cmake-3.4.1
gmake && make install
ln -s /usr/local/cmake-3.4.1 /usr/local/cmake
  • 2.过程
# rm -rf /usr/local/cmake
# vi /etcprofile
export CMAKE_PREFIX_PATH=/opt/at7.0/
PATH=$PATH:/opt/at7.0/bin:/opt/at7.0/sbin:/usr/local/cmake/bin
# ./bootstrap --prefix=/usr/local/cmake-3.4.1
---------------------------------------------
CMake 3.4.1, Copyright 2000-2015 Kitware, Inc.
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: gmake
g++ is GNU compiler
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has struct stat with st_mtim member
---------------------------------------------
gmake: “cmake”是最新的。
loading initial cache file /mysqlData/mysql_backup/cmake-3.4.1/Bootstrap.cmk/InitialCacheFlags.cmake
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /opt/at7.0/bin/gcc
-- Check for working C compiler: /opt/at7.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/at7.0/bin/g++
-- Check for working CXX compiler: /opt/at7.0/bin/g++ -- works
# 编译的时候中间有很多failed,但不影响
-- Performing Test curl_cv_func_send_test
-- Performing Test curl_cv_func_send_test - Failed
-- Tested: int send(SOCKET, const char *, int, int)
-- Performing Test curl_cv_func_send_test
-- Performing Test curl_cv_func_send_test - Failed
-- Tested: int send(SOCKET, const char *, int, unsigned int)
#
-- Looking for a Fortran compiler - /opt/at7.0/bin/gfortran
-- Performing Test run_pic_test
-- Performing Test run_pic_test - Success
-- Performing Test run_inlines_hidden_test
-- Performing Test run_inlines_hidden_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /mysqlData/mysql_backup/cmake-3.4.1
---------------------------------------------
CMake has bootstrapped.  Now run gmake.
# 已经可以顺利完成编译
# 开始构建gmake
gmake
[  0%] Building C object Utilities/KWIML/test/CMakeFiles/cmIML_test.dir/test.c.o
[  0%] Building C object Utilities/KWIML/test/CMakeFiles/cmIML_test.dir/test_ABI_C.c.o
[  0%] Building C object Utilities/KWIML/test/CMakeFiles/cmIML_test.dir/test_INT_C.c.o
# 顺利结束
[ 99%] Built target pseudo_emulator
[100%] Building C object Tests/RunCMake/CMakeFiles/pseudo_iwyu.dir/pseudo_iwyu.c.o
[100%] Linking C executable pseudo_iwyu
[100%] Built target pseudo_iwyu
[100%] Building CXX object Tests/FindPackageModeMakefileTest/CMakeFiles/foo.dir/foo.cpp.o
[100%] Linking CXX static library libfoo.a
[100%] Built target foo
# 安装make install
-- Installing: /usr/local/cmake-3.4.1/share/aclocal/cmake.m4
-- Installing: /usr/local/cmake-3.4.1/share/cmake-3.4/completions/cmake
-- Installing: /usr/local/cmake-3.4.1/share/cmake-3.4/completions/cpack
-- Installing: /usr/local/cmake-3.4.1/share/cmake-3.4/completions/ctest
  • 3.编译mysql(没有使用ssl)
cmake linux-ppc64 . 
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.6.27 
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.6.27/mysql.sock  
-DDEFAULT_CHARSET=utf8  
-DDEFAULT_COLLATION=utf8_general_ci  
-DWITH_INNOBASE_STORAGE_ENGINE=1  
-DWITH_ARCHIVE_STORAGE_ENGINE=1  
-DWITH_BLACKHOLE_STORAGE_ENGINE=1  
-DMYSQL_DATADIR=/mysqlData/data  
-DMYSQL_TCP_PORT=3306  
-DENABLE_DOWNLOADS=1  
-DWITH_EMBEDDED_SERVER=1
make && make install
ln -s /usr/local/mysql5.6.27 /usr/local/mysql
  • 3.编译安装mysql过程日志
cmake linux-ppc64 . 
> -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.6.27 
> -DMYSQL_UNIX_ADDR=/usr/local/mysql5.6.27/mysql.sock  
> -DDEFAULT_CHARSET=utf8  
> -DDEFAULT_COLLATION=utf8_general_ci  
> -DWITH_INNOBASE_STORAGE_ENGINE=1  
> -DWITH_ARCHIVE_STORAGE_ENGINE=1  
> -DWITH_BLACKHOLE_STORAGE_ENGINE=1  
> -DMYSQL_DATADIR=/mysqlData/data  
> -DMYSQL_TCP_PORT=3306  
> -DENABLE_DOWNLOADS=1
-- Running cmake version 3.4.1
-- Could NOT find Git (missing:  GIT_EXECUTABLE)
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /opt/at7.0/bin/cc
-- Check for working C compiler: /opt/at7.0/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/at7.0/bin/c++
-- Check for working CXX compiler: /opt/at7.0/bin/c++ -- works
# make
[100%] Linking CXX executable mysql_embedded
[100%] Built target mysql_embedded
Scanning dependencies of target mysqltest_embedded
[100%] Building CXX object libmysqld/examples/CMakeFiles/mysqltest_embedded.dir/__/__/client/mysqltest.cc.o
[100%] Linking CXX executable mysqltest_embedded
[100%] Built target mysqltest_embedded
Scanning dependencies of target my_safe_process
[100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
[100%] Linking CXX executable my_safe_process
[100%] Built target my_safe_process
# make install
三.增加ssl再来编译一次mysql
  • 1.需要删除缓存
rm CMakeCache.txt
cmake linux-ppc64 . 
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.6.27 
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.6.27/mysql.sock  
-DDEFAULT_CHARSET=utf8  
-DDEFAULT_COLLATION=utf8_general_ci  
-DWITH_INNOBASE_STORAGE_ENGINE=1  
-DWITH_ARCHIVE_STORAGE_ENGINE=1  
-DWITH_BLACKHOLE_STORAGE_ENGINE=1  
-DMYSQL_DATADIR=/mysqlData/data  
-DMYSQL_TCP_PORT=3306  
-DENABLE_DOWNLOADS=1  
-DWITH_EMBEDDED_SERVER=1  
-DWITH_SSL=yes
  • 2.已经用到ssl库文件
-- OPENSSL_INCLUDE_DIR = /opt/at7.0/include
-- OPENSSL_LIBRARY = /opt/at7.0/lib64/libssl.so
-- CRYPTO_LIBRARY = /opt/at7.0/lib64/libcrypto.so
-- OPENSSL_MAJOR_VERSION = 1
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - found
-- SSL_LIBRARIES = /opt/at7.0/lib64/libssl.so;/opt/at7.0/lib64/libcrypto.so;dl
四.纯净系统再来一次
  • 1.安装依赖包
zypper install bison libaio-devel ncurses-devel tack
zypper install advance-toolchain-at7.0-runtime-7.0-9.ppc64.rpm advance-toolchain-at7.0-mcore-libs-7.0-9.ppc64.rpm advance-toolchain-at7.0-devel-7.0-9.ppc64.rpm advance-toolchain-at7.0-perf-7.0-9.ppc64.rpm
  • 2.创建路径和修改环境变量
groupadd mysql
useradd mysql -g mysql
mkdir /usr/local/mysql5.6.27
mkdir /usr/local/cmake-3.4.1
ln -s /usr/local/mysql5.6.27 /usr/local/mysql
ln -s /usr/local/cmake-3.4.1 /usr/local/cmake
mkdir -p /usr/local/mysql/ /mysqlData/{data,tmp} /mysqlLog/logs/
cat << EOF >> /etc/profile
export CMAKE_PREFIX_PATH=/opt/at7.0/
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/cmake/bin:/opt/at7.0/bin:/opt/at7.0/sbin
export PATH
EOF
source /etc/profile
  • 3.编译安装cmake
./bootstrap --prefix=/usr/local/cmake-3.4.1
gmake && make
  • 4.编译安装mysql
cmake linux-ppc64 . 
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.6.27 
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.6.27/mysql.sock  
-DDEFAULT_CHARSET=utf8  
-DDEFAULT_COLLATION=utf8_general_ci  
-DWITH_INNOBASE_STORAGE_ENGINE=1  
-DWITH_ARCHIVE_STORAGE_ENGINE=1  
-DWITH_BLACKHOLE_STORAGE_ENGINE=1  
-DMYSQL_DATADIR=/mysqlData/data  
-DMYSQL_TCP_PORT=3306  
-DENABLE_DOWNLOADS=1  
-DWITH_EMBEDDED_SERVER=1  
-DWITH_SSL=yes
make && make install

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power+Systems/page/AIX+and+Open+Source+-+old

https://www.ibm.com/developerworks/aix/library/aix-toolbox/alpha.html