"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "be4ff9a37831c5bee9392bb403a1228131167972"
Commit cc292afa authored by Louis MARTIN's avatar Louis MARTIN Committed by Facebook Github Bot
Browse files

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
parent 5c241c8c
...@@ -16,14 +16,17 @@ if sys.version_info < (3,): ...@@ -16,14 +16,17 @@ if sys.version_info < (3,):
with open('README.md') as f: with open('README.md') as f:
readme = f.read() readme = f.read()
if sys.platform == 'darwin':
extra_compile_args = ['-stdlib=libc++']
else:
extra_compile_args = ['-std=c++11']
bleu = Extension( bleu = Extension(
'fairseq.libbleu', 'fairseq.libbleu',
sources=[ sources=[
'fairseq/clib/libbleu/libbleu.cpp', 'fairseq/clib/libbleu/libbleu.cpp',
'fairseq/clib/libbleu/module.cpp', 'fairseq/clib/libbleu/module.cpp',
], ],
extra_compile_args=['-std=c++11'], extra_compile_args=extra_compile_args,
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment