Skip to content

Commit 54cb42a

Browse files
committed
Add the content of third_party.cmake, test=develop
1 parent e5e699e commit 54cb42a

15 files changed

+143
-87
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ OPTION(WITH_LIBXSMM "Compile with libxsmm" OFF)
7676
option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF)
7777
option(WITH_PSLIB "Compile with pslib support" OFF)
7878
option(WITH_BOX_PS "Compile with box_ps support" OFF)
79+
option(WITH_XBYAK "Compile with xbyak support" ON)
7980
option(WITH_CONTRIB "Compile the third-party contributation" OFF)
8081
option(REPLACE_ENFORCE_GLOG "Replace PADDLE_ENFORCE with glog/CHECK for better debug." OFF)
8182
option(WITH_GRPC "Use grpc as the default rpc framework" ${WITH_DISTRIBUTE})

cmake/external/cares.cmake

+1-6
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
#
1514

16-
IF(NOT WITH_DISTRIBUTE)
17-
return()
18-
ENDIF()
15+
# NOTE: c-ares is needed when linking with grpc.
1916

2017
include (ExternalProject)
2118

22-
# NOTE: c-ares is needed when linking with grpc.
23-
2419
SET(CARES_SOURCES_DIR ${THIRD_PARTY_PATH}/cares)
2520
SET(CARES_INSTALL_DIR ${THIRD_PARTY_PATH}/install/cares)
2621
SET(CARES_INCLUDE_DIR "${CARES_INSTALL_DIR}/include/" CACHE PATH "cares include directory." FORCE)

cmake/external/cub.cmake

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
if(NOT WITH_GPU)
2-
return()
3-
endif()
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
414

515
include(ExternalProject)
616

cmake/external/dlpack.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
include(ExternalProject)
216

317
set(DLPACK_SOURCE_DIR ${THIRD_PARTY_PATH}/dlpack)

cmake/external/eigen.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
INCLUDE(ExternalProject)
216

317
SET(EIGEN_SOURCE_DIR ${THIRD_PARTY_PATH}/eigen3)

cmake/external/grpc.cmake

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
1+
# Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -13,10 +13,6 @@
1313
# limitations under the License.
1414
#
1515

16-
IF(NOT WITH_DISTRIBUTE)
17-
return()
18-
ENDIF()
19-
2016
include (ExternalProject)
2117

2218
SET(GRPC_SOURCES_DIR ${THIRD_PARTY_PATH}/grpc)

cmake/external/libmct.cmake

-12
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
IF(NOT ${WITH_LIBMCT})
16-
return()
17-
ENDIF(NOT ${WITH_LIBMCT})
18-
19-
IF(WIN32 OR APPLE)
20-
MESSAGE(WARNING
21-
"Windows or Mac is not supported with LIBMCT in Paddle yet."
22-
"Force WITH_LIBMCT=OFF")
23-
SET(WITH_LIBMCT OFF CACHE STRING "Disable LIBMCT package in Windows and MacOS" FORCE)
24-
return()
25-
ENDIF()
26-
2715
INCLUDE(ExternalProject)
2816

2917
SET(LIBMCT_PROJECT "extern_libmct")

cmake/external/mkldnn.cmake

+2-5
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ if(WIN32)
100100
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/bin/mkldnn.dll)
101101
else(WIN32)
102102
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/libmkldnn.so.0)
103-
ADD_CUSTOM_COMMAND(OUTPUT ${MKLDNN_SHARED_LIB}
104-
COMMAND ${CMAKE_COMMAND} -E copy ${MKLDNN_LIB} ${MKLDNN_SHARED_LIB}
105-
DEPENDS mkldnn shared_mkldnn)
103+
ADD_CUSTOM_COMMAND(TARGET ${MKLDNN_PROJECT} POST_BUILD
104+
COMMAND ${CMAKE_COMMAND} -E copy ${MKLDNN_LIB} ${MKLDNN_SHARED_LIB})
106105
endif(WIN32)
107-
ADD_CUSTOM_TARGET(mkldnn_shared_lib ALL DEPENDS ${MKLDNN_SHARED_LIB})
108-
ADD_DEPENDENCIES(mkldnn_shared_lib ${MKLDNN_PROJECT} mkldnn)

cmake/external/pslib.cmake

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,18 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
IF(NOT ${WITH_PSLIB})
16-
return()
17-
ENDIF(NOT ${WITH_PSLIB})
18-
19-
IF(WIN32 OR APPLE)
20-
MESSAGE(WARNING
21-
"Windows or Mac is not supported with PSLIB in Paddle yet."
22-
"Force WITH_PSLIB=OFF")
23-
SET(WITH_PSLIB OFF CACHE STRING "Disable PSLIB package in Windows and MacOS" FORCE)
24-
return()
25-
ENDIF()
26-
2715
INCLUDE(ExternalProject)
2816

2917
SET(PSLIB_PROJECT "extern_pslib")

cmake/external/pslib_brpc.cmake

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,18 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
IF(NOT ${WITH_PSLIB_BRPC})
16-
return()
17-
ENDIF(NOT ${WITH_PSLIB_BRPC})
18-
19-
IF(WIN32 OR APPLE)
20-
MESSAGE(WARNING
21-
"Windows or Mac is not supported with PSLIB_BRPC in Paddle yet."
22-
"Force WITH_PSLIB_BRPC=OFF")
23-
SET(WITH_PSLIB_BRPC OFF CACHE STRING "Disable PSLIB_BRPC package in Windows and MacOS" FORCE)
24-
return()
25-
ENDIF()
26-
2715
INCLUDE(ExternalProject)
2816

2917
SET(PSLIB_BRPC_PROJECT "extern_pslib_brpc")

cmake/external/rocprim.cmake

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
if (NOT WITH_AMD_GPU)
2-
return()
3-
endif()
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
414

515
# rocprim is "ROCm Parallel Primitives" for short.
616
# It is a header-only library providing HIP and HC parallel primitives

cmake/external/threadpool.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
INCLUDE(ExternalProject)
216

317
SET(THREADPOOL_SOURCE_DIR ${THIRD_PARTY_PATH}/threadpool)

cmake/external/xbyak.cmake

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,12 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
set(WITH_XBYAK ON)
16-
if(WIN32 OR APPLE)
17-
SET(WITH_XBYAK OFF CACHE STRING "Disable XBYAK in Windows and MacOS" FORCE)
18-
return()
19-
endif()
20-
2115
include(ExternalProject)
2216

2317
set(XBYAK_PROJECT extern_xbyak)

cmake/external/xxhash.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
INCLUDE(ExternalProject)
216

317
set(XXHASH_SOURCE_DIR ${THIRD_PARTY_PATH}/xxhash)

0 commit comments

Comments
 (0)