Skip to content

Commit fd66618

Browse files
authored
Merge pull request #143 from pycompression/furthersimplifybuild
Do not use autotools for unix build
2 parents 2db9740 + 0898c81 commit fd66618

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- "3.8"
6262
- "3.9"
6363
- "3.10"
64-
- "3.11-dev"
64+
- "3.11"
6565
- "pypy-3.7"
6666
- "pypy-3.8"
6767
- "pypy-3.9"
@@ -87,7 +87,7 @@ jobs:
8787
- name: Install build dependencies (Macos)
8888
# Install yasm because nasm does not work when building wheels.
8989
# Probably because of nasm-filter.sh not filtering all flags that can not be used.
90-
run: brew install nasm automake autoconf
90+
run: brew install nasm
9191
if: runner.os == 'macOS'
9292
- name: Set MSVC developer prompt
9393
uses: ilammy/[email protected]
@@ -107,10 +107,6 @@ jobs:
107107
matrix:
108108
python_version:
109109
- "3.7"
110-
- "3.8"
111-
- "3.9"
112-
- "3.10"
113-
- "3.11"
114110
steps:
115111
- uses: actions/[email protected]
116112
with:
@@ -198,7 +194,7 @@ jobs:
198194
- name: Install cibuildwheel twine wheel
199195
run: python -m pip install cibuildwheel twine wheel
200196
- name: Install build dependencies (Macos)
201-
run: brew install nasm automake autoconf
197+
run: brew install nasm
202198
if: runner.os == 'macOS'
203199
- name: Set MSVC developer prompt
204200
uses: ilammy/[email protected]

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Changelog
99
1010
version 1.2.0-dev
1111
-----------------
12+
+ Speed-up source build by using ISA-L Unix-specific makefile rather than the
13+
autotools build.
1214
+ Simplify build setup. ISA-L release flags are now used and not
1315
overwritten with python release flags when building the included static
1416
library.

setup.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import functools
1010
import os
11+
import platform
1112
import shutil
1213
import subprocess
1314
import sys
@@ -74,7 +75,7 @@ def build_extension(self, ext):
7475
isa_l_build_dir = build_isa_l()
7576
if SYSTEM_IS_UNIX:
7677
ext.extra_objects = [
77-
os.path.join(isa_l_build_dir, ".libs", "libisal.a")]
78+
os.path.join(isa_l_build_dir, "bin", "isa-l.a")]
7879
elif SYSTEM_IS_WINDOWS:
7980
ext.extra_objects = [
8081
os.path.join(isa_l_build_dir, "isa-l_static.lib")]
@@ -106,16 +107,21 @@ def build_isa_l():
106107
# it.
107108
build_env = os.environ.copy()
108109
if SYSTEM_IS_UNIX:
109-
build_env["CFLAGS"] = build_env.get("CFLAGS", "") + " -O2 -fPIC"
110+
build_env["CFLAGS"] = build_env.get("CFLAGS", "") + " -fPIC"
110111
if hasattr(os, "sched_getaffinity"):
111112
cpu_count = len(os.sched_getaffinity(0))
112113
else: # sched_getaffinity not available on all platforms
113114
cpu_count = os.cpu_count() or 1 # os.cpu_count() can return None
114115
run_args = dict(cwd=build_dir, env=build_env)
115116
if SYSTEM_IS_UNIX:
116-
subprocess.run(os.path.join(build_dir, "autogen.sh"), **run_args)
117-
subprocess.run([os.path.join(build_dir, "configure")], **run_args)
118-
subprocess.run(["make", "-j", str(cpu_count)], **run_args)
117+
if platform.machine() == "aarch64":
118+
cflags_param = "CFLAGS_aarch64"
119+
else:
120+
cflags_param = "CFLAGS_"
121+
subprocess.run(["make", "-j", str(cpu_count), "-f", "Makefile.unx",
122+
"isa-l.h", "bin/isa-l.a",
123+
f"{cflags_param}={build_env.get('CFLAGS', '')}"],
124+
**run_args)
119125
elif SYSTEM_IS_WINDOWS:
120126
subprocess.run(["nmake", "/f", "Makefile.nmake"], **run_args)
121127
else:

0 commit comments

Comments
 (0)