From 40fd47ddc8af3004107517cd54e05789dc9bba5d Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 31 Mar 2023 09:20:20 -0500 Subject: [PATCH] We no longer need suitesparse_graphblas_arm64.h (#78) --- suitesparse_graphblas/create_headers.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 8e973a3..cd9c0b9 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -799,7 +799,7 @@ def main(): # final files used by cffi (with and without complex numbers) final_h = os.path.join(thisdir, "suitesparse_graphblas.h") - final_arm64_h = os.path.join(thisdir, "suitesparse_graphblas_arm64.h") + # final_arm64_h = os.path.join(thisdir, "suitesparse_graphblas_arm64.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") @@ -827,30 +827,31 @@ def main(): with open(final_h, "w") as f: f.write("\n".join(text) + "\n") - # Create final header file (arm64) - # Replace all variadic arguments (...) with "char *" - print(f"Step 4: parse header file to create {final_arm64_h}") - orig_text = text - patt = re.compile(r"^(extern GrB_Info .*\(.*)(\.\.\.)(\);)$") - text = [patt.sub(r"\1char *\3", line) for line in orig_text] - with open(final_arm64_h, "w") as f: - f.write("\n".join(text) + "\n") + # NOTE:suitesparse_graphblas.h and suitesparse_graphblas_arm64.h are the same now + # # Create final header file (arm64) + # # Replace all variadic arguments (...) with "char *" + # print(f"Step 4: parse header file to create {final_arm64_h}") + # orig_text = text + # patt = re.compile(r"^(extern GrB_Info .*\(.*)(\.\.\.)(\);)$") + # text = [patt.sub(r"\1char *\3", line) for line in orig_text] + # with open(final_arm64_h, "w") as f: + # f.write("\n".join(text) + "\n") # Create final header file (no complex) - print(f"Step 5: parse header file to create {final_no_complex_h}") + print(f"Step 4: parse header file to create {final_no_complex_h}") groups_no_complex = parse_header(processed_h, skip_complex=True) text = create_header_text(groups_no_complex) with open(final_no_complex_h, "w") as f: f.write("\n".join(text) + "\n") # Create source - print(f"Step 6: create {source_c}") + print(f"Step 5: create {source_c}") text = create_source_text(groups) with open(source_c, "w") as f: f.write("\n".join(text) + "\n") # Check defines - print("Step 7: check #define definitions") + print("Step 6: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+")