Skip to content

Commit fe5d98c

Browse files
lucianopazricardoV94
authored andcommitted
Use ld64 linker on Mac OS
1 parent fdbf3aa commit fe5d98c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pytensor/link/c/cmodule.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,6 +2379,14 @@ def join_options(init_part):
23792379
if sys.platform == "darwin":
23802380
# Use the already-loaded python symbols.
23812381
cxxflags.extend(["-undefined", "dynamic_lookup"])
2382+
# XCode15 introduced ld_prime linker. At the time of writing, this linker
2383+
# leads to multiple issues, so we supply a flag to use the older dynamic
2384+
# linker: ld64
2385+
if int(platform.mac_ver()[0].split(".")[0]) >= 15:
2386+
# This might be incorrect. We know that ld_prime was introduced in
2387+
# XCode15, but we don't know if the platform version is aligned with
2388+
# xcode's version.
2389+
cxxflags.append("-ld64")
23822390

23832391
if sys.platform == "win32":
23842392
# Workaround for https://github.com/Theano/Theano/issues/4926.

0 commit comments

Comments
 (0)