未验证 提交 d2e59e15 编写于 作者: R Ruibiao Chen 提交者: GitHub

Remove boost library (#44092)

上级 f9130835
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include(ExternalProject)
set(BOOST_PROJECT "extern_boost")
# To release PaddlePaddle as a pip package, we have to follow the
# manylinux1 standard, which features as old Linux kernels and
# compilers as possible and recommends CentOS 5. Indeed, the earliest
# CentOS version that works with NVIDIA CUDA is CentOS 6. And a new
# version of boost, say, 1.66.0, doesn't build on CentOS 6. We
# checked that the devtools package of CentOS 6 installs boost 1.41.0.
# So we use 1.41.0 here.
set(BOOST_VER "1.41.0")
# boost_1_41_0_2021_10.tar.gz is almost the same with boost_1_41_0.tar.gz,
# except in visualc.hpp i comment a warning of "unknown compiler version",
# so if you need to change boost, you may need to block the warning similarly.
set(BOOST_TAR
"boost_1_41_0_2021_10"
CACHE STRING "" FORCE)
set(BOOST_URL
"http://paddlepaddledeps.bj.bcebos.com/${BOOST_TAR}.tar.gz"
CACHE STRING "" FORCE)
message(STATUS "BOOST_VERSION: ${BOOST_VER}, BOOST_URL: ${BOOST_URL}")
set(BOOST_PREFIX_DIR ${THIRD_PARTY_PATH}/boost)
set(BOOST_INCLUDE_DIR
"${THIRD_PARTY_PATH}/boost/src/extern_boost"
CACHE PATH "boost include directory." FORCE)
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
include_directories(${BOOST_INCLUDE_DIR})
if(WIN32 AND MSVC_VERSION GREATER_EQUAL 1600)
add_definitions(-DBOOST_HAS_STATIC_ASSERT)
endif()
ExternalProject_Add(
${BOOST_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS}
URL ${BOOST_URL}
URL_MD5 51be7cc203628dc0848e97eee32d79e3
PREFIX ${BOOST_PREFIX_DIR}
DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
UPDATE_COMMAND "")
add_library(boost INTERFACE)
add_dependencies(boost ${BOOST_PROJECT})
set(Boost_INCLUDE_DIR ${BOOST_INCLUDE_DIR})
......@@ -471,12 +471,6 @@ copy(
${EIGEN_INCLUDE_DIR}/unsupported/Eigen
DSTS ${dst_dir}/Eigen ${dst_dir}/Eigen ${dst_dir}/unsupported)
set(dst_dir "${PADDLE_INSTALL_DIR}/third_party/boost")
copy(
inference_lib_dist
SRCS ${BOOST_INCLUDE_DIR}/boost
DSTS ${dst_dir})
set(dst_dir "${PADDLE_INSTALL_DIR}/third_party/dlpack")
copy(
inference_lib_dist
......
......@@ -246,7 +246,6 @@ endif()
include(external/zlib) # download, build, install zlib
include(external/gflags) # download, build, install gflags
include(external/glog) # download, build, install glog
include(external/boost) # download boost
include(external/eigen) # download eigen3
include(external/threadpool) # download threadpool
include(external/dlpack) # download dlpack
......@@ -254,14 +253,8 @@ include(external/xxhash) # download, build, install xxhash
include(external/warpctc) # download, build, install warpctc
include(external/utf8proc) # download, build, install utf8proc
list(
APPEND
third_party_deps
extern_eigen3
extern_gflags
extern_glog
extern_boost
extern_xxhash)
list(APPEND third_party_deps extern_eigen3 extern_gflags extern_glog
extern_xxhash)
list(
APPEND
third_party_deps
......@@ -272,14 +265,8 @@ list(
extern_utf8proc)
include(external/lapack) # download, build, install lapack
list(
APPEND
third_party_deps
extern_eigen3
extern_gflags
extern_glog
extern_boost
extern_xxhash)
list(APPEND third_party_deps extern_eigen3 extern_gflags extern_glog
extern_xxhash)
list(
APPEND
third_party_deps
......
......@@ -86,35 +86,29 @@ cc_library(
cc_library(
downpour_server
SRCS graph_brpc_server.cc brpc_ps_server.cc
DEPS boost eigen3 table brpc_utils simple_threadpool ${RPC_DEPS})
DEPS eigen3 table brpc_utils simple_threadpool ${RPC_DEPS})
cc_library(
downpour_client
SRCS graph_brpc_client.cc brpc_ps_client.cc ps_local_client.cc
DEPS boost eigen3 table brpc_utils simple_threadpool ${RPC_DEPS})
DEPS eigen3 table brpc_utils simple_threadpool ${RPC_DEPS})
cc_library(
client
SRCS ps_client.cc
DEPS downpour_client boost ${RPC_DEPS})
DEPS downpour_client ${RPC_DEPS})
cc_library(
server
SRCS server.cc
DEPS downpour_server boost ${RPC_DEPS})
DEPS downpour_server ${RPC_DEPS})
cc_library(
communicator
SRCS communicator/communicator.cc
DEPS scope
client
boost
table
math_function
selected_rows_functor
${RPC_DEPS})
DEPS scope client table math_function selected_rows_functor ${RPC_DEPS})
cc_library(
ps_service
SRCS ps_service/service.cc
DEPS communicator client server boost ${RPC_DEPS})
DEPS communicator client server ${RPC_DEPS})
cc_library(
heter_client
......
......@@ -6,10 +6,4 @@ set_source_files_properties(
cc_library(
communicator
SRCS communicator.cc
DEPS scope
client
boost
table
math_function
selected_rows_functor
${RPC_DEPS})
DEPS scope client table math_function selected_rows_functor ${RPC_DEPS})
......@@ -119,7 +119,6 @@ cc_library(
string_helper
device_context
gflags
glog
boost)
glog)
target_link_libraries(table -fopenmp)
......@@ -18,7 +18,6 @@
#include <sstream>
#include "boost/lexical_cast.hpp"
#include "glog/logging.h"
#include "paddle/fluid/distributed/common/cost_timer.h"
#include "paddle/fluid/framework/io/fs.h"
......@@ -530,7 +529,7 @@ int32_t MemorySparseTable::PullSparsePtr(char** pull_values,
mf_value_size]() -> int {
auto& keys = task_keys[shard_id];
auto& local_shard = _local_shards[shard_id];
float data_buffer[value_size];
float data_buffer[value_size]; // NOLINT
float* data_buffer_ptr = data_buffer;
for (size_t i = 0; i < keys.size(); ++i) {
uint64_t key = keys[i].first;
......@@ -549,7 +548,7 @@ int32_t MemorySparseTable::PullSparsePtr(char** pull_values,
ret = itr.value_ptr();
}
int pull_data_idx = keys[i].second;
pull_values[pull_data_idx] = (char*)ret;
pull_values[pull_data_idx] = (char*)ret; // NOLINT
}
return 0;
});
......
......@@ -32,7 +32,6 @@ cc_test(
client
communicator
ps_service
boost
table
ps_framework_proto
${COMMON_DEPS})
......@@ -48,7 +47,6 @@ cc_test(
client
communicator
ps_service
boost
table
ps_framework_proto
${COMMON_DEPS})
......@@ -71,7 +69,6 @@ cc_test(
client
communicator
ps_service
boost
table
ps_framework_proto
${COMMON_DEPS})
......@@ -87,7 +84,6 @@ cc_test(
client
communicator
ps_service
boost
table
ps_framework_proto
${COMMON_DEPS})
......@@ -105,28 +101,28 @@ set_source_files_properties(
cc_test(
feature_value_test
SRCS feature_value_test.cc
DEPS ${COMMON_DEPS} boost table)
DEPS ${COMMON_DEPS} table)
set_source_files_properties(
sparse_sgd_rule_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_test(
sparse_sgd_rule_test
SRCS sparse_sgd_rule_test.cc
DEPS ${COMMON_DEPS} boost table)
DEPS ${COMMON_DEPS} table)
set_source_files_properties(
ctr_accessor_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_test(
ctr_accessor_test
SRCS ctr_accessor_test.cc
DEPS ${COMMON_DEPS} boost table)
DEPS ${COMMON_DEPS} table)
set_source_files_properties(
ctr_dymf_accessor_test.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS})
cc_test(
ctr_dymf_accessor_test
SRCS ctr_dymf_accessor_test.cc
DEPS ${COMMON_DEPS} boost table)
DEPS ${COMMON_DEPS} table)
set_source_files_properties(
memory_sparse_table_test.cc PROPERTIES COMPILE_FLAGS
......@@ -134,11 +130,11 @@ set_source_files_properties(
cc_test(
memory_sparse_table_test
SRCS memory_sparse_table_test.cc
DEPS ${COMMON_DEPS} boost table)
DEPS ${COMMON_DEPS} table)
set_source_files_properties(
memory_geo_table_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_test(
memory_sparse_geo_table_test
SRCS memory_geo_table_test.cc
DEPS ${COMMON_DEPS} boost table)
DEPS ${COMMON_DEPS} table)
......@@ -45,7 +45,7 @@ proto_library(op_def_proto SRCS op_def.proto DEPS framework_proto)
cc_library(
op_def_api
SRCS op_def_api.cc
DEPS op_def_proto boost)
DEPS op_def_proto)
file(GLOB OP_DEF_FILES
${PADDLE_SOURCE_DIR}/paddle/fluid/operators/compat/*.pbtxt)
......@@ -341,7 +341,7 @@ cc_library(
cc_library(
attribute
SRCS attribute.cc
DEPS framework_proto boost enforce)
DEPS framework_proto enforce)
cc_test(
attribute_test
SRCS attribute_test.cc
......@@ -354,12 +354,12 @@ cc_test(
cc_library(
op_version_proto
SRCS op_version_proto.cc
DEPS framework_proto boost)
DEPS framework_proto)
cc_library(
op_version_registry
SRCS op_version_registry.cc
DEPS op_version_proto framework_proto boost)
DEPS op_version_proto framework_proto)
cc_test(
op_version_registry_test
SRCS op_version_registry_test.cc
......@@ -519,7 +519,7 @@ cc_test(
cc_library(
program_processing
SRCS program_processing.cc
DEPS boost proto_desc)
DEPS proto_desc)
cc_test(
program_processing_test
SRCS program_processing_test.cc
......@@ -1025,7 +1025,7 @@ endif()
cc_library(
prune
SRCS prune.cc
DEPS framework_proto boost)
DEPS framework_proto)
cc_test(
prune_test
SRCS prune_test.cc
......
......@@ -21,7 +21,6 @@
#include <utility>
#include <vector>
#include "boost/optional.hpp"
#include "paddle/fluid/framework/ir/pass_builder.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/scope.h"
......
......@@ -5,7 +5,7 @@ cc_library(
cc_library(
fs
SRCS fs.cc
DEPS string_helper glog boost enforce shell)
DEPS string_helper glog enforce shell)
cc_test(
test_fs
......
cc_library(
cinn_cache_key
SRCS cinn_cache_key.cc
DEPS boost graph graph_helper lod_tensor proto_desc)
DEPS graph graph_helper lod_tensor proto_desc)
cc_library(
build_cinn_pass
SRCS build_cinn_pass.cc
......
......@@ -5,7 +5,7 @@ endif()
cc_library(
lite_op_teller
SRCS op_teller.cc
DEPS ${LITE_DEPS} framework_proto device_context boost xxhash)
DEPS ${LITE_DEPS} framework_proto device_context xxhash)
cc_library(
lite_engine
SRCS engine.cc
......@@ -13,7 +13,7 @@ cc_library(
cc_library(
lite_tensor_utils
SRCS tensor_utils.cc
DEPS memcpy ${LITE_DEPS} framework_proto boost device_context ${XPU_DEPS})
DEPS memcpy ${LITE_DEPS} framework_proto device_context ${XPU_DEPS})
cc_test(
test_lite_engine
SRCS test_engine_lite.cc
......
......@@ -4,18 +4,18 @@ if(WIN32)
nv_library(
tensorrt_engine
SRCS engine.cc trt_int8_calibrator.cc
DEPS ${GLOB_OPERATOR_DEPS} framework_proto device_context boost
DEPS ${GLOB_OPERATOR_DEPS} framework_proto device_context
paddle_inference_api)
else()
nv_library(
tensorrt_engine
SRCS engine.cc trt_int8_calibrator.cc
DEPS ${GLOB_OPERATOR_DEPS} framework_proto device_context boost)
DEPS ${GLOB_OPERATOR_DEPS} framework_proto device_context)
endif()
nv_library(
tensorrt_op_teller
SRCS op_teller.cc
DEPS framework_proto device_context boost)
DEPS framework_proto device_context)
nv_test(
test_tensorrt
SRCS test_tensorrt.cc
......
......@@ -172,7 +172,7 @@ sequence_pooling executor device_memory_aligment generator)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} dynload_warpctc)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} sequence_padding sequence_scale cos_sim_functor memory jit_kernel_helper concat_and_split cross_entropy softmax vol2col im2col sampler sample_prob tree2col)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} sequence2batch lstm_compute matrix_bit_code gru_compute activation_functions beam_search fc_functor matrix_inverse matrix_solve)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} box_wrapper boost ps_gpu_wrapper)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} box_wrapper ps_gpu_wrapper)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} common_infer_shape_functions)
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} eigen_function)
if (WITH_GPU OR WITH_ROCM)
......
......@@ -39,7 +39,6 @@ op_library(
DEPS
${GLOB_OPERATOR_DEPS}
framework_proto
boost
device_context
op_registry
scope)
......
......@@ -14,7 +14,6 @@ limitations under the License. */
#include <utf8proc.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <chrono>
#include <codecvt>
#include <fstream>
......
......@@ -37,7 +37,7 @@ endif()
cc_library(
flags
SRCS flags.cc
DEPS gflags boost)
DEPS gflags)
cc_library(
denormal
SRCS denormal.cc
......@@ -48,7 +48,7 @@ cc_test(
SRCS errors_test.cc
DEPS errors enforce)
set(enforce_deps flags errors boost flags phi_enforce)
set(enforce_deps flags errors flags phi_enforce)
if(WITH_GPU)
set(enforce_deps ${enforce_deps} external_error_proto)
endif()
......@@ -99,7 +99,7 @@ endif()
cc_library(
place
SRCS place.cc
DEPS enforce boost phi_place)
DEPS enforce phi_place)
cc_test(
place_test
SRCS place_test.cc
......@@ -185,7 +185,7 @@ endif()
cc_library(
cudnn_workspace_helper
SRCS cudnn_workspace_helper.cc
DEPS boost)
DEPS)
# separate init from device_context to avoid cycle dependencies
cc_library(
......@@ -372,7 +372,7 @@ add_subdirectory(profiler)
cc_library(
device_tracer
SRCS device_tracer.cc
DEPS boost profiler_proto framework_proto ${GPU_CTX_DEPS})
DEPS profiler_proto framework_proto ${GPU_CTX_DEPS})
if(WITH_GPU)
nv_library(
profiler
......
......@@ -13,7 +13,7 @@ cc_library(
cc_library(
mlu_stream
SRCS mlu_stream.cc
DEPS boost mlu_info stream_callback_manager eigen3 ${MKLDNN_CTX_DEPS})
DEPS mlu_info stream_callback_manager eigen3 ${MKLDNN_CTX_DEPS})
cc_library(
mlu_device_context
SRCS device_context.cc
......
......@@ -21,7 +21,7 @@ if(WITH_ASCEND_CL)
cc_library(
npu_stream
SRCS npu_stream.cc
DEPS enforce boost stream_callback_manager)
DEPS enforce stream_callback_manager)
cc_library(
npu_collective_helper
SRCS npu_collective_helper.cc
......
......@@ -2,5 +2,5 @@ if(WITH_GPU OR WITH_ROCM)
cc_library(
cuda_stream
SRCS cuda_stream.cc
DEPS enforce boost eigen3 ${MKLDNN_CTX_DEPS})
DEPS enforce eigen3 ${MKLDNN_CTX_DEPS})
endif()
......@@ -128,11 +128,11 @@ endif()
cc_library(
infrt SHARED
SRCS ${infrt_src}
DEPS glog boost ${mlir_libs} ${phi_libs} paddle_framework_proto infrt_naive)
DEPS glog ${mlir_libs} ${phi_libs} paddle_framework_proto infrt_naive)
cc_library(
infrt_static
SRCS ${infrt_src}
DEPS glog boost ${mlir_libs} ${phi_libs} paddle_framework_proto)
DEPS glog ${mlir_libs} ${phi_libs} paddle_framework_proto)
add_dependencies(infrt ${infrt_mlir_incs} mlir-headers)
add_custom_target(test_infrt_exec DEPENDS ${INFRT_TEST_TARGETS})
......@@ -18,10 +18,7 @@ elseif(WITH_ROCM)
DEPS gtest)
endif()
cc_library(
cache
SRCS cache.cc
DEPS boost)
cc_library(cache SRCS cache.cc)
cc_library(
switch_autotune
SRCS switch_autotune.cc
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册