We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed22b88 commit 514c975Copy full SHA for 514c975
1 file changed
setup.py
@@ -267,6 +267,12 @@ def get_extensions():
267
"-DWITH_CUDA",
268
]
269
extra_link_args = ["-O0", "-g"]
270
+ else:
271
+ # setuptools appends Python's sysconfig CFLAGS (which include -g)
272
+ # to the compile command, leaving ~20 MB of debug info in the
273
+ # extension. Strip symbols at link time in release builds; the
274
+ # dynamic symbol table (needed by dlopen) is unaffected.
275
+ extra_link_args = ["-Wl,-x"] if sys.platform == "darwin" else ["-Wl,-s"]
276
277
extensions_dir = "torchrl/csrc"
278
0 commit comments