From 4f307a7e1589ab3d3242bdd1d5637baffc69552f Mon Sep 17 00:00:00 2001 From: Qi Li Date: Thu, 20 Jul 2023 13:22:19 +0800 Subject: [PATCH] [ARM] fix arm build failure with Ninja build, test=develop (#55548) --- cmake/external/openblas.cmake | 5 ++++- cmake/external/rocksdb.cmake | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/external/openblas.cmake b/cmake/external/openblas.cmake index 8443a8a9f72..f30dcd4d301 100644 --- a/cmake/external/openblas.cmake +++ b/cmake/external/openblas.cmake @@ -82,6 +82,9 @@ if(NOT WIN32) set(OPTIONAL_ARGS DYNAMIC_ARCH=1 NUM_THREADS=64) endif() + if(WITH_ARM) + set(ARM_ARGS TARGET=ARMV8) + endif() set(COMMON_ARGS CC=${OPENBLAS_CC} NO_SHARED=1 NO_LAPACK=1 libs) ExternalProject_Add( extern_openblas @@ -90,7 +93,7 @@ if(NOT WIN32) PREFIX ${CBLAS_PREFIX_DIR} INSTALL_DIR ${CBLAS_INSTALL_DIR} BUILD_IN_SOURCE 1 - BUILD_COMMAND make -j${NPROC} ${COMMON_ARGS} ${OPTIONAL_ARGS} + BUILD_COMMAND make ${ARM_ARGS} -j${NPROC} ${COMMON_ARGS} ${OPTIONAL_ARGS} INSTALL_COMMAND make install NO_SHARED=1 NO_LAPACK=1 PREFIX= UPDATE_COMMAND "" CONFIGURE_COMMAND "" diff --git a/cmake/external/rocksdb.cmake b/cmake/external/rocksdb.cmake index 69a5c240cc5..98e9972e270 100644 --- a/cmake/external/rocksdb.cmake +++ b/cmake/external/rocksdb.cmake @@ -79,11 +79,9 @@ set(CMAKE_CXX_LINK_EXECUTABLE if(WITH_ARM) file(TO_NATIVE_PATH ${PADDLE_SOURCE_DIR}/patches/rocksdb/libaio.h.patch native_src) - # See: [Why calling some `git` commands before `patch`?] set(ROCKSDB_PATCH_COMMAND - git checkout -- . && git checkout 6.19.fb && patch -Nd - ${CMAKE_BINARY_DIR}/third_party/rocksdb/src/extern_rocksdb/env < - ${native_src}) + git checkout -- . && git checkout ${ROCKSDB_TAG} && patch -Nd + ${PADDLE_SOURCE_DIR}/third_party/rocksdb/env/ < ${native_src}) endif() ExternalProject_Add( extern_rocksdb -- GitLab