Skip to content

Creating library archive with all components #7567

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

Conversation

esteffin
Copy link
Contributor

CBMC is compiled as a collection of static libraries, one per sub-module.

This PR adds a merging step of most submodules into a final libcprover.<version>.a, so that it can be installed and used alone (without requiring its sub-module dependencies).

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/aggregate_dependencies.sh" "${CMAKE_AR}" "$<TARGET_FILE:cprover-api-cpp>" "${DEPENDENCY_TARGETS}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")

set(lib_version 153)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enrico says remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enrico says: done

println!("cargo:rustc-link-lib=static=goto-symex");
println!("cargo:rustc-link-lib=static=pointer-analysis");
for solver_lib in solver_libs {
println!("cargo:rustc-link-lib=static={}", solver_lib);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this bit is correct - do we package in libminisat and cadical in the libcprover we're building?

(Probably, it might be a dependency of solvers/ in any case, but can we check before we merge this?

Copy link
Contributor

@NlightNFotis NlightNFotis Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Okay, answering my own question here - it seems that we're building without issues, at least on the minisat front https://github.com/diffblue/cbmc/actions/runs/4293367669/jobs/7480953774)

Still, I would be a bit apprehensive to remove this for loop. Can we at least comment it out so that we may re-introduce it if we find we need it for radical?

Copy link
Contributor Author

@esteffin esteffin Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SAT solvers (dependency of the solver target) are added to the final API library.
Specifically they are gathered at line 25 of src/libcprover-cpp/CMakeLists.txt when doing get_target_property(LIBRARY_DEPENDENCIES solvers LINK_LIBRARIES), and added afterwards.

For this reason they can be removed from the RUST side.

Enrico Steffinlongo added 5 commits February 28, 2023 18:27
CBMC is compiled as a collection of static libraries, one per
sub-module.  This commits add a merging of most submodules into a final
libcprover.<version>.a, so that it can be installed and used alone (without
requiring its sub-module dependencies).
@esteffin esteffin force-pushed the esteffin/creating-public-archive-with-all-components branch from 5cc5b62 to cf4817f Compare February 28, 2023 18:31
@esteffin esteffin merged commit b0dc2ea into diffblue:develop Mar 1, 2023
@esteffin esteffin deleted the esteffin/creating-public-archive-with-all-components branch March 1, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants