diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1d4f18a8..b60974fa3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,6 +113,9 @@ jobs: env: # Use silx wheelhouse: needed for ppc64le CIBW_ENVIRONMENT_LINUX: "PIP_FIND_LINKS=https://www.silx.org/pub/wheelhouse/ PIP_TRUSTED_HOST=www.silx.org" + # diable OpenMP under windows + CIBW_ENVIRONMENT_WINDOWS: > + CIBW_BEFORE_BUILD="${{ echo False > PYFAI_WITH_OPENMP }}" CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* # Do not build for pypy and muslinux @@ -125,7 +128,7 @@ jobs: CIBW_TEST_COMMAND: python -c "import pyFAI.test, sys; sys.exit(pyFAI.test.run_tests())" # Skip tests for emulated architectures # and Python3.8 on macos/arm64 (https://github.com/pypa/cibuildwheel/pull/1169) - CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} cp38-macosx_arm64 cp3*-win_amd64" + CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} cp38-macosx_arm64" WITH_QT_TEST: "False" # skip GUI tests PYFAI_OPENCL: "False" # skip GPU tests PYFAI_LOW_MEM: "True" # skip all tests >100Mb diff --git a/bootstrap.py b/bootstrap.py index 6ee8bd6a4..3f00e705c 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -47,7 +47,6 @@ def build_project(name, root_dir): libdir = "lib" if sys.platform == "win32": libdir = "Lib" - # extra = ["--buildtype", "plain"] build = os.path.join(root_dir, "build") if not(os.path.isdir(build) and os.path.isdir(os.path.join(build, name))): diff --git a/meson.build b/meson.build index f270e94a4..a0fcf3df5 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('pyFAI', 'c', 'cpp', 'cython', license: 'MIT', - meson_version: '>= 0.60', + meson_version: '>= 1.1', version: run_command(['version.py', '--wheel'], check:true).stdout().strip(), default_options: ['buildtype=plain', ], @@ -13,6 +13,16 @@ if meson.backend() != 'ninja' error('Ninja backend required') endif +# Read configuration files to disable OpenMP: +# 'PYFAI_WITH_OPENMP' file should contain 'False' +os = import('fs') +if os.is_file('PYFAI_WITH_OPENMP') + openmp_var = os.read('PYFAI_WITH_OPENMP').strip() +else + openmp_var = '' +endif + + cc = meson.get_compiler('c') cpp = meson.get_compiler('cpp') cy = meson.get_compiler('cython') diff --git a/meson.options b/meson.options new file mode 100644 index 000000000..c78e17d8c --- /dev/null +++ b/meson.options @@ -0,0 +1,2 @@ +option('use_openmp', type : 'feature', value : 'auto', + description : 'force enable/disable the usage of OpenMP') diff --git a/pyproject.toml b/pyproject.toml index 4d6b367e3..e6e506203 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,8 +54,7 @@ dependencies = [ build-backend = 'mesonpy' requires = [ 'meson-python>=0.11', - "meson>=0.64; platform_system=='Windows'", - "meson>=0.60; platform_system!='Windows'", + "meson>=1.1", 'ninja', 'wheel', 'oldest-supported-numpy', diff --git a/src/pyFAI/ext/meson.build b/src/pyFAI/ext/meson.build index fcd06a723..0e26b8c8e 100644 --- a/src/pyFAI/ext/meson.build +++ b/src/pyFAI/ext/meson.build @@ -1,5 +1,9 @@ -# OpenMP can be used -omp = dependency('openmp', required : false) +# OpenMP can be used? several ways to disable it: +# -> use -Duse_openmp=disabled +# -> or the file PYFAI_WITH_OPENMP should contain False +# -> or OpenMP can be unsuported on your achitecture/compiler + +omp = dependency('openmp', required: get_option('use_openmp').disable_auto_if(openmp_var=='False')) py.install_sources(['__init__.py'], pure: false, # Will be installed next to binaries