Skip to content

Commit

Permalink
Merge pull request #315 from Mamba413/master
Browse files Browse the repository at this point in the history
fix issues #310
  • Loading branch information
Mamba413 committed Jan 20, 2022
2 parents 58b5dd4 + de323a7 commit b5f8d98
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ bess.egg-info/*
test/*
dist/*
abess/__pycache__/*

.eggs/*
docs/build/*
24 changes: 16 additions & 8 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import platform
from setuptools import setup, find_packages, Extension, dist

dist.Distribution().fetch_build_eggs(['numpy'])
Expand Down Expand Up @@ -50,8 +51,20 @@
)
elif sys.platform.startswith('darwin'):
eigen_path = CURRENT_DIR + "/include"
# print(eigen_path)
# eigen_path = "/usr/local/include/eigen3/Eigen"

## compatible compile args with M1 chip:
extra_compile_args = [
"-DNDEBUG", "-O2",
"-Wall", "-std=c++11",
]
m1chip_unable_extra_compile_args=[
"-mavx", "-mfma",
"-march=native"
]
if platform.processor() != 'arm':
extra_compile_args.extend(m1chip_unable_extra_compile_args)
pass

cabess_module = Extension(
name='abess._cabess',
sources=[CURRENT_DIR + '/src/api.cpp',
Expand All @@ -61,12 +74,7 @@
CURRENT_DIR + '/src/pywrap.cpp',
CURRENT_DIR + '/src/pywrap.i'],
language='c++',
extra_compile_args=[
"-DNDEBUG", "-O2",
"-Wall", "-std=c++11",
"-mavx", "-mfma",
"-march=native"
],
extra_compile_args=extra_compile_args,
include_dirs=[
numpy.get_include(),
eigen_path
Expand Down

0 comments on commit b5f8d98

Please sign in to comment.