From 77860b441ecd63c36a0165a853364d30dd7d1b23 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Thu, 5 Feb 2026 13:41:09 -0600 Subject: [PATCH 01/13] fix: add -Wno-incompatible-pointer-types for build --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5bd328b..bdd2dd9 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ include_dirs = [numpy.get_include()] include_dirs += ["esutil/include"] -extra_compile_args = [] +extra_compile_args = ["-Wno-incompatible-pointer-types"] extra_link_args = [] # From ecb20a03b02eb02c261c7e55ac379529897af069 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:06:59 -0600 Subject: [PATCH 02/13] Update setup.py to conditionally set compile args Refactor extra_compile_args to conditionally include flags based on platform and compilation test. --- setup.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bdd2dd9..1198d0a 100644 --- a/setup.py +++ b/setup.py @@ -14,9 +14,12 @@ include_dirs = [numpy.get_include()] include_dirs += ["esutil/include"] -extra_compile_args = ["-Wno-incompatible-pointer-types"] +extra_compile_args = [] extra_link_args = [] +if not sys.platform.startswith("win"): + extra_compile_args += ["-Wno-incompatible-pointer-types"] + # # Figure out if we need to add any extra flags: # @@ -124,13 +127,17 @@ def check_flags(compiler): class MyBuilder(build_ext): def build_extensions(self): - cflags, cppflags, lflags = check_flags(self.compiler) + did_compile_test = False # Add the appropriate extra flags for that compiler. for e in self.extensions: if any( ['.cc' in f or '.cpp' in f for f in e.sources] ): + if not did_compile_test: + cflags, cppflags, lflags = check_flags(self.compiler) + did_compile_test = True + e.extra_compile_args = cflags for flag in lflags: e.extra_link_args.append(flag) From bc36bd8ed18215d7887177d6d3816394149da675 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:08:30 -0600 Subject: [PATCH 03/13] Add import for sys module in setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 1198d0a..d3e94bd 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ import os +import sys from glob import glob import tempfile import subprocess From 908ad22c892166eabfb2bb3fcacbc345efd47d55 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:17:38 -0600 Subject: [PATCH 04/13] Adjust compiler flags handling in setup.py Refactor build process to always check compiler flags. --- setup.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index d3e94bd..1b2da6c 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ def try_compile(cpp_code, compiler, cflags=[], lflags=[]): def check_flags(compiler): """Check if we need to adjust the standard cflags for specific systems""" # Start with a canonical set of flags to use - cflags = extra_compile_args + cflags = extra_compile_args) cppflags = extra_compile_args lflags = extra_link_args @@ -128,17 +128,13 @@ def check_flags(compiler): class MyBuilder(build_ext): def build_extensions(self): - did_compile_test = False + cflags, cppflags, lflags = check_flags(self.compiler) # Add the appropriate extra flags for that compiler. for e in self.extensions: if any( ['.cc' in f or '.cpp' in f for f in e.sources] ): - if not did_compile_test: - cflags, cppflags, lflags = check_flags(self.compiler) - did_compile_test = True - e.extra_compile_args = cflags for flag in lflags: e.extra_link_args.append(flag) From 44e7df759e4edad98de080f909ceafc3dbb8f172 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:18:42 -0600 Subject: [PATCH 05/13] Apply suggestion from @beckermr --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1b2da6c..237f3a3 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ def try_compile(cpp_code, compiler, cflags=[], lflags=[]): def check_flags(compiler): """Check if we need to adjust the standard cflags for specific systems""" # Start with a canonical set of flags to use - cflags = extra_compile_args) + cflags = extra_compile_args cppflags = extra_compile_args lflags = extra_link_args From 73f2882b3a92e581ea6e8092a83be12a882a4581 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:21:03 -0600 Subject: [PATCH 06/13] Enable verbose output for pip install Add verbose flag to pip install command for better output. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7811478..75342e7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,7 +40,7 @@ jobs: - name: Install code env: CC: ${{ matrix.compiler }} - run: pip install -e . + run: pip install -e . -vv - name: lint run: | From 8c7954f3eca8aa7407499f2ee9ac9f1974b3318a Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:23:37 -0600 Subject: [PATCH 07/13] Simplify pip install command in test workflow Removed verbose flag from pip install command. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 75342e7..7811478 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,7 +40,7 @@ jobs: - name: Install code env: CC: ${{ matrix.compiler }} - run: pip install -e . -vv + run: pip install -e . - name: lint run: | From a8fc2149a18074f9aa61549e835fce92fbd3dfb5 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:24:57 -0600 Subject: [PATCH 08/13] Add debug print for extension build details Add print statement for debugging extension build. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 237f3a3..ac90d02 100644 --- a/setup.py +++ b/setup.py @@ -139,6 +139,8 @@ def build_extensions(self): for flag in lflags: e.extra_link_args.append(flag) + print(e, e.sources, e.extra_compile_args, flush=True) + # Now run the normal build function. build_ext.build_extensions(self) From 0a40b421c5460148c14351d9d4f1c679245bbc82 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:25:15 -0600 Subject: [PATCH 09/13] Update pip install command to include verbose flag Add verbose flag to pip install command in workflow. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7811478..c0eb46b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,7 +40,7 @@ jobs: - name: Install code env: CC: ${{ matrix.compiler }} - run: pip install -e . + run: pip install -e . -v - name: lint run: | From 69a51ee82dc0aa317bbf77af2c1e6e179f9ae0c4 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:28:03 -0600 Subject: [PATCH 10/13] Fix indentation for print statement in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ac90d02..32d6dac 100644 --- a/setup.py +++ b/setup.py @@ -139,7 +139,7 @@ def build_extensions(self): for flag in lflags: e.extra_link_args.append(flag) - print(e, e.sources, e.extra_compile_args, flush=True) + print(e, e.sources, e.extra_compile_args, flush=True) # Now run the normal build function. build_ext.build_extensions(self) From d55095b4e116d0a343e52118b6e55c968039b7a0 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:29:20 -0600 Subject: [PATCH 11/13] Copy compile and link flags in check_flags function Use copy to avoid modifying original compile flags. --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 32d6dac..bef93a8 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import copy import os import sys from glob import glob @@ -114,9 +115,9 @@ def try_compile(cpp_code, compiler, cflags=[], lflags=[]): def check_flags(compiler): """Check if we need to adjust the standard cflags for specific systems""" # Start with a canonical set of flags to use - cflags = extra_compile_args - cppflags = extra_compile_args - lflags = extra_link_args + cflags = copy.copy(extra_compile_args) + cppflags = copy.copy(extra_compile_args) + lflags = copy.copy(extra_link_args) # Check whether we can safely add -std=c++11 if try_compile("int main (int argc, char **argv) { return 0; }", From 787219c36bc38e35ff16b64e2f1a8b7f68d3259c Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:30:57 -0600 Subject: [PATCH 12/13] Remove debug print statement in check_flags Removed debug print statement from check_flags function. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bef93a8..0928341 100644 --- a/setup.py +++ b/setup.py @@ -115,6 +115,8 @@ def try_compile(cpp_code, compiler, cflags=[], lflags=[]): def check_flags(compiler): """Check if we need to adjust the standard cflags for specific systems""" # Start with a canonical set of flags to use + # the way this file gets run by pip, you need copies here even though + # these variables are not marked as global. cflags = copy.copy(extra_compile_args) cppflags = copy.copy(extra_compile_args) lflags = copy.copy(extra_link_args) @@ -140,8 +142,6 @@ def build_extensions(self): for flag in lflags: e.extra_link_args.append(flag) - print(e, e.sources, e.extra_compile_args, flush=True) - # Now run the normal build function. build_ext.build_extensions(self) From cf0c74fdb9d650d434eae908f8f1476dfb453b49 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 6 Feb 2026 04:31:28 -0600 Subject: [PATCH 13/13] Apply suggestion from @beckermr --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c0eb46b..7811478 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,7 +40,7 @@ jobs: - name: Install code env: CC: ${{ matrix.compiler }} - run: pip install -e . -v + run: pip install -e . - name: lint run: |