Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Power ppc64le support on 2024-1-8 #3

Merged
merged 6 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions rpm/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,26 @@ if [ ${NEED_BUILD_COMPILER} = 1 ]; then
bash obdevtools-gcc9-build.sh
fi

if [ "${OS_ARCH}x" = "ppc64lex" ]; then
##backup local spec file first
if ! grep 11.1.0 obdevtools-llvm.spec |grep -i version > /dev/null
then
scp obdevtools-llvm.spec obdevtools-llvm.11.0.1.spec
scp obdevtools-llvm.11.1.0.spec obdevtools-llvm.spec
fi
bash obdevtools-llvm-build-11.1.0.sh

bash devdeps-zlib-shared-build.sh

##backup local spec file first
if ! grep 1.1.1u devdeps-openssl-static.spec |grep -i version > /dev/null
then
scp devdeps-openssl-static.spec devdeps-openssl-static.1.0.1e.spec
scp devdeps-openssl-static.1.1.1u.spec devdeps-openssl-static.spec
fi
bash devdeps-openssl-static-build.1.1.1u.sh

bash devdeps-rocksdb-build-with-system-gcc.sh
fi


5 changes: 3 additions & 2 deletions rpm/devdeps-cos-c-sdk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ make install

#step 5: install minixml
cd ../mxml-3.3
./configure --prefix=/usr/local/
CFLAG="-O2" \
./configure --prefix=/usr/local
make
make install

Expand All @@ -86,4 +87,4 @@ cp -r %{_tmp_product}/usr/local/* $RPM_BUILD_ROOT/%{_prefix}

%changelog
* Mon Jul 3 2023 oceanbase
- add spec of cos-c-sdk
- add spec of cos-c-sdk
5 changes: 4 additions & 1 deletion rpm/devdeps-icu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ make install
# install files
cp -r ${tmp_install_dir}/lib/*.a $RPM_BUILD_ROOT/%{_prefix}/lib
cp -r ${tmp_install_dir}/include/* $RPM_BUILD_ROOT/%{_prefix}/include/%{_product_prefix}
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/include/%{_product_prefix}/i18n/unicode
cp ../icu4c/source/i18n/unicode/*.h $RPM_BUILD_ROOT/%{_prefix}/include/%{_product_prefix}/i18n/unicode/


# package infomation
%files
Expand All @@ -64,4 +67,4 @@ cp -r ${tmp_install_dir}/include/* $RPM_BUILD_ROOT/%{_prefix}/include/%{_product

%changelog
* Wed Nov 23 2022 xuhao.yf
- version 69.1
- version 69.1
8 changes: 7 additions & 1 deletion rpm/devdeps-isa-l-static.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ ISA-L is a collection of optimized low-level functions targeting storage applica

%build

BUILD_OPTION=''
OS_ARCH="$(uname -m)"
if [ "${OS_ARCH}x" = "ppc64lex" ]; then
BUILD_OPTION='--build=ppc64le'
fi

rm -rf %{_tmppath}
mkdir -p %{_tmppath}
cd $OLDPWD/../
rm -rf %{_src}
tar -xf %{_src}.tar.gz
cd %{_src}
./autogen.sh
./configure --enable-static --with-pic=yes --disable-shared --prefix=%{_tmppath}
./configure ${BUILD_OPTION} --enable-static --with-pic=yes --disable-shared --prefix=%{_tmppath}
CPU_CORES=`grep -c ^processor /proc/cpuinfo`
make -j${CPU_CORES};
make install
Expand Down
2 changes: 2 additions & 0 deletions rpm/devdeps-libcurl-static.spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if [ "${OS_ARCH}x" = "sw_64x" ]; then
BUILD_OPTION='--build=sw_64-unknown-linux-gnu'
elif [ "${OS_ARCH}x" = "aarch64x" ]; then
BUILD_OPTION='--build=aarch64-unknown-linux-gnu'
elif [ "${OS_ARCH}x" = "ppc64lex" ]; then
BUILD_OPTION='--build=ppc64le'
fi

./configure --prefix=%{_tmppath} --without-libssh2 --without-nss --disable-ftp --disable-ldap --disable-ldaps --without-cyassl \
Expand Down
1 change: 1 addition & 0 deletions rpm/devdeps-mariadb-connector-c.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mkdir -p %{_tmppath}
cd $OLDPWD/../
rm -rf %{_src}
tar -xf %{_src}.tar.gz
sed -i 's/END()/ENDIF()/g' mariadb-connector-c-3.1.12/cmake/ConnectorName.cmake
cd %{_src}
mkdir -p build-rpm;
cd build-rpm
Expand Down
17 changes: 17 additions & 0 deletions rpm/devdeps-openssl-static-build.1.1.1u.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"devdeps-openssl-static"}
VERSION=${3:-"1.1.1u"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/openssl-$VERSION.*[tar|gz|bz2|xz|zip]$"` ]]; then
echo "Download source code"
wget --no-check-certificate https://ftp.openssl.org/source/old/1.1.1/openssl-1.1.1u.tar.gz -P $ROOT_DIR
fi

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
62 changes: 62 additions & 0 deletions rpm/devdeps-openssl-static.1.1.1u.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Name: devdeps-openssl-static
Version: 1.1.1u
Release: %(echo $RELEASE)%{?dist}

Summary: OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols.
Url: https://www.openssl.org/
Group: oceanbase-devel/dependencies
License: OpenSSL
AutoReqProv:no

%undefine _missing_build_ids_terminate_build
%define _build_id_links compat

# disable check-buildroot
%define __arch_install_post %{nil}

%define _prefix /usr/local/oceanbase/deps/devel
%define _src openssl-%{version}

%define debug_package %{nil}
%define __strip /bin/true

%define _buliddir %{_topdir}/BUILD
%define _tmppath %{_buliddir}/_tmp

%description
OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols.
It is also a general-purpose cryptography library. For more information about the team and community around the project, or to start making your own contributions,
start with the community page. To get the latest news, download the source, and so on, please see the sidebar or the buttons at the top of every page.

%build

# incompat with openssl config. unset it here
unset RELEASE
rm -rf %{_tmppath}
mkdir -p %{_tmppath}
cd $OLDPWD/../
rm -rf %{_src}
tar -xf %{_src}.tar.gz
cd %{_src}
#make dclean
./config --prefix=%{_prefix} -fPIC no-shared --openssldir=%{_prefix}
make depend
make all
make install_sw

%install

mkdir -p $RPM_BUILD_ROOT/%{_prefix}
cp -r %{_prefix}/lib %{_prefix}/include $RPM_BUILD_ROOT/%{_prefix}

%files

%defattr(-,root,root)
%{_prefix}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
* Fri Mar 26 2021 oceanbase
- add spec of cmake
32 changes: 32 additions & 0 deletions rpm/devdeps-rocksdb-build-with-system-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"devdeps-rocksdb"}
VERSION=${3:-"6.22.1"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/rocksdb-$VERSION.*[tar|gz|bz2|xz|zip]$"` ]]; then
for cnt in {1..6}
do
echo "Download source code with retry cnt = "$cnt
wget --no-check-certificate https://mirror.ghproxy.com/https://github.com/facebook/rocksdb/archive/refs/tags/v6.22.1.tar.gz -O $ROOT_DIR/rocksdb-$VERSION.tar.gz
if [[ $? == 0 ]];then
break
fi
done
fi

# prepare building environment
# please prepare environment yourself if the following solution does not work for you.
OS_RELEASE=$(grep -Po '(?<=release )\d' /etc/redhat-release)

echo "Use obdevtools-gcc9 may raise such ld.lld: error: expected a 'ld' for got-indirect to toc-relative relaxing"
echo "So build with gcc-toolset-11 gcc on ppc64le"

source /opt/rh/gcc-toolset-11/enable

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
17 changes: 17 additions & 0 deletions rpm/devdeps-zlib-shared-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"devdeps-zlib-shared"}
VERSION=${3:-"1.2.7"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/curl-$VERSION.*[tar|gz|bz2|xz|zip]$"` ]]; then
echo "Download source code"
wget --no-check-certificate https://codeload.github.com/madler/zlib/tar.gz/refs/tags/v1.2.7 -O zlib-1.2.7.tar.gz -P $ROOT_DIR
fi

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
62 changes: 62 additions & 0 deletions rpm/devdeps-zlib-shared.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Name: devdeps-zlib-shared
Version: 1.2.7
Release: %(echo $RELEASE)%{?dist}
Url: https://curl.se/
Summary: zlib is a general purpose data compression library.

Group: oceanbase-devel/dependencies
License: MIT

%undefine _missing_build_ids_terminate_build
%define _build_id_links compat

# disable check-buildroot
%define __arch_install_post %{nil}

%define _prefix /usr/local/oceanbase/deps/devel
%define _src zlib-%{version}

%define debug_package %{nil}
%define __strip /bin/true

%define _buliddir %{_topdir}/BUILD
%define _tmppath %{_buliddir}/_tmp

%description
zlib is a general purpose data compression library.

%build

rm -rf %{_tmppath}
mkdir -p %{_tmppath}
cd $OLDPWD/../

cd rpm

rm -rf %{_src}

tar -zxvf %{_src}.tar.gz
cd %{_src}

CFLAGS='-fPIC -O3' SFLAGS='-shared' ./configure --prefix=%{_tmppath} --shared

CPU_CORES=`grep -c ^processor /proc/cpuinfo`
make -j${CPU_CORES};
make install

%install

mkdir -p $RPM_BUILD_ROOT/%{_prefix}
cp -r %{_tmppath}/lib %{_tmppath}/include $RPM_BUILD_ROOT/%{_prefix}

%files

%defattr(-,root,root)
%{_prefix}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
* Tue Sep 29 2022 oceanbase
- add spec of zlib
2 changes: 2 additions & 0 deletions rpm/obdevtools-bison.spec
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ if [ "${OS_ARCH}x" = "sw_64x" ]; then
BUILD_OPTION='--build=sw_64-unknown-linux-gnu'
elif [ "${OS_ARCH}x" = "aarch64x" ]; then
BUILD_OPTION='--build=aarch64-unknown-linux-gnu'
elif [ "${OS_ARCH}x" = "ppc64lex" ]; then
BUILD_OPTION='--build=ppc64le'
fi

./configure --prefix=${RPM_BUILD_ROOT}/%{_prefix} ${BUILD_OPTION}
Expand Down
2 changes: 2 additions & 0 deletions rpm/obdevtools-flex.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ if [ "${OS_ARCH}x" = "sw_64x" ]; then
BUILD_OPTION='--build=sw_64-unknown-linux-gnu'
elif [ "${OS_ARCH}x" = "aarch64x" ]; then
BUILD_OPTION='--build=aarch64-unknown-linux-gnu'
elif [ "${OS_ARCH}x" = "ppc64lex" ]; then
BUILD_OPTION='--build=ppc64le'
fi


Expand Down
35 changes: 35 additions & 0 deletions rpm/obdevtools-llvm-build-11.1.0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -ex
CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"obdevtools-llvm"}
VERSION=${3:-"11.1.0"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/llvm-$VERSION.*[tar|gz|bz2|xz|zip]$"` ]]; then
echo "Download source code"
wget https://mirror.ghproxy.com/https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/llvm-11.1.0.src.tar.xz -P $ROOT_DIR --no-check-certificate
wget https://mirror.ghproxy.com/https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/lld-11.1.0.src.tar.xz -P $ROOT_DIR --no-check-certificate
wget https://mirror.ghproxy.com/https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/clang-11.1.0.src.tar.xz -P $ROOT_DIR --no-check-certificate
wget https://mirror.ghproxy.com/https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/compiler-rt-11.1.0.src.tar.xz -P $ROOT_DIR --no-check-certificate
fi

# prepare building environment
OS_RELEASE=$(grep -Po '(?<=release )\d' /etc/redhat-release)
if [ "$(uname -m)" == "ppc64le" ];then
echo "Now install obdevtools-cmake and obdevtools-gcc manually!"
else
wget http://mirrors.aliyun.com/oceanbase/OceanBase.repo -P /etc/yum.repos.d/
yum install obdevtools-cmake-3.22.1 -y
yum install obdevtools-gcc9-9.3.0 -y
fi

export PATH=/usr/local/oceanbase/devtools/bin:$PATH

ln -sf /usr/local/oceanbase/devtools/bin/g++ /usr/bin/c++
ln -sf /usr/local/oceanbase/devtools/bin/gcc /usr/bin/cc

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
Loading