adding static linking on binary builds

This commit is contained in:
soumith 2016-09-11 01:55:10 -04:00 committed by soumith
parent 1f2695e875
commit 65d4055366

View File

@ -118,6 +118,10 @@ class clean(distutils.command.clean.clean):
include_dirs = []
extra_link_args = []
extra_compile_args = ['-std=c++11', '-Wno-write-strings']
if os.getenv('PYTORCH_BINARY_BUILD') and platform.system() == 'Linux':
print('PYTORCH_BINARY_BUILD found. Static linking libstdc++ on Linux')
extra_compile_args += ['-static-libstdc++']
extra_link_args += ['-static-libstdc++']
cwd = os.path.dirname(os.path.abspath(__file__))
lib_path = os.path.join(cwd, "torch", "lib")