Skip to content

Commit

Permalink
Fix up 🤦
Browse files Browse the repository at this point in the history
  • Loading branch information
cjw85 committed Aug 9, 2023
1 parent 1e6256d commit 52394b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ for VER in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311; do
"${PYBIN}/python3" -m venv venv3
source venv3/bin/activate
"${PYBIN}/python3" -m pip install --upgrade pip
"${PYBIN}/python3" -m pip install cmake==3.27.1 scikit-build
"${PYBIN}/python3" -m pip wheel . -w dist
make clean
deactivate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: publish-pyspao
name: publish-pyspoa

on:
push:
Expand Down
20 changes: 13 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
from setuptools.command.install import install
from setuptools.command.build_ext import build_ext

LIB_SPOA = 'src/build/lib/libspoa.a'
if os.environ.get('libspoa'):
LIB_SPOA = os.environ['libspoa']


class get_pybind_include(object):
"""
Expand Down Expand Up @@ -58,12 +62,13 @@ def build_spoa():
bdir = "src/build"
rmtree(bdir, ignore_errors=True)
os.makedirs(bdir)
extra_flags = []
# x86 -- builds with -msse4.1 instead of -march=native
extra_flags = ["-D", "spoa_optimize_for_portability=ON"]
if platform.machine() in {"aarch64", "arm64"}:
["-D", "spoa_use_simde=ON", "-D", "spoa_use_simde_nonvec=ON", "-D", "spoa_use_simde_openmp=ON"]
else:
# x86 -- builds with -msse4.1 instead of -march=native
["-D", "spoa_optimize_for_portability=ON"]
extra_flags = [
"-D", "spoa_use_simde=ON",
"-D", "spoa_use_simde_nonvec=ON",
"-D", "spoa_use_simde_openmp=ON"]
run(
["cmake"] + extra_flags + [
"-D", "CMAKE_BUILD_TYPE=Release",
Expand Down Expand Up @@ -91,7 +96,8 @@ class BuildExt(build_ext):
l_opts['unix'] += darwin_opts

def build_extensions(self):
build_spoa()
if not os.environ.get('libspoa'):
build_spoa()
ct = self.compiler.compiler_type
opts = self.c_opts.get(ct, [])
link_opts = self.l_opts.get(ct, [])
Expand Down Expand Up @@ -120,7 +126,7 @@ def build_extensions(self):
],
language='c++',
extra_objects=[
'src/build/lib/libspoa.a'
LIB_SPOA
],

),
Expand Down

0 comments on commit 52394b0

Please sign in to comment.