Skip to content

Commit 050c1d2

Browse files
committed
update c-cpp.yml && call Z3 with C++ API instead
1 parent 78a3753 commit 050c1d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+29632
-13
lines changed

.github/workflows/c-cpp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- run: sudo apt-get install libboost-filesystem-dev libboost-test-dev z3
2121
- run: git clone https://github.com/alan23273850/AutoQ.git
22-
- run: cd AutoQ && git checkout CTA_topdown && mkdir build && make debug
22+
- run: cd AutoQ && git checkout ${{ github.ref_name }} && mkdir build && make debug
2323
- run: cp /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.74.0 /home/runner/work/AutoQ/AutoQ/AutoQ/build/unit_tests/
2424
- uses: actions/upload-artifact@v4
2525
with:
@@ -42,7 +42,7 @@ jobs:
4242
steps:
4343
- run: sudo apt-get install libboost-filesystem-dev libboost-test-dev z3
4444
- run: git clone https://github.com/alan23273850/AutoQ.git
45-
- run: cd AutoQ && git checkout CTA_topdown && mkdir build && make release
45+
- run: cd AutoQ && git checkout ${{ github.ref_name }} && mkdir build && make release
4646
- run: cp /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.74.0 /home/runner/work/AutoQ/AutoQ/AutoQ/build/unit_tests/
4747
- uses: actions/upload-artifact@v4
4848
with:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++20")
143143
# PROJECT
144144
##############################################################################
145145

146-
project(libautoq)
146+
project(autoq)
147147

148148
# Include CTest so that sophisticated testing can be done now
149149
include(CTest)

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ MAKE_FLAGS=-j64
33
# TEST_FLAGS=-j 8
44
TEST_FLAGS=--output-on-failure
55

6-
.PHONY: debug release clean test
6+
.PHONY: debug release clean test create_folder
77

8-
debug:
8+
create_folder:
9+
@mkdir -p $(BUILD_DIR)
10+
11+
debug: create_folder
912
cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug .. && $(MAKE) $(MAKE_FLAGS)
1013

11-
release:
14+
release: create_folder
1215
cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Release .. && $(MAKE) $(MAKE_FLAGS)
1316

14-
test:
17+
test: create_folder
1518
cd $(BUILD_DIR) && ctest $(TEST_FLAGS)
1619

17-
clean:
20+
clean: create_folder
1821
cd $(BUILD_DIR) && rm -rf *

include/z3/CMakeLists.txt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
set(generated_files
2+
api_commands.cpp
3+
api_log_macros.cpp
4+
api_log_macros.h
5+
)
6+
7+
# Sanity check
8+
foreach (gen_file ${generated_files})
9+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${gen_file}")
10+
message(FATAL_ERROR "\"${CMAKE_CURRENT_SOURCE_DIR}/${gen_file}\""
11+
${z3_polluted_tree_msg})
12+
endif()
13+
endforeach()
14+
15+
set(full_path_generated_files "")
16+
foreach (gen_file ${generated_files})
17+
list(APPEND full_path_generated_files "${CMAKE_CURRENT_BINARY_DIR}/${gen_file}")
18+
endforeach()
19+
20+
add_custom_command(OUTPUT ${generated_files}
21+
COMMAND "${Python3_EXECUTABLE}"
22+
"${PROJECT_SOURCE_DIR}/scripts/update_api.py"
23+
${Z3_FULL_PATH_API_HEADER_FILES_TO_SCAN}
24+
"--api_output_dir"
25+
"${CMAKE_CURRENT_BINARY_DIR}"
26+
DEPENDS "${PROJECT_SOURCE_DIR}/scripts/update_api.py"
27+
${Z3_GENERATED_FILE_EXTRA_DEPENDENCIES}
28+
${Z3_FULL_PATH_API_HEADER_FILES_TO_SCAN}
29+
COMMENT "Generating ${generated_files}"
30+
USES_TERMINAL
31+
VERBATIM
32+
)
33+
34+
z3_add_component(api
35+
SOURCES
36+
api_algebraic.cpp
37+
api_arith.cpp
38+
api_array.cpp
39+
api_ast.cpp
40+
api_ast_map.cpp
41+
api_ast_vector.cpp
42+
api_bv.cpp
43+
api_config_params.cpp
44+
api_context.cpp
45+
api_datalog.cpp
46+
api_datatype.cpp
47+
api_fpa.cpp
48+
api_goal.cpp
49+
api_log.cpp
50+
api_model.cpp
51+
api_numeral.cpp
52+
api_opt.cpp
53+
api_params.cpp
54+
api_parsers.cpp
55+
api_pb.cpp
56+
api_polynomial.cpp
57+
api_qe.cpp
58+
api_quant.cpp
59+
api_rcf.cpp
60+
api_seq.cpp
61+
api_solver.cpp
62+
api_special_relations.cpp
63+
api_stats.cpp
64+
api_tactic.cpp
65+
z3_replayer.cpp
66+
${full_path_generated_files}
67+
COMPONENT_DEPENDENCIES
68+
opt
69+
portfolio
70+
realclosure
71+
extra_cmds
72+
)

0 commit comments

Comments
 (0)