Skip to content

Commit 9820bc6

Browse files
committed
Use ld64 linker on Mac OS
1 parent fdbf3aa commit 9820bc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pytensor/link/c/cmodule.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,6 +2379,10 @@ 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+
cxxflags.append("-ld64")
23822386

23832387
if sys.platform == "win32":
23842388
# Workaround for https://github.com/Theano/Theano/issues/4926.
@@ -2612,6 +2616,7 @@ def compile_str(
26122616
cmd.extend(["-o", f"{path_wrapper}{lib_filename}{path_wrapper}"])
26132617
cmd.append(f"{path_wrapper}{cppfilename}{path_wrapper}")
26142618
cmd.extend(GCC_compiler.linking_patch(lib_dirs, libs))
2619+
# cmd.extend(["-Wl,-v", "-v", "-Wl,-ld64"])
26152620
# print >> sys.stderr, 'COMPILING W CMD', cmd
26162621
_logger.debug(f"Running cmd: {' '.join(cmd)}")
26172622

0 commit comments

Comments
 (0)