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

Explicitly link to OpenMP #290

Merged
merged 16 commits into from
Aug 16, 2023
Merged

Explicitly link to OpenMP #290

merged 16 commits into from
Aug 16, 2023

Conversation

xhochy
Copy link
Member

@xhochy xhochy commented Aug 14, 2023

Fixes #220

Checklist

  • Added a CHANGELOG.rst entry

@xhochy xhochy marked this pull request as ready for review August 16, 2023 09:08
@xhochy
Copy link
Member Author

xhochy commented Aug 16, 2023

Manually tested that the produced M1 wheel works.

@xhochy xhochy requested review from jtilly and MarcAntoineSchmidtQC and removed request for MarcAntoineSchmidtQC August 16, 2023 11:40
build_tools/prepare_macos_wheel.sh Show resolved Hide resolved
pyproject.toml Outdated
@@ -45,7 +45,7 @@ before-build = [
]

[tool.cibuildwheel.macos.environment]
LDFLAGS="-Wl,-rpath,$CONDA/envs/build/lib -L$CONDA/envs/build/lib"
LDFLAGS="-Wl,-rpath,$CONDA/envs/build/lib -L$CONDA/envs/build/lib -lomp -ljemalloclocal"
Copy link
Member

Choose a reason for hiding this comment

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

(How) is this related to

tabmat/setup.py

Lines 62 to 86 in fbf7755

elif sys.platform == "darwin":
jemalloc_config = shutil.which("jemalloc-config")
if "JE_INSTALL_SUFFIX" in os.environ:
je_install_suffix = os.environ["JE_INSTALL_SUFFIX"]
elif jemalloc_config is None:
je_install_suffix = ""
else:
pkg_info = (
Path(jemalloc_config).parent.parent / "lib" / "pkgconfig" / "jemalloc.pc"
).read_text()
je_install_suffix = [
i.split("=")[1]
for i in pkg_info.split("\n")
if i.startswith("install_suffix=")
].pop()
allocator_libs = [f"jemalloc{je_install_suffix}"]
extra_compile_args = [
"-Xpreprocessor",
"-fopenmp",
"-O3",
"-ffast-math",
"--std=c++17",
f"-DJEMALLOC_INSTALL_SUFFIX={je_install_suffix}",
]
extra_link_args = ["-lomp"]
?

Copy link
Member Author

Choose a reason for hiding this comment

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

With the fix above, it might work without these flags again. Let's try.

@xhochy xhochy merged commit 44e9a97 into main Aug 16, 2023
12 checks passed
@xhochy xhochy deleted the explicitly-link-omp branch August 16, 2023 13:34
@pavelzw pavelzw mentioned this pull request Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dlopen symbol not found issue with M1 wheel
2 participants