mirror of
https://github.com/facebookresearch/fairseq.git
synced 2024-08-17 04:20:36 +03:00
Add specific compile flags for macOS (#862)
Summary: Fairseq wouldn't install on macOS. A workaround was found here: https://github.com/pytorch/fairseq/issues/289 This is now automatic in setup.py, maybe be there's a cleaner way to do it. I checked that it compiles fine on Linux and macOS. Pull Request resolved: https://github.com/pytorch/fairseq/pull/862 Differential Revision: D16142105 Pulled By: myleott fbshipit-source-id: 998ac7781d7a1ac047f4f9239c1fe16eab4be0dd
This commit is contained in:
parent
5c241c8c5f
commit
cc292afaed
7
setup.py
7
setup.py
@ -16,14 +16,17 @@ if sys.version_info < (3,):
|
||||
with open('README.md') as f:
|
||||
readme = f.read()
|
||||
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
extra_compile_args = ['-stdlib=libc++']
|
||||
else:
|
||||
extra_compile_args = ['-std=c++11']
|
||||
bleu = Extension(
|
||||
'fairseq.libbleu',
|
||||
sources=[
|
||||
'fairseq/clib/libbleu/libbleu.cpp',
|
||||
'fairseq/clib/libbleu/module.cpp',
|
||||
],
|
||||
extra_compile_args=['-std=c++11'],
|
||||
extra_compile_args=extra_compile_args,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user