Skip to content

Commit

Permalink
Fix Mac OSX build (#56)
Browse files Browse the repository at this point in the history
Summary:
Properly determine if we are on Mac or now and add linker flags
Pull Request resolved: #56

Differential Revision: D19330182

Pulled By: lematt1991

fbshipit-source-id: f9651a47d8981a9341f4f19c30663cb5462d114b
  • Loading branch information
lematt1991 authored and facebook-github-bot committed Jan 9, 2020
1 parent 5f46504 commit b07b787
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,32 @@
from distutils.extension import Extension
from subprocess import check_output
from distutils import sysconfig
import re
import sys

extra_compile_args = ['-std=c++11']
extra_link_args = []

# Super hacky way of determining if clang or gcc is being used
CC = sysconfig.get_config_vars().get('CC', 'gcc').split(' ')[0]
out = check_output([CC, '--version'])
if re.search('apple *llvm', str(out.lower())):
extra_compile_args.append('-stdlib=libc++')
if sys.platform == 'darwin':
extra_compile_args = ["-stdlib=libc++"]
extra_link_args=['-stdlib=libc++']

extensions = [
Extension(
"hype.graph_dataset",
["hype/graph_dataset.pyx"],
include_dirs=[numpy.get_include()],
extra_link_args=extra_link_args,
extra_compile_args=extra_compile_args,
language='c++',
),
Extension(
"hype.adjacency_matrix_dataset",
["hype/adjacency_matrix_dataset.pyx"],
include_dirs=[numpy.get_include()],
extra_link_args=extra_link_args,
extra_compile_args=extra_compile_args,
language='c++',
),
Expand Down

0 comments on commit b07b787

Please sign in to comment.