From f1b18d5d967a43054697642a79a97ef8ae0c6172 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 20 Nov 2024 10:40:33 +0800 Subject: [PATCH 1/4] fix pir link --- cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt b/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt index 03844ecb..d5c3ce9b 100644 --- a/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${PIR_TARGET} ${SOURCES} ${OUT_TARS_H_LIST}) target_include_directories(${PIR_TARGET} PUBLIC $) -target_link_libraries(${PIR_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${IO_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} TBB::tbb TCMalloc) +target_link_libraries(${PIR_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${IO_TARGET} ${CRYPTO_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${PROTOCOL_TARGET}) diff --git a/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt b/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt index dc64b608..6f9452bd 100644 --- a/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt @@ -6,5 +6,5 @@ set(TEST_BINARY_NAME test-ppc-pir) add_executable(${TEST_BINARY_NAME} ${SOURCES}) target_include_directories(${TEST_BINARY_NAME} PRIVATE .) -target_link_libraries(${TEST_BINARY_NAME} PUBLIC ${CRYPTO_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${PIR_TARGET} ${PROTOCOL_TARGET} ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} PUBLIC ${PIR_TARGET} ${PROTOCOL_TARGET} ${BOOST_UNIT_TEST}) add_test(NAME test-pir WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME}) \ No newline at end of file From 0d13343c32396568e4e8275e06c798d69d65a69c Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 20 Nov 2024 11:04:47 +0800 Subject: [PATCH 2/4] air node gateway not required to load transport config --- .../ppc-psi/src/psi-framework/CMakeLists.txt | 2 +- .../ppc-tools/src/config/PPCConfig.cpp | 20 ++++++++++++------- .../ppc-tools/src/config/PPCConfig.h | 6 +++--- .../air-node/AirNodeInitializer.cpp | 2 +- cpp/wedpr-main/gateway/GatewayInitializer.cpp | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt index 173b326f..8683c881 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt @@ -26,4 +26,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${PSI_FRAMEWORK_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${PSI_FRAMEWORK_TARGET} PUBLIC $) -target_link_libraries(${PSI_FRAMEWORK_TARGET} PUBLIC ${BCOS_BOOSTSSL_TARGET} ${TARS_PROTOCOL_TARGET} TCMalloc) +target_link_libraries(${PSI_FRAMEWORK_TARGET} PUBLIC ${IO_TARGET} ${BCOS_BOOSTSSL_TARGET} ${TARS_PROTOCOL_TARGET} TCMalloc) diff --git a/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.cpp b/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.cpp index 5d832da1..d19b6b37 100644 --- a/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.cpp +++ b/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.cpp @@ -30,10 +30,11 @@ using namespace ppc::protocol; using namespace ppc::storage; using namespace bcos; -void PPCConfig::loadGatewayConfig(boost::property_tree::ptree const& _pt) +void PPCConfig::loadGatewayConfig(boost::property_tree::ptree const& _pt, bool requireTransport) { // load the network config - PPCConfig_LOG(INFO) << LOG_DESC("loadGatewayConfig: load the network config"); + PPCConfig_LOG(INFO) << LOG_DESC("loadGatewayConfig: load the network config") + << LOG_KV("requireTransport", requireTransport); // gateway default enable-ssl loadNetworkConfig( m_gatewayConfig.networkConfig, _pt, "gateway", NetworkConfig::DefaultRpcListenPort, false); @@ -73,11 +74,16 @@ void PPCConfig::loadGatewayConfig(boost::property_tree::ptree const& _pt) InvalidConfig() << errinfo_comment( "The value of gateway.seq_sync_period_ms must no little than 3s")); } - // load the grpcConfig - m_grpcConfig = loadGrpcConfig("transport", _pt); - // load the GrpcServerConfig - loadEndpointConfig( - m_gatewayConfig.grpcServerConfig->mutableEndPoint(), false, "transport", _pt); + // only need load grpc config when requireTransport + if (requireTransport) + { + PPCConfig_LOG(INFO) << LOG_DESC("loadGatewayConfig: load grpc config"); + // load the grpcConfig + m_grpcConfig = loadGrpcConfig("transport", _pt); + // load the GrpcServerConfig + loadEndpointConfig( + m_gatewayConfig.grpcServerConfig->mutableEndPoint(), false, "transport", _pt); + } // the agencyID m_agencyID = _pt.get("agency.id", ""); if (m_agencyID.empty()) diff --git a/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.h b/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.h index e8a0497f..89866d48 100644 --- a/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.h +++ b/cpp/wedpr-helper/ppc-tools/src/config/PPCConfig.h @@ -153,12 +153,12 @@ class PPCConfig loadRpcConfig(iniConfig); } - void loadGatewayConfig(std::string const& _configPath) + void loadGatewayConfig(std::string const& _configPath, bool requireTransport) { PPCConfig_LOG(INFO) << LOG_DESC("loadGatewayConfig") << LOG_KV("path", _configPath); boost::property_tree::ptree iniConfig; boost::property_tree::read_ini(_configPath, iniConfig); - loadGatewayConfig(iniConfig); + loadGatewayConfig(iniConfig, requireTransport); } void loadFrontConfig(bool requireTransport, @@ -180,7 +180,7 @@ class PPCConfig loadNetworkConfig(m_rpcConfig, _pt, "rpc", NetworkConfig::DefaultRpcListenPort, true); } - virtual void loadGatewayConfig(boost::property_tree::ptree const& _pt); + virtual void loadGatewayConfig(boost::property_tree::ptree const& _pt, bool requireTransport); NetworkConfig const& rpcConfig() const { return m_rpcConfig; } diff --git a/cpp/wedpr-main/air-node/AirNodeInitializer.cpp b/cpp/wedpr-main/air-node/AirNodeInitializer.cpp index 4c4ad2f5..38c6709d 100644 --- a/cpp/wedpr-main/air-node/AirNodeInitializer.cpp +++ b/cpp/wedpr-main/air-node/AirNodeInitializer.cpp @@ -79,7 +79,7 @@ void AirNodeInitializer::initGateway(std::string const& _configPath) INIT_LOG(INFO) << LOG_DESC("initGateway: ") << _configPath; // not specify the certPath in air-mode auto config = m_nodeInitializer->config(); - config->loadGatewayConfig(_configPath); + config->loadGatewayConfig(_configPath, false); auto threadPool = std::make_shared( "gateway", config->gatewayConfig().networkConfig.threadPoolSize); diff --git a/cpp/wedpr-main/gateway/GatewayInitializer.cpp b/cpp/wedpr-main/gateway/GatewayInitializer.cpp index c5610fda..8a2950bc 100644 --- a/cpp/wedpr-main/gateway/GatewayInitializer.cpp +++ b/cpp/wedpr-main/gateway/GatewayInitializer.cpp @@ -46,7 +46,7 @@ void GatewayInitializer::init(std::string const& _configPath) INIT_LOG(INFO) << LOG_DESC("initGateway: ") << _configPath; auto config = std::make_shared(); - config->loadGatewayConfig(_configPath); + config->loadGatewayConfig(_configPath, true); auto threadPool = std::make_shared( "gateway", config->gatewayConfig().networkConfig.threadPoolSize); From fde2b8095a4994016c34126726f77c0d0906acf9 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 20 Nov 2024 11:31:32 +0800 Subject: [PATCH 3/4] optimize link --- cpp/ppc-framework/io/DataBatch.h | 3 --- cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/bs-ecdh-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt | 2 +- .../ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h | 2 ++ .../ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp | 2 ++ .../ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp | 2 ++ cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt | 4 ++-- cpp/wedpr-crypto/ppc-crypto/src/CMakeLists.txt | 4 ++-- cpp/wedpr-helper/libhelper/CMakeLists.txt | 2 +- cpp/wedpr-helper/ppc-tools/CMakeLists.txt | 2 +- cpp/wedpr-main/air-node/CMakeLists.txt | 2 +- cpp/wedpr-main/pro-node/CMakeLists.txt | 2 +- cpp/wedpr-storage/ppc-io/src/CMakeLists.txt | 2 +- cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt | 2 +- 21 files changed, 25 insertions(+), 22 deletions(-) diff --git a/cpp/ppc-framework/io/DataBatch.h b/cpp/ppc-framework/io/DataBatch.h index a8c394d1..310fd1c0 100644 --- a/cpp/ppc-framework/io/DataBatch.h +++ b/cpp/ppc-framework/io/DataBatch.h @@ -20,7 +20,6 @@ #pragma once #include "../Common.h" #include -#include #include #include #include @@ -210,8 +209,6 @@ class DataBatch } m_data->clear(); m_data.reset(); - // free after release - MallocExtension::instance()->ReleaseFreeMemory(); } private: diff --git a/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt b/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt index d5c3ce9b..d1b6a28a 100644 --- a/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-pir/src/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${PIR_TARGET} ${SOURCES} ${OUT_TARS_H_LIST}) target_include_directories(${PIR_TARGET} PUBLIC $) -target_link_libraries(${PIR_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${IO_TARGET} ${CRYPTO_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${PROTOCOL_TARGET}) +target_link_libraries(${PIR_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${CRYPTO_TARGET}) diff --git a/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt b/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt index 6f9452bd..ba2cabe0 100644 --- a/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-pir/tests/CMakeLists.txt @@ -6,5 +6,5 @@ set(TEST_BINARY_NAME test-ppc-pir) add_executable(${TEST_BINARY_NAME} ${SOURCES}) target_include_directories(${TEST_BINARY_NAME} PRIVATE .) -target_link_libraries(${TEST_BINARY_NAME} PUBLIC ${PIR_TARGET} ${PROTOCOL_TARGET} ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} PUBLIC ${PIR_TARGET} ${BOOST_UNIT_TEST}) add_test(NAME test-pir WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME}) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/bs-ecdh-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/bs-ecdh-psi/CMakeLists.txt index ed1d5866..25163dcd 100644 --- a/cpp/wedpr-computing/ppc-psi/src/bs-ecdh-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/bs-ecdh-psi/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${BS_ECDH_PSI_TARGET} ${SRCS}) -target_link_libraries(${BS_ECDH_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} wedpr_ecc TBB::tbb TCMalloc) +target_link_libraries(${BS_ECDH_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} wedpr_ecc TBB::tbb) diff --git a/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt index 58810e52..5b30a110 100644 --- a/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${CM2020_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${CM2020_PSI_TARGET} PUBLIC $) -target_link_libraries(${CM2020_PSI_TARGET} PUBLIC ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} TBB::tbb TCMalloc) +target_link_libraries(${CM2020_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} TBB::tbb) diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt index 9915c66d..5f113b46 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${ECDH_CONN_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${ECDH_CONN_PSI_TARGET} PUBLIC $) -target_link_libraries(${ECDH_CONN_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} ${TOOLS_TARGET} ${PROTOBUF_TARGET} TBB::tbb TCMalloc) \ No newline at end of file +target_link_libraries(${ECDH_CONN_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} ${TOOLS_TARGET} ${PROTOBUF_TARGET} TBB::tbb) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt index a8d547c2..d0664c59 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${ECDH_MULTI_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${ECDH_MULTI_PSI_TARGET} PUBLIC $) -target_link_libraries(${ECDH_MULTI_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} TBB::tbb TCMalloc) \ No newline at end of file +target_link_libraries(${ECDH_MULTI_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} TBB::tbb) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h index a127630f..a4fc1f60 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h @@ -280,6 +280,8 @@ class CalculatorCache : public std::enable_shared_from_this for (auto const& it : m_plainData) { it->release(); + // free after release + MallocExtension::instance()->ReleaseFreeMemory(); } m_cipherRef.clear(); std::map().swap(m_cipherRef); diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp index ee4769d8..97295541 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp @@ -164,6 +164,8 @@ void EcdhMultiPSIMaster::blindData() }); // can release databatch after encrypted dataBatch->release(); + // free after release + MallocExtension::instance()->ReleaseFreeMemory(); ECDH_MASTER_LOG(INFO) << LOG_DESC("blindData: encrypt data success") << LOG_KV("dataSize", cipher.size()) << LOG_KV("task", m_taskID) << LOG_KV("seq", seq) diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp index 63463024..c51617fc 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp @@ -146,6 +146,8 @@ void EcdhMultiPSIPartner::onReceiveRandomA(bcos::bytesPointer _randA) << LOG_KV("size", dataBatch->size()) << printTaskInfo(m_taskState->task()) << LOG_KV("seq", seq); dataBatch->release(); + // free after release + MallocExtension::instance()->ReleaseFreeMemory(); } while (!m_taskState->sqlReader()); } catch (std::exception& e) diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt index 261ee37e..bd2bc740 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt @@ -1,3 +1,3 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${ECDH_2PC_PSI_TARGET} ${SRCS}) -target_link_libraries(${ECDH_2PC_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} ${TOOLS_TARGET} TCMalloc) \ No newline at end of file +target_link_libraries(${ECDH_2PC_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} ${TOOLS_TARGET}) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt index a0a3c07e..a0bb25c0 100644 --- a/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt @@ -27,4 +27,4 @@ add_library(${LABELED_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${LABELED_PSI_TARGET} PUBLIC $) -target_link_libraries(${LABELED_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} apsi SEAL::seal Kuku::kuku TBB::tbb TCMalloc) +target_link_libraries(${LABELED_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} apsi SEAL::seal Kuku::kuku TBB::tbb) diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt index 8683c881..69d9b68e 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt @@ -26,4 +26,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${PSI_FRAMEWORK_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${PSI_FRAMEWORK_TARGET} PUBLIC $) -target_link_libraries(${PSI_FRAMEWORK_TARGET} PUBLIC ${IO_TARGET} ${BCOS_BOOSTSSL_TARGET} ${TARS_PROTOCOL_TARGET} TCMalloc) +target_link_libraries(${PSI_FRAMEWORK_TARGET} PUBLIC ${FRONT_TARGET} ${IO_TARGET} ${TARS_PROTOCOL_TARGET}) diff --git a/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt index 26b00337..ef18c749 100644 --- a/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt @@ -6,6 +6,6 @@ set(TEST_BINARY_NAME test-ppc-psi) add_executable(${TEST_BINARY_NAME} ${SOURCES}) target_include_directories(${TEST_BINARY_NAME} PRIVATE .) -target_link_libraries(${TEST_BINARY_NAME} ${BS_ECDH_PSI_TARGET} ${ECDH_CONN_PSI_TARGET} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${PROTOCOL_TARGET} ${IO_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) -target_link_libraries(${TEST_BINARY_NAME} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${PROTOCOL_TARGET} ${IO_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} ${BS_ECDH_PSI_TARGET} ${ECDH_CONN_PSI_TARGET} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${PROTOCOL_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${PROTOCOL_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) add_test(NAME test-ppc-psi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME}) \ No newline at end of file diff --git a/cpp/wedpr-crypto/ppc-crypto/src/CMakeLists.txt b/cpp/wedpr-crypto/ppc-crypto/src/CMakeLists.txt index 45f4b2c7..a11c824f 100644 --- a/cpp/wedpr-crypto/ppc-crypto/src/CMakeLists.txt +++ b/cpp/wedpr-crypto/ppc-crypto/src/CMakeLists.txt @@ -6,9 +6,9 @@ find_package(OpenSSL REQUIRED) message(STATUS "OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") message(STATUS "OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -target_link_libraries(${CRYPTO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${CRYPTO_CORE_TARGET} OpenSSL::Crypto unofficial-sodium::sodium TBB::tbb ${CPU_FEATURES_LIB} TCMalloc) +target_link_libraries(${CRYPTO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${CRYPTO_CORE_TARGET} OpenSSL::Crypto unofficial-sodium::sodium TBB::tbb ${CPU_FEATURES_LIB}) if (ENABLE_IPP_CRYPTO) find_package(ipp-crypto REQUIRED) target_link_libraries(${CRYPTO_TARGET} PUBLIC ipp-crypto::crypto_mb) -endif () \ No newline at end of file +endif () diff --git a/cpp/wedpr-helper/libhelper/CMakeLists.txt b/cpp/wedpr-helper/libhelper/CMakeLists.txt index 77e19f19..43b4a8e1 100644 --- a/cpp/wedpr-helper/libhelper/CMakeLists.txt +++ b/cpp/wedpr-helper/libhelper/CMakeLists.txt @@ -5,4 +5,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_library(${HELPER_TARGET} ${SRCS}) find_package(Boost COMPONENTS filesystem program_options) -target_link_libraries(${HELPER_TARGET} PUBLIC ${BCOS_BOOSTSSL_TARGET} Boost::filesystem Boost::program_options) \ No newline at end of file +target_link_libraries(${HELPER_TARGET} PUBLIC Boost::filesystem Boost::program_options) \ No newline at end of file diff --git a/cpp/wedpr-helper/ppc-tools/CMakeLists.txt b/cpp/wedpr-helper/ppc-tools/CMakeLists.txt index 26cb4e2f..5e8810c2 100644 --- a/cpp/wedpr-helper/ppc-tools/CMakeLists.txt +++ b/cpp/wedpr-helper/ppc-tools/CMakeLists.txt @@ -3,7 +3,7 @@ aux_source_directory(src/config SRCS) add_library(${TOOLS_TARGET} ${SRCS}) -target_link_libraries(${TOOLS_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${BCOS_BOOSTSSL_TARGET} ${BOOST_SERIALIZATION} ${CPU_FEATURES_LIB}) +target_link_libraries(${TOOLS_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${BOOST_SERIALIZATION} ${CPU_FEATURES_LIB}) if (TESTS) enable_testing() diff --git a/cpp/wedpr-main/air-node/CMakeLists.txt b/cpp/wedpr-main/air-node/CMakeLists.txt index 53e7bfb9..263c69f8 100644 --- a/cpp/wedpr-main/air-node/CMakeLists.txt +++ b/cpp/wedpr-main/air-node/CMakeLists.txt @@ -1,4 +1,4 @@ aux_source_directory(. SRC_LIST) add_executable(${AIR_BINARY_NAME} ${SRC_LIST}) -target_link_libraries(${AIR_BINARY_NAME} PUBLIC ${GATEWAY_TARGET} ${RPC_TARGET} ${INIT_LIB} ${HELPER_TARGET} TCMalloc) \ No newline at end of file +target_link_libraries(${AIR_BINARY_NAME} PUBLIC ${GATEWAY_TARGET} ${RPC_TARGET} ${INIT_LIB} ${HELPER_TARGET}) \ No newline at end of file diff --git a/cpp/wedpr-main/pro-node/CMakeLists.txt b/cpp/wedpr-main/pro-node/CMakeLists.txt index f83f6c10..b4745a32 100644 --- a/cpp/wedpr-main/pro-node/CMakeLists.txt +++ b/cpp/wedpr-main/pro-node/CMakeLists.txt @@ -3,4 +3,4 @@ include_directories(${CMAKE_SOURCE_DIR}) aux_source_directory(./ SRC_LIST) add_executable(${PRO_BINARY_NAME} ${SRC_LIST}) -target_link_libraries(${PRO_BINARY_NAME} ${RPC_TARGET} ${INIT_LIB} ${HELPER_TARGET} TCMalloc) +target_link_libraries(${PRO_BINARY_NAME} ${RPC_TARGET} ${INIT_LIB} ${HELPER_TARGET}) diff --git a/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt b/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt index a730f0de..edddd805 100644 --- a/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${IO_TARGET} ${SRCS}) # Note: the DataBatch depends on tbb -target_link_libraries(${IO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${BCOS_BOOSTSSL_TARGET} TCMalloc ${HDFS_LIB} ${CPU_FEATURES_LIB}) \ No newline at end of file +target_link_libraries(${IO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} TCMalloc ${HDFS_LIB} ${CPU_FEATURES_LIB}) \ No newline at end of file diff --git a/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt b/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt index ce85047c..165ec620 100644 --- a/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt @@ -4,4 +4,4 @@ add_library(${STORAGE_TARGET} ${SRCS}) find_package(redis++ REQUIRED) find_package(unofficial-mysql-connector-cpp REQUIRED) -target_link_libraries(${STORAGE_TARGET} PUBLIC ${BCOS_BOOSTSSL_TARGET} redis++::redis++_static TCMalloc unofficial::mysql-connector-cpp::connector resolv ${HDFS_LIB}) +target_link_libraries(${STORAGE_TARGET} PUBLIC redis++::redis++_static TCMalloc unofficial::mysql-connector-cpp::connector resolv ${HDFS_LIB}) From 9856b766fdca7e209950f00ee5afb6cad380628e Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 20 Nov 2024 13:17:21 +0800 Subject: [PATCH 4/4] optmize link --- cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/src/ra2018-psi/CMakeLists.txt | 2 +- cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt | 4 ++-- cpp/wedpr-storage/ppc-io/src/CMakeLists.txt | 2 +- cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt index 5b30a110..74fdf391 100644 --- a/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${CM2020_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${CM2020_PSI_TARGET} PUBLIC $) -target_link_libraries(${CM2020_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} TBB::tbb) +target_link_libraries(${CM2020_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${CRYPTO_TARGET} TBB::tbb) diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt index 5f113b46..2affec1b 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${ECDH_CONN_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${ECDH_CONN_PSI_TARGET} PUBLIC $) -target_link_libraries(${ECDH_CONN_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} ${TOOLS_TARGET} ${PROTOBUF_TARGET} TBB::tbb) \ No newline at end of file +target_link_libraries(${ECDH_CONN_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${CRYPTO_TARGET} ${TOOLS_TARGET} ${PROTOBUF_TARGET} TBB::tbb) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt index d0664c59..a1097acd 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/CMakeLists.txt @@ -28,4 +28,4 @@ add_library(${ECDH_MULTI_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${ECDH_MULTI_PSI_TARGET} PUBLIC $) -target_link_libraries(${ECDH_MULTI_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${FRONT_TARGET} ${BCOS_UTILITIES_TARGET} ${TARS_PROTOCOL_TARGET} ${CRYPTO_TARGET} TBB::tbb) \ No newline at end of file +target_link_libraries(${ECDH_MULTI_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${CRYPTO_TARGET} TBB::tbb) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt index bd2bc740..e3876908 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-psi/CMakeLists.txt @@ -1,3 +1,3 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${ECDH_2PC_PSI_TARGET} ${SRCS}) -target_link_libraries(${ECDH_2PC_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} ${TOOLS_TARGET}) \ No newline at end of file +target_link_libraries(${ECDH_2PC_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TOOLS_TARGET}) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt index a0bb25c0..5c029ce3 100644 --- a/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/labeled-psi/CMakeLists.txt @@ -27,4 +27,4 @@ add_library(${LABELED_PSI_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${LABELED_PSI_TARGET} PUBLIC $) -target_link_libraries(${LABELED_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} apsi SEAL::seal Kuku::kuku TBB::tbb) +target_link_libraries(${LABELED_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} apsi SEAL::seal Kuku::kuku TBB::tbb) diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt index 69d9b68e..74d893ce 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/CMakeLists.txt @@ -26,4 +26,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${PSI_FRAMEWORK_TARGET} ${SRCS} ${OUT_TARS_H_LIST}) target_include_directories(${PSI_FRAMEWORK_TARGET} PUBLIC $) -target_link_libraries(${PSI_FRAMEWORK_TARGET} PUBLIC ${FRONT_TARGET} ${IO_TARGET} ${TARS_PROTOCOL_TARGET}) +target_link_libraries(${PSI_FRAMEWORK_TARGET} PUBLIC TCMalloc ${FRONT_TARGET} ${PROTOCOL_TARGET} ${TARS_PROTOCOL_TARGET} ${IO_TARGET}) diff --git a/cpp/wedpr-computing/ppc-psi/src/ra2018-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/src/ra2018-psi/CMakeLists.txt index d38c319b..0d00d3ca 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ra2018-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/src/ra2018-psi/CMakeLists.txt @@ -1,3 +1,3 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${RA2018_PSI_TARGET} ${SRCS}) -target_link_libraries(${RA2018_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TARS_PROTOCOL_TARGET} ${TOOLS_TARGET}) \ No newline at end of file +target_link_libraries(${RA2018_PSI_TARGET} PUBLIC ${PSI_FRAMEWORK_TARGET} ${TOOLS_TARGET}) \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt index ef18c749..327c5bc0 100644 --- a/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/tests/CMakeLists.txt @@ -6,6 +6,6 @@ set(TEST_BINARY_NAME test-ppc-psi) add_executable(${TEST_BINARY_NAME} ${SOURCES}) target_include_directories(${TEST_BINARY_NAME} PRIVATE .) -target_link_libraries(${TEST_BINARY_NAME} ${BS_ECDH_PSI_TARGET} ${ECDH_CONN_PSI_TARGET} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${PROTOCOL_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) -target_link_libraries(${TEST_BINARY_NAME} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${PROTOCOL_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} ${BS_ECDH_PSI_TARGET} ${ECDH_CONN_PSI_TARGET} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} ${RA2018_PSI_TARGET} ${LABELED_PSI_TARGET} ${CM2020_PSI_TARGET} ${ECDH_2PC_PSI_TARGET} ${LABELED_PSI_TARGET} ${CRYPTO_TARGET} ${BOOST_UNIT_TEST}) add_test(NAME test-ppc-psi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME}) \ No newline at end of file diff --git a/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt b/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt index edddd805..7f4be366 100644 --- a/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${IO_TARGET} ${SRCS}) # Note: the DataBatch depends on tbb -target_link_libraries(${IO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} TCMalloc ${HDFS_LIB} ${CPU_FEATURES_LIB}) \ No newline at end of file +target_link_libraries(${IO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${HDFS_LIB} ${CPU_FEATURES_LIB}) \ No newline at end of file diff --git a/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt b/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt index 165ec620..5e21c8da 100644 --- a/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt @@ -4,4 +4,4 @@ add_library(${STORAGE_TARGET} ${SRCS}) find_package(redis++ REQUIRED) find_package(unofficial-mysql-connector-cpp REQUIRED) -target_link_libraries(${STORAGE_TARGET} PUBLIC redis++::redis++_static TCMalloc unofficial::mysql-connector-cpp::connector resolv ${HDFS_LIB}) +target_link_libraries(${STORAGE_TARGET} PUBLIC redis++::redis++_static unofficial::mysql-connector-cpp::connector resolv ${HDFS_LIB})