From ea8d9411e9365beba615b55e8c9f6e9ae93fb23f Mon Sep 17 00:00:00 2001 From: Justin Laughlin Date: Fri, 5 Apr 2024 18:14:59 -0700 Subject: [PATCH] add build_wheel flag --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e603d24d..d6773b44 100644 --- a/setup.py +++ b/setup.py @@ -112,6 +112,7 @@ build_gslib = False build_parallel = False build_serial = False +build_wheel = False ext_prefix = '' mfems_prefix = '' @@ -1242,6 +1243,7 @@ def print_config(): print(" call SWIG wrapper generator: " + ("Yes" if run_swig else "No")) print(" build serial wrapper: " + ("Yes" if build_serial else "No")) print(" build parallel wrapper : " + ("Yes" if build_parallel else "No")) + print(" build wheel : " + ("Yes" if build_wheel else "No")) print(" hypre prefix", hypre_prefix) print(" metis prefix", metis_prefix) @@ -1267,7 +1269,7 @@ def configure_install(self): ''' global prefix, dry_run, verbose, ext_prefix, git_sshclone global clean_swig, run_swig, swig_only, skip_install, skip_swig - global build_mfem, build_mfemp, build_parallel, build_serial + global build_mfem, build_mfemp, build_parallel, build_serial, build_wheel global mfem_branch, mfem_source, mfem_debug global build_metis, build_hypre, build_libceed, build_gslib @@ -1316,6 +1318,7 @@ def configure_install(self): build_parallel = bool(self.with_parallel) # controlls PyMFEM parallel build_serial = not bool(self.no_serial) + build_wheel = bool(self.build_wheel) clean_swig = True run_swig = True @@ -1564,6 +1567,7 @@ class Install(_install): ('ext-only', None, 'Build metis, hypre, mfem(C++) only'), ('skip-ext', None, 'Skip building metis, hypre, mfem(C++) only'), ('build-only', None, 'Skip final install stage to prefix'), + ('build-wheel', None, 'Build a wheel'), ('CC=', None, 'c compiler'), ('CXX=', None, 'c++ compiler'), ('MPICC=', None, 'mpic compiler'), @@ -1612,6 +1616,7 @@ def initialize_options(self): self.mfem_debug = False self.metis_prefix = '' self.hypre_prefix = '' + self.build_wheel = False self.with_cuda = False self.with_cuda_hypre = False @@ -1772,7 +1777,7 @@ def run(self): sys.exit() -if haveWheel: +if haveWheel and build_wheel: class BdistWheel(_bdist_wheel): ''' Wheel build performs SWIG + Serial in Default. @@ -1899,7 +1904,7 @@ def run_setup(): 'install_egg_info': InstallEggInfo, 'install_scripts': InstallScripts, 'clean': Clean} - if haveWheel: + if haveWheel and build_wheel: cmdclass['bdist_wheel'] = BdistWheel install_req = install_requires()