Skip to content

Commit

Permalink
Add specific compile flags for macOS (facebookresearch#862)
Browse files Browse the repository at this point in the history
Summary:
Fairseq wouldn't install on macOS.
A workaround was found here: facebookresearch#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: facebookresearch#862

Differential Revision: D16142105

Pulled By: myleott

fbshipit-source-id: 998ac7781d7a1ac047f4f9239c1fe16eab4be0dd
  • Loading branch information
louismartin authored and facebook-github-bot committed Jul 6, 2019
1 parent 5c241c8 commit cc292af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
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,
)


Expand Down

0 comments on commit cc292af

Please sign in to comment.