From 98c0492d584b33837072436185c080a9136b61dd Mon Sep 17 00:00:00 2001 From: Chris Hansen Date: Tue, 9 Jul 2024 15:12:04 -0400 Subject: [PATCH] Fix build_libs using `--oblas_no_avx` flag introduced in 9220201 - Add Rosetta (no AVX) build to CD action --- .github/workflows/cd_nightly.yaml | 15 ++++++++++----- src/utilities/build_libs.py | 8 ++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd_nightly.yaml b/.github/workflows/cd_nightly.yaml index 8a8f772..72457e1 100644 --- a/.github/workflows/cd_nightly.yaml +++ b/.github/workflows/cd_nightly.yaml @@ -22,17 +22,22 @@ jobs: - { name: "Linux-x86_64", os: ubuntu-20.04, - cc: "gcc-10", cxx: "g++-10", fc: "gfortran-10", python: "python" + cc: "gcc-10", cxx: "g++-10", fc: "gfortran-10", python: "python", build_libs_flags: "" } - { name: "macOS-x86_64", os: macos-12, - cc: "gcc-12", cxx: "g++-12", fc: "gfortran-12", python: "python3", xcode_path: "/Applications/Xcode_14.2.app/Contents/Developer" + cc: "gcc-12", cxx: "g++-12", fc: "gfortran-12", python: "python3", xcode_path: "/Applications/Xcode_14.2.app/Contents/Developer", build_libs_flags: "" + } + - { + name: "macOS-x86_64-Rosetta", + os: macos-12, + cc: "gcc-12", cxx: "g++-12", fc: "gfortran-12", python: "python3", xcode_path: "/Applications/Xcode_14.2.app/Contents/Developer", build_libs_flags: "--oblas_no_avx" } - { name: "macOS-arm64", os: macos-14, - cc: "gcc-13", cxx: "g++-13", fc: "gfortran-13", python: "python3", xcode_path: "/Applications/Xcode_15.4.app/Contents/Developer" + cc: "gcc-13", cxx: "g++-13", fc: "gfortran-13", python: "python3", xcode_path: "/Applications/Xcode_15.4.app/Contents/Developer", build_libs_flags: "" } steps: @@ -74,7 +79,7 @@ jobs: working-directory: libs run: > ${{ matrix.config.python }} ../src/utilities/build_libs.py --no_dl_progress --nthread=2 - --build_umfpack=1 --build_arpack=1 --oblas_dynamic_arch --oft_package + --build_umfpack=1 --build_arpack=1 --oblas_dynamic_arch --oft_package ${{ matrix.config.build_libs_flags }} - name: Build external (macOS) if: startsWith(matrix.config.os, 'macos') @@ -82,7 +87,7 @@ jobs: working-directory: libs run: > ${{ matrix.config.python }} ../src/utilities/build_libs.py --no_dl_progress --nthread=2 - --build_umfpack=1 --build_arpack=1 --oft_package + --build_umfpack=1 --build_arpack=1 --oft_package ${{ matrix.config.build_libs_flags }} - name: Upload library failure log uses: actions/upload-artifact@v4 diff --git a/src/utilities/build_libs.py b/src/utilities/build_libs.py index 5ed1a1b..48c4703 100644 --- a/src/utilities/build_libs.py +++ b/src/utilities/build_libs.py @@ -1097,9 +1097,9 @@ def build(self): tmp_dict = self.config_dict.copy() oblas_options = ['NO_CBLAS=1', 'NO_LAPACKE=1', 'NO_SHARED=1'] if self.config_dict['MAKE_THREADS'] == 1: - oblas_options += ['NO_PARALLEL_MAKE=1'] + make_thread = ['NO_PARALLEL_MAKE=1'] else: - oblas_options += ['MAKE_NB_JOBS={MAKE_THREADS}'] + make_thread = ['MAKE_NB_JOBS={MAKE_THREADS}'] if self.threaded: oblas_options += ['USE_THREAD=1', 'USE_OPENMP=1', 'FCOMMON_OPT="-frecursive {OMP_FLAGS} -fPIC"'] else: @@ -1120,8 +1120,8 @@ def build(self): 'export CC={CC}', 'export FC={FC}', 'make clean', - 'make {0}'.format(' '.join(oblas_options)), - 'make NO_PARALLEL_MAKE=1 NO_SHARED=1 PREFIX={OpenBLAS_ROOT} install' + 'make {0}'.format(' '.join(oblas_options + make_thread)), + 'make {0} install'.format(' '.join(oblas_options + ['NO_PARALLEL_MAKE=1', 'PREFIX={OpenBLAS_ROOT}'])) ] self.run_build(build_lines, tmp_dict)