Skip to content

We no longer need suitesparse_graphblas_arm64.h #78

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

Merged
merged 1 commit into from
Mar 31, 2023
Merged
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
25 changes: 13 additions & 12 deletions suitesparse_graphblas/create_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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+")
Expand Down