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

Optimize compilation #200

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/clang-linux-nix-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
nix build -L .?#checks.x86_64-linux.crypto3-clang
env:
NIX_CONFIG: |
cores = 4
cores = 16

- name: Run all checks
# This includes cached crypto3 check from previous step. We don't limit cores in this part
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/clang-sanitizers-linux-nix-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ jobs:
nix build -L .?#checks.x86_64-linux.all-clang-sanitize
mkdir results
cp result/test-logs/*_test.xml results/
continue-on-error: true
env:
NIX_CONFIG: |
cores = 4
cores = 16

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/gcc-linux-nix-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ jobs:
nix build -L .?#checks.x86_64-linux.crypto3-gcc
env:
NIX_CONFIG: |
cores = 4

cores = 16
- name: Run all checks
# This includes cached crypto3 check from previous step. We don't limit cores in this part
run: |
nix build -L .?#checks.x86_64-linux.all-gcc
mkdir results
cp result/test-logs/*_test.xml results/
env:
NIX_CONFIG: |
cores = 16

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/parallel-crypto3")
Expand Down
4 changes: 3 additions & 1 deletion crypto3/libs/algebra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)

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)
Expand Down
4 changes: 1 addition & 3 deletions crypto3/libs/algebra/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion crypto3/libs/blueprint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)

target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE
${Boost_LIBRARIES}
Boost::container
)
include(CMTest)
add_tests(test)
Expand Down
3 changes: 1 addition & 2 deletions crypto3/libs/blueprint/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion crypto3/libs/blueprint/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ if(BLUEPRINT_PLACEHOLDER_PROOF_GEN)
endif()

cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}
${${CURRENT_PROJECT_NAME}_INTERFACE_LIBRARIES}
crypto3::blueprint
crypto3::algebra
crypto3::zk
crypto3::random
crypto3::hash
Boost::unit_test_framework
)
set_target_properties(_cm_internal_tests-crypto3-blueprint-test PROPERTIES CXX_STANDARD 20)
target_precompile_headers(_cm_internal_tests-crypto3-blueprint-test REUSE_FROM crypto3_precompiled_headers)
Expand Down
5 changes: 2 additions & 3 deletions crypto3/libs/hash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down
1 change: 1 addition & 0 deletions crypto3/libs/marshalling/zk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crypto3/libs/transpiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)

target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE
${Boost_LIBRARIES})
Boost::container)

include(CMTest)
add_tests(test)
Expand Down
3 changes: 2 additions & 1 deletion crypto3/libs/transpiler/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion parallel-crypto3/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions parallel-crypto3/libs/parallel-containers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion parallel-crypto3/libs/parallelization-utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER
$<$<BOOL:${Boost_FOUND}>:${Boost_INCLUDE_DIRS}>)

target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE
${Boost_LIBRARIES})
Boost::container)

add_tests(test)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion proof-producer/bin/proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions proof-producer/libs/output_artifacts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ endif()
target_link_libraries(proof_generatorOutputArtifacts
PUBLIC
crypto3::common
Boost::program_options
Boost::log
)

Expand All @@ -25,9 +26,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})

Expand Down
6 changes: 2 additions & 4 deletions proof-producer/tests/libs/output_artifacts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading