From 960806a7c44d9d8ee7ee5e60d016796a95df0f58 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Thu, 12 Dec 2024 13:32:55 +0100 Subject: [PATCH] use the same precompiled header for all proof-producer binaries --- CMakeLists.txt | 10 ---------- crypto3/libs/algebra/CMakeLists.txt | 4 +++- crypto3/libs/algebra/test/CMakeLists.txt | 4 +--- crypto3/libs/blueprint/example/CMakeLists.txt | 3 +-- crypto3/libs/hash/CMakeLists.txt | 5 ++--- crypto3/libs/marshalling/zk/CMakeLists.txt | 1 + crypto3/libs/transpiler/CMakeLists.txt | 2 +- crypto3/libs/transpiler/test/CMakeLists.txt | 3 ++- parallel-crypto3/benchmarks/CMakeLists.txt | 3 ++- .../libs/parallel-containers/CMakeLists.txt | 4 +--- .../libs/parallel-containers/example/CMakeLists.txt | 4 ++-- .../libs/parallel-containers/test/CMakeLists.txt | 4 +++- .../libs/parallelization-utils/CMakeLists.txt | 2 +- .../libs/parallelization-utils/test/CMakeLists.txt | 4 +++- proof-producer/CMakeLists.txt | 2 +- proof-producer/bin/proof-producer/CMakeLists.txt | 3 ++- proof-producer/libs/output_artifacts/CMakeLists.txt | 5 +---- .../tests/libs/output_artifacts/CMakeLists.txt | 6 ++---- zkevm-framework/libs/json_helpers/CMakeLists.txt | 2 +- zkevm-framework/libs/rpc/CMakeLists.txt | 2 +- 20 files changed, 31 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3610c59698..9849b215dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,16 +30,6 @@ set_target_properties(crypto3_precompiled_headers PROPERTIES CXX_STANDARD_REQUIRED TRUE ) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated-dummy-23.cpp) -add_library(crypto3_precompiled_headers_23 STATIC ${CMAKE_CURRENT_BINARY_DIR}/generated-dummy-23.cpp) -set_target_properties(crypto3_precompiled_headers_23 PROPERTIES - LINKER_LANGUAGE CXX - EXPORT_NAME proof_generatorOutputArtifacts - CXX_STANDARD 23 - CXX_STANDARD_REQUIRED TRUE -) -# End of precompiled headers - add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/crypto3") if ((${PARALLEL_CRYPTO3_ENABLE}) OR (${PROOF_PRODUCER_ENABLE}) OR (${ZKEVM_FRAMEWORK_ENABLE})) add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/parallel-crypto3") diff --git a/crypto3/libs/algebra/CMakeLists.txt b/crypto3/libs/algebra/CMakeLists.txt index 2f4058de27..3c603a7c86 100644 --- a/crypto3/libs/algebra/CMakeLists.txt +++ b/crypto3/libs/algebra/CMakeLists.txt @@ -33,7 +33,9 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $) target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${CMAKE_WORKSPACE_NAME}::multiprecision) + ${CMAKE_WORKSPACE_NAME}::multiprecision + Boost::random +) include(CMTest) add_tests(test) diff --git a/crypto3/libs/algebra/test/CMakeLists.txt b/crypto3/libs/algebra/test/CMakeLists.txt index 1e82edd035..2140872daa 100644 --- a/crypto3/libs/algebra/test/CMakeLists.txt +++ b/crypto3/libs/algebra/test/CMakeLists.txt @@ -7,9 +7,7 @@ #---------------------------------------------------------------------------# cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - - Boost::unit_test_framework - Boost::random) + Boost::unit_test_framework) add_custom_target(algebra_runtime_tests) diff --git a/crypto3/libs/blueprint/example/CMakeLists.txt b/crypto3/libs/blueprint/example/CMakeLists.txt index a50be63a96..0043c270d2 100644 --- a/crypto3/libs/blueprint/example/CMakeLists.txt +++ b/crypto3/libs/blueprint/example/CMakeLists.txt @@ -20,8 +20,7 @@ macro(define_blueprint_example name) ${CMAKE_WORKSPACE_NAME}::hash ${CMAKE_WORKSPACE_NAME}::multiprecision ${CMAKE_WORKSPACE_NAME}::zk - - ${Boost_LIBRARIES}) + ) set_target_properties(${full_example_name} PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED TRUE) endmacro() diff --git a/crypto3/libs/hash/CMakeLists.txt b/crypto3/libs/hash/CMakeLists.txt index 98b74a7dcc..91a37df19a 100644 --- a/crypto3/libs/hash/CMakeLists.txt +++ b/crypto3/libs/hash/CMakeLists.txt @@ -145,10 +145,9 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${${CURRENT_PROJECT_NAME}_INTERFACE_LIBRARIES} ${CMAKE_WORKSPACE_NAME}::multiprecision ${CMAKE_WORKSPACE_NAME}::algebra - Boost::container) -target_link_libraries(crypto3_precompiled_headers ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) -target_link_libraries(crypto3_precompiled_headers_23 ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) + +target_link_libraries(crypto3_precompiled_headers ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE "$" diff --git a/crypto3/libs/marshalling/zk/CMakeLists.txt b/crypto3/libs/marshalling/zk/CMakeLists.txt index 9d331374c5..817355413e 100644 --- a/crypto3/libs/marshalling/zk/CMakeLists.txt +++ b/crypto3/libs/marshalling/zk/CMakeLists.txt @@ -26,6 +26,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE Boost::container + Boost::random crypto3::multiprecision crypto3::algebra diff --git a/crypto3/libs/transpiler/CMakeLists.txt b/crypto3/libs/transpiler/CMakeLists.txt index 795c7b4964..9170ea5c14 100644 --- a/crypto3/libs/transpiler/CMakeLists.txt +++ b/crypto3/libs/transpiler/CMakeLists.txt @@ -25,7 +25,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $) target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES}) + Boost::container) include(CMTest) add_tests(test) diff --git a/crypto3/libs/transpiler/test/CMakeLists.txt b/crypto3/libs/transpiler/test/CMakeLists.txt index 1e9efa2d84..6550755099 100644 --- a/crypto3/libs/transpiler/test/CMakeLists.txt +++ b/crypto3/libs/transpiler/test/CMakeLists.txt @@ -16,7 +16,8 @@ cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} crypto3::math crypto3::random crypto3::zk - ${Boost_LIBRARIES}) + Boost::unit_test_framework +) set_target_properties(_cm_internal_tests-crypto3-transpiler-test PROPERTIES CXX_STANDARD 20) target_precompile_headers(_cm_internal_tests-crypto3-transpiler-test REUSE_FROM crypto3_precompiled_headers) diff --git a/parallel-crypto3/benchmarks/CMakeLists.txt b/parallel-crypto3/benchmarks/CMakeLists.txt index 7df3c5efb2..6d7ed4fa39 100644 --- a/parallel-crypto3/benchmarks/CMakeLists.txt +++ b/parallel-crypto3/benchmarks/CMakeLists.txt @@ -43,7 +43,8 @@ cm_test_link_libraries( crypto3::math crypto3::multiprecision crypto3::random - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::timer ) set_target_properties(_cm_internal_tests--parallel-crypto3-benchmarks PROPERTIES CXX_STANDARD 20) target_precompile_headers(_cm_internal_tests--parallel-crypto3-benchmarks REUSE_FROM crypto3_precompiled_headers) diff --git a/parallel-crypto3/libs/parallel-containers/CMakeLists.txt b/parallel-crypto3/libs/parallel-containers/CMakeLists.txt index 447e538795..a3893bdf58 100644 --- a/parallel-crypto3/libs/parallel-containers/CMakeLists.txt +++ b/parallel-crypto3/libs/parallel-containers/CMakeLists.txt @@ -65,9 +65,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::core crypto3::algebra - crypto3::hash - - ${Boost_LIBRARIES}) + crypto3::hash) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE "$" diff --git a/parallel-crypto3/libs/parallel-containers/example/CMakeLists.txt b/parallel-crypto3/libs/parallel-containers/example/CMakeLists.txt index 577cf0342f..1c949653b1 100644 --- a/parallel-crypto3/libs/parallel-containers/example/CMakeLists.txt +++ b/parallel-crypto3/libs/parallel-containers/example/CMakeLists.txt @@ -35,8 +35,8 @@ macro(define_containers_example example) add_executable(${target_name} ${example}.cpp) target_link_libraries(${target_name} PRIVATE ${CMAKE_WORKSPACE_NAME}::algebra - ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + ${CMAKE_WORKSPACE_NAME}::hash) + set_target_properties(${target_name} PROPERTIES CXX_STANDARD 20) endmacro() diff --git a/parallel-crypto3/libs/parallel-containers/test/CMakeLists.txt b/parallel-crypto3/libs/parallel-containers/test/CMakeLists.txt index 5ccc9c396b..259cfda1c4 100644 --- a/parallel-crypto3/libs/parallel-containers/test/CMakeLists.txt +++ b/parallel-crypto3/libs/parallel-containers/test/CMakeLists.txt @@ -28,7 +28,9 @@ include(CMTest) cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} crypto3::algebra crypto3::hash - Boost::random) + Boost::random + Boost::unit_test_framework +) set_target_properties(_cm_internal_tests-actor-containers-test PROPERTIES CXX_STANDARD 20) target_precompile_headers(_cm_internal_tests-actor-containers-test REUSE_FROM crypto3_precompiled_headers) diff --git a/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt b/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt index 96354625e5..64a15124e4 100644 --- a/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt +++ b/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt @@ -57,7 +57,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES}) + Boost::container) add_tests(test) diff --git a/parallel-crypto3/libs/parallelization-utils/test/CMakeLists.txt b/parallel-crypto3/libs/parallelization-utils/test/CMakeLists.txt index 6862d1cf7e..4656ac9944 100644 --- a/parallel-crypto3/libs/parallelization-utils/test/CMakeLists.txt +++ b/parallel-crypto3/libs/parallelization-utils/test/CMakeLists.txt @@ -13,7 +13,9 @@ if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) endif() cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES}) + Boost::container + Boost::unit_test_framework +) macro(define_actor_core_test name) set(test_name "actor_core_${name}_test") diff --git a/proof-producer/CMakeLists.txt b/proof-producer/CMakeLists.txt index cec7d23ec6..c4671d636e 100644 --- a/proof-producer/CMakeLists.txt +++ b/proof-producer/CMakeLists.txt @@ -74,10 +74,10 @@ endif() set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/output_artifacts") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/preset") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/assigner") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/bin/proof-producer") -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/output_artifacts") if (ENABLE_TESTS) enable_testing() diff --git a/proof-producer/bin/proof-producer/CMakeLists.txt b/proof-producer/bin/proof-producer/CMakeLists.txt index 00f262f40b..fccd812e5a 100644 --- a/proof-producer/bin/proof-producer/CMakeLists.txt +++ b/proof-producer/bin/proof-producer/CMakeLists.txt @@ -84,10 +84,11 @@ endfunction() set(SINGLE_THREADED_TARGET "${CURRENT_PROJECT_NAME}-single-threaded") setup_proof_generator_target(TARGET_NAME ${SINGLE_THREADED_TARGET} ADDITIONAL_DEPENDENCIES crypto3::all) +target_precompile_headers(${SINGLE_THREADED_TARGET} REUSE_FROM proof_generatorOutputArtifacts) set(MULTI_THREADED_TARGET "${CURRENT_PROJECT_NAME}-multi-threaded") setup_proof_generator_target(TARGET_NAME ${MULTI_THREADED_TARGET} ADDITIONAL_DEPENDENCIES parallel-crypto3::all crypto3::common) -target_precompile_headers(${MULTI_THREADED_TARGET} REUSE_FROM ${SINGLE_THREADED_TARGET}) +target_precompile_headers(${MULTI_THREADED_TARGET} REUSE_FROM proof_generatorOutputArtifacts) # Install install(TARGETS ${SINGLE_THREADED_TARGET} RUNTIME DESTINATION bin) diff --git a/proof-producer/libs/output_artifacts/CMakeLists.txt b/proof-producer/libs/output_artifacts/CMakeLists.txt index d4b9ffa01b..ddce569ae4 100644 --- a/proof-producer/libs/output_artifacts/CMakeLists.txt +++ b/proof-producer/libs/output_artifacts/CMakeLists.txt @@ -15,7 +15,7 @@ endif() target_link_libraries(proof_generatorOutputArtifacts PUBLIC crypto3::common - Boost::log + Boost::program_options ) set_target_properties(proof_generatorOutputArtifacts PROPERTIES @@ -25,9 +25,6 @@ set_target_properties(proof_generatorOutputArtifacts PROPERTIES CXX_STANDARD_REQUIRED TRUE ) -# TODO: reactivate, when it will be a static library -# target_precompile_headers(proof_generatorOutputArtifacts REUSE_FROM crypto3_precompiled_headers_23) - install(TARGETS proof_generatorOutputArtifacts DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/proof-producer/tests/libs/output_artifacts/CMakeLists.txt b/proof-producer/tests/libs/output_artifacts/CMakeLists.txt index c4ff1172b2..47fbe7c8a1 100644 --- a/proof-producer/tests/libs/output_artifacts/CMakeLists.txt +++ b/proof-producer/tests/libs/output_artifacts/CMakeLists.txt @@ -34,10 +34,8 @@ function(add_output_artifacts_test target) crypto3::common ) - if (NOT target STREQUAL "test_range") - target_precompile_headers(${target}_single_thread REUSE_FROM test_range_single_thread) - endif() - target_precompile_headers(${target}_multi_thread REUSE_FROM test_range_single_thread) + target_precompile_headers(${target}_single_thread REUSE_FROM proof_generatorOutputArtifacts) + target_precompile_headers(${target}_multi_thread REUSE_FROM proof_generatorOutputArtifacts) add_dependencies(tests_output_artifacts_single_thread ${target}_single_thread) add_dependencies(tests_output_artifacts_multi_thread ${target}_multi_thread) diff --git a/zkevm-framework/libs/json_helpers/CMakeLists.txt b/zkevm-framework/libs/json_helpers/CMakeLists.txt index 45ac97e8a2..9e5a82caf2 100644 --- a/zkevm-framework/libs/json_helpers/CMakeLists.txt +++ b/zkevm-framework/libs/json_helpers/CMakeLists.txt @@ -2,7 +2,7 @@ find_package(valijson REQUIRED) find_package(Boost COMPONENTS REQUIRED json) add_library(zkEVMJsonHelpers SHARED json_helpers.cpp) -target_link_libraries(zkEVMJsonHelpers PUBLIC ${Boost_LIBRARIES} PRIVATE valijson) +target_link_libraries(zkEVMJsonHelpers PUBLIC Boost::container PRIVATE valijson) target_include_directories(zkEVMJsonHelpers PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_compile_features(zkEVMJsonHelpers PUBLIC cxx_std_23) # It seems like exceptions is the only way to catch errors in valijson diff --git a/zkevm-framework/libs/rpc/CMakeLists.txt b/zkevm-framework/libs/rpc/CMakeLists.txt index 11132107c1..299dbd9c6f 100644 --- a/zkevm-framework/libs/rpc/CMakeLists.txt +++ b/zkevm-framework/libs/rpc/CMakeLists.txt @@ -1,7 +1,7 @@ add_library(zkEVMRpc SHARED data_extractor.cpp) find_package(Boost COMPONENTS REQUIRED json log) -target_link_libraries(zkEVMRpc PUBLIC NilCore ${Boost_LIBRARIES} zkEVMJsonHelpers) +target_link_libraries(zkEVMRpc PUBLIC NilCore Boost::container zkEVMJsonHelpers) target_include_directories(zkEVMRpc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include)