diff --git a/CMakeLists.txt b/CMakeLists.txt index bbdba79d2f2ded208aa70c5d99a51b4d364992b7..265ddc9504167f21f54a1b1e7777147b3b6d37d9 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,6 +218,9 @@ endif(WITH_AMD_GPU) if(WITH_ARM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + set(WITH_XBYAK OFF CACHE STRING "Disable XBYAK when compiling WITH_ARM=ON" FORCE) + set(WITH_MKL OFF CACHE STRING "Disable MKL when compiling WITH_ARM=ON." FORCE) + set(WITH_GPU OFF CACHE STRING "Disable GPU when compiling WITH_ARM=ON." FORCE) add_definitions(-DPADDLE_WITH_ARM) endif() diff --git a/cmake/external/openblas.cmake b/cmake/external/openblas.cmake index 5e47f268a36699b7e2310c5f5b2c20bcf6f18f1b..5bc7eaaff3abe65e1a12a923880960bbb4268f87 100644 --- a/cmake/external/openblas.cmake +++ b/cmake/external/openblas.cmake @@ -20,6 +20,8 @@ SET(CBLAS_INSTALL_DIR ${THIRD_PARTY_PATH}/install/openblas) SET(CBLAS_REPOSITORY https://github.com/xianyi/OpenBLAS.git) SET(CBLAS_TAG v0.3.7) IF(WITH_ARM) + # Under the FT2000 architecture, the calculation result of blas.sgemm in openblas 0.3+ is wrong, + # so version 0.2 is used by default. SET(CBLAS_TAG v0.2.18) ENDIF() cache_third_party(extern_openblas diff --git a/python/setup.py.in b/python/setup.py.in index f3dc1035fc14df2297752eae9c49a4a21f7579a4..10325e096fb7674de1ba10bca724165b840eb14e 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -324,6 +324,8 @@ if '${CMAKE_BUILD_TYPE}' == 'Release': command = "install_name_tool -id \"@loader_path/../libs/\" ${PADDLE_BINARY_DIR}/python/paddle/fluid/${FLUID_CORE_NAME}" + '.so' else: command = "patchelf --set-rpath '$ORIGIN/../libs/' ${PADDLE_BINARY_DIR}/python/paddle/fluid/${FLUID_CORE_NAME}" + '.so' + # The dynamic library compiled under aarch64 is greater than 64M, + # and an oversize error will be reported when using patchelf. if platform.machine() != 'aarch64': if os.system(command) != 0: raise Exception("patch ${FLUID_CORE_NAME}.%s failed, command: %s" % (ext_name, command))