This is an automated email from the ASF dual-hosted git repository.
zha0q1 pushed a commit to branch v1.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/v1.x by this push:
new 14d8a9e [v1.x] use gcc-8.5 instead of gcc-10 for aarch64 build
(#20318)
14d8a9e is described below
commit 14d8a9e90a2051c64be23eb9cc4e29d65c95c7de
Author: Manu Seth <[email protected]>
AuthorDate: Mon May 31 19:03:54 2021 -0700
[v1.x] use gcc-8.5 instead of gcc-10 for aarch64 build (#20318)
* use gcc-8.5 instead of gcc-10 with outline-atomics flag
* debug openblas
* fix apt install
* use gcc-7 for openblas
* use gcc-8.4 for openblas
* update openblas
* remove gcc-8 as no longer required
---
ci/docker/install/ubuntu_aarch64_publish.sh | 24 +++++++++++++++++++-----
config/distribution/linux_aarch64_cpu.cmake | 2 +-
tools/dependencies/openblas.sh | 8 ++++++--
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/ci/docker/install/ubuntu_aarch64_publish.sh
b/ci/docker/install/ubuntu_aarch64_publish.sh
index 55f6131..ca6d5ab 100755
--- a/ci/docker/install/ubuntu_aarch64_publish.sh
+++ b/ci/docker/install/ubuntu_aarch64_publish.sh
@@ -39,6 +39,7 @@ apt-get install -y git \
gnupg \
gnupg2 \
gnupg-agent \
+ libc6-lse \
pandoc \
python3 \
python3-pip \
@@ -47,11 +48,24 @@ apt-get install -y git \
openjdk-8-jdk \
patchelf
-# gcc-10 required for -moutline-atomics flag
-apt-add-repository "deb
http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main"
-apt-get update
-apt install -y gcc-10 g++-10 gfortran-10
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave
/usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10
+# build gcc-8.5 from source
+apt update
+apt install -y flex bison
+wget https://ftpmirror.gnu.org/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz
+tar xf gcc-8.5.0.tar.xz
+cd gcc-8.5.0/
+sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/'
+contrib/download_prerequisites
+cd ..
+mkdir build && cd build
+../gcc-8.5.0/configure -v --build=aarch64-linux-gnu --host=aarch64-linux-gnu
--target=aarch64-linux-gnu --prefix=/usr/local/gcc-8.5.0
--enable-checking=release --enable-languages=c,c++,fortran --disable-multilib
--program-suffix=-8.5
+make -j$(nproc)
+sudo make install-strip
+cd ..
+rm -rf gcc-8.5.0.tar.xz
+export export PATH=/usr/local/gcc-8.5.0/bin:$PATH
+export LD_LIBRARY_PATH=/usr/local/gcc-8.5.0/lib64:$LD_LIBRARY_PATH
+update-alternatives --install /usr/bin/gcc gcc
/usr/local/gcc-8.5.0/bin/gcc-8.5 100 --slave /usr/bin/g++ g++
/usr/local/gcc-8.5.0/bin/g++-8.5 --slave /usr/bin/gcov gcov
/usr/local/gcc-8.5.0/bin/gcov-8.5 --slave /usr/bin/gfortran gfortran
/usr/local/gcc-8.5.0/bin/gfortran-8.5
curl -o apache-maven-3.3.9-bin.tar.gz -L
http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
\
|| curl -o apache-maven-3.3.9-bin.tar.gz -L
https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz
diff --git a/config/distribution/linux_aarch64_cpu.cmake
b/config/distribution/linux_aarch64_cpu.cmake
index 64e6511..f413451 100644
--- a/config/distribution/linux_aarch64_cpu.cmake
+++ b/config/distribution/linux_aarch64_cpu.cmake
@@ -16,7 +16,7 @@
# under the License.
set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
-set(CFLAGS "-march=armv8-a" CACHE STRING "CFLAGS")
+set(CFLAGS "-march=armv8-a+crc+crypto -moutline-atomics" CACHE STRING "CFLAGS")
set(CXXFLAGS "-march=armv8-a" CACHE STRING "CXXFLAGS")
set(USE_CUDA OFF CACHE BOOL "Build with CUDA support")
diff --git a/tools/dependencies/openblas.sh b/tools/dependencies/openblas.sh
index 8871d04..e01eaf1 100755
--- a/tools/dependencies/openblas.sh
+++ b/tools/dependencies/openblas.sh
@@ -19,7 +19,7 @@
# This script builds the static library of openblas that can be used as
dependency of mxnet.
set -ex
-OPENBLAS_VERSION=0.3.7
+OPENBLAS_VERSION=0.3.10
if [[ ((! -e $DEPS_PATH/lib/libopenblas.a) && -z "$CMAKE_STATICBUILD") ||
((! -e $DEPS_PATH/lib/libopenblas.so) && -v CMAKE_STATICBUILD) ]];
then
# download and build openblas
@@ -33,7 +33,11 @@ if [[ ((! -e $DEPS_PATH/lib/libopenblas.a) && -z
"$CMAKE_STATICBUILD") ||
cd $DEPS_PATH/OpenBLAS-$OPENBLAS_VERSION
# Adding NO_DYNAMIC=1 flag causes make install to fail
- CXX="g++ -fPIC" CC="gcc -fPIC" $MAKE DYNAMIC_ARCH=1 USE_OPENMP=1
+ if [[ ! $ARCH == 'aarch64' ]]; then
+ CXX="g++ -fPIC" CC="gcc -fPIC" $MAKE DYNAMIC_ARCH=1 USE_OPENMP=1
+ else
+ $MAKE DYNAMIC_ARCH=1 USE_OPENMP=1
+ fi
if [[ -v CMAKE_STATICBUILD ]]; then
# We link and redistribute libopenblas.so for cmake staticbuild