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

[cmake] add libxsmm,lite,openblas third_party cache #54380

Merged
Show file tree
Hide file tree
Changes from 5 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
16 changes: 16 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,19 @@
path = third_party/gtest
url = https://github.com/google/googletest.git
ignore = dirty
[submodule "third_party/libxsmm"]
path = third_party/gtest
url = https://github.com/hfp/libxsmm.git
ignore = dirty
[submodule "third_party/lite"]
path = third_party/gtest
url = https://github.com/PaddlePaddle/Paddle-Lite.git
ignore = dirty
[submodule "third_party/openblas"]
path = third_party/gtest
url = https://github.com/xianyi/OpenBLAS.git
ignore = dirty
[submodule "third_party/rocksdb"]
path = third_party/gtest
url = https://github.com/facebook/rocksdb.git
ignore = dirty
enkilee marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 5 additions & 3 deletions cmake/external/libxsmm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ include(ExternalProject)

set(LIBXSMM_PREFIX_DIR ${THIRD_PARTY_PATH}/libxsmm)
set(LIBXSMM_INSTALL_DIR ${THIRD_PARTY_PATH}/install/libxsmm)
set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/libxsmm)
set(LIBXSMM_TAG 7cc03b5b342fdbc6b6d990b190671c5dbb8489a2)

set(LIBXSMM_INCLUDE_DIR
"${LIBXSMM_INSTALL_DIR}/include"
CACHE PATH "LIBXSMM include directory." FORCE)
Expand All @@ -27,9 +30,8 @@ set(LIBXSMMNOBLAS_LIB "${LIBXSMM_LIBRARY_DIR}/libxsmmnoblas.a")

ExternalProject_Add(
extern_libxsmm
${SHALLOW_CLONE}
GIT_REPOSITORY "${GIT_URL}/hfp/libxsmm.git"
GIT_TAG "7cc03b5b342fdbc6b6d990b190671c5dbb8489a2"
${EXTERNAL_PROJECT_LOG_ARGS}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${LIBXSMM_PREFIX_DIR}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
Expand Down
14 changes: 4 additions & 10 deletions cmake/external/lite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ if(NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
set(LITE_PREFIX_DIR ${THIRD_PARTY_PATH}/lite)
set(LITE_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lite)
set(LITE_BINARY_DIR ${LITE_PREFIX_DIR}/src/extern_lite-build)
set(LITE_SOURCE_DIR ${LITE_PREFIX_DIR}/src/extern_lite)

set(LITE_SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/extern_lite)
set(LITE_GIT_TAG 81ef66554099800c143a0feff6e0a491b3b0d12e)
set(LITE_SHARED_LIB
${LITE_BINARY_DIR}/${LITE_OUTPUT_BIN_DIR}/cxx/lib/libpaddle_full_api_shared.so
)

if(NOT LITE_GIT_TAG)
set(LITE_GIT_TAG 81ef66554099800c143a0feff6e0a491b3b0d12e)
endif()

if(NOT CUDA_ARCH_NAME)
set(CUDA_ARCH_NAME "Auto")
endif()
Expand Down Expand Up @@ -108,8 +104,7 @@ if(NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
ExternalProject_Add(
${LITE_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY "${GIT_URL}/PaddlePaddle/Paddle-Lite.git"
GIT_TAG ${LITE_GIT_TAG}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${LITE_PREFIX_DIR}
PATCH_COMMAND
mkdir -p ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code && touch
Expand Down Expand Up @@ -161,8 +156,7 @@ if(NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
ExternalProject_Add(
${LITE_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY "${GIT_URL}/PaddlePaddle/Paddle-Lite.git"
GIT_TAG ${LITE_GIT_TAG}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${LITE_PREFIX_DIR}
UPDATE_COMMAND ""
PATCH_COMMAND
Expand Down
10 changes: 4 additions & 6 deletions cmake/external/openblas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include(ExternalProject)

set(CBLAS_PREFIX_DIR ${THIRD_PARTY_PATH}/openblas)
set(CBLAS_INSTALL_DIR ${THIRD_PARTY_PATH}/install/openblas)
set(CBLAS_REPOSITORY ${GIT_URL}/xianyi/OpenBLAS.git)
set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/openblas)
set(CBLAS_TAG v0.3.7)

# Why use v0.3.18? The IDG business line encountered a random openblas error,
Expand Down Expand Up @@ -64,9 +64,8 @@ if(NOT WIN32)
set(COMMON_ARGS CC=${OPENBLAS_CC} NO_SHARED=1 NO_LAPACK=1 libs)
ExternalProject_Add(
extern_openblas
${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE}
GIT_REPOSITORY ${CBLAS_REPOSITORY}
GIT_TAG ${CBLAS_TAG}
${EXTERNAL_PROJECT_LOG_ARGS}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${CBLAS_PREFIX_DIR}
INSTALL_DIR ${CBLAS_INSTALL_DIR}
BUILD_IN_SOURCE 1
Expand All @@ -85,8 +84,7 @@ else()
ExternalProject_Add(
extern_openblas
${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY ${CBLAS_REPOSITORY}
GIT_TAG ${CBLAS_TAG}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${CBLAS_PREFIX_DIR}
INSTALL_DIR ${CBLAS_INSTALL_DIR}
BUILD_IN_SOURCE 0
Expand Down
5 changes: 3 additions & 2 deletions cmake/external/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ set(ROCKSDB_CMAKE_CXX_FLAGS
set(ROCKSDB_CMAKE_C_FLAGS
"${ROCKSDB_COMMON_FLAGS} ${ROCKSDB_FLAGS} -DROCKSDB_LIBAIO_PRESENT -fPIC -I${JEMALLOC_INCLUDE_DIR}"
)
set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/rocksdb)
set(ROCKSDB_TAG v6.10.1)
include_directories(${ROCKSDB_INCLUDE_DIR})

set(CMAKE_CXX_LINK_EXECUTABLE
Expand All @@ -49,8 +51,7 @@ ExternalProject_Add(
extern_rocksdb
${EXTERNAL_PROJECT_LOG_ARGS}
PREFIX ${ROCKSDB_PREFIX_DIR}
GIT_REPOSITORY "https://github.com/Thunderbrook/rocksdb"
GIT_TAG 6.19.fb
SOURCE_DIR ${SOURCE_DIR}
UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
Expand Down