From d4cd5c956ebed619706b355e7993fb381683f5d9 Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Thu, 14 Nov 2024 10:42:22 -0500 Subject: [PATCH 1/5] Update github macos to apple silicon --- .github/workflows/build-and-test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index b8b20af91..85e4a45ba 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -43,7 +43,7 @@ jobs: with-solver: strumpack with-eigensolver: slepc - runs-on: macos-latest-xl + runs-on: macos-latest-xlarge steps: - uses: actions/checkout@v4 with: From b888d6d88d9b3373394ffbb4b484a1bd9116cbf2 Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Thu, 14 Nov 2024 14:43:22 -0500 Subject: [PATCH 2/5] Prefer OpenBLAS over other non-handled vendors --- .github/workflows/build-and-test-macos.yml | 2 +- cmake/ExternalBLASLAPACK.cmake | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 85e4a45ba..4a6dd07e2 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -84,7 +84,7 @@ jobs: export FC=gfortran-12 fi if [[ "${{ matrix.math-libs }}" == 'openblas' ]]; then - export OPENBLAS_DIR=/usr/local/opt/openblas + export OPENBLAS_DIR=/opt/homebrew/opt/openblas fi export NUM_PROC_BUILD=$(nproc 2> /dev/null || sysctl -n hw.ncpu) if [[ "$NUM_PROC_BUILD" -gt "$NUM_PROC_BUILD_MAX" ]]; then diff --git a/cmake/ExternalBLASLAPACK.cmake b/cmake/ExternalBLASLAPACK.cmake index 3860f95b2..1d8ed7fc4 100644 --- a/cmake/ExternalBLASLAPACK.cmake +++ b/cmake/ExternalBLASLAPACK.cmake @@ -163,6 +163,13 @@ else() else() set(OPENBLAS_DIR) endif() + + if(NOT OPENBLAS_DIR STREQUAL "") + # If OpenBLAS was found set the vendor to avoid conflict with Accelerate on Darwin + set(BLA_VENDOR "OpenBLAS") + message(STATUS "Using BLAS/LAPACK from OpenBLAS") + endif() + list(APPEND CMAKE_PREFIX_PATH ${OPENBLAS_DIR}) find_package(BLAS REQUIRED) find_package(LAPACK REQUIRED) From f5a8756c726ebd32b10804b452d504f8913ad8d3 Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Thu, 14 Nov 2024 17:11:58 -0500 Subject: [PATCH 3/5] Explicitly add julia to the macos runner --- .github/workflows/build-and-test-macos.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 4a6dd07e2..791ce40d6 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -53,6 +53,10 @@ jobs: run: | brew install pkg-config + - uses: julia-actions/setup-julia@v2 + with: + version: '1' + - name: Configure Open MPI if: matrix.mpi == 'openmpi' run: | From 90c8399581cb9c7a2e34e35c610bc932818d5ed8 Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Fri, 15 Nov 2024 12:04:02 -0500 Subject: [PATCH 4/5] Attempt to fix mpich + gcc missing math library link on singularity build. Also fix printing message for BLAS discovery --- cmake/ExternalBLASLAPACK.cmake | 3 ++- cmake/ExternalHYPRE.cmake | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/ExternalBLASLAPACK.cmake b/cmake/ExternalBLASLAPACK.cmake index 1d8ed7fc4..9307ea32d 100644 --- a/cmake/ExternalBLASLAPACK.cmake +++ b/cmake/ExternalBLASLAPACK.cmake @@ -168,6 +168,8 @@ else() # If OpenBLAS was found set the vendor to avoid conflict with Accelerate on Darwin set(BLA_VENDOR "OpenBLAS") message(STATUS "Using BLAS/LAPACK from OpenBLAS") + else() + message(STATUS "Using BLAS/LAPACK located by CMake") endif() list(APPEND CMAKE_PREFIX_PATH ${OPENBLAS_DIR}) @@ -188,7 +190,6 @@ else() PATH_SUFFIXES include include/openblas REQUIRED ) - message(STATUS "Using BLAS/LAPACK located by CMake") endif() # Save variables to cache diff --git a/cmake/ExternalHYPRE.cmake b/cmake/ExternalHYPRE.cmake index 1e2d74090..58fa47d55 100644 --- a/cmake/ExternalHYPRE.cmake +++ b/cmake/ExternalHYPRE.cmake @@ -44,7 +44,7 @@ if(NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER) set(HYPRE_CXXFLAGS "${HYPRE_CXXFLAGS} -I${INCLUDE_DIR}") endforeach() string(REPLACE ";" " " HYPRE_MPI_LIBRARIES "${MPI_C_LIBRARIES}") - set(HYPRE_LDFLAGS "${HYPRE_LDFLAGS} ${HYPRE_MPI_LIBRARIES}") + set(HYPRE_LDFLAGS "${HYPRE_LDFLAGS} ${HYPRE_MPI_LIBRARIES} -lm") endif() # Use Autotools build instead of CMake for HIP support From 24ecb189d1ebf81b06297653dc64f36b9da3ebb9 Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Fri, 15 Nov 2024 14:16:54 -0500 Subject: [PATCH 5/5] Address PR feedback --- .github/workflows/build-and-test-macos.yml | 2 +- cmake/ExternalBLASLAPACK.cmake | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 791ce40d6..d0392e152 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -88,7 +88,7 @@ jobs: export FC=gfortran-12 fi if [[ "${{ matrix.math-libs }}" == 'openblas' ]]; then - export OPENBLAS_DIR=/opt/homebrew/opt/openblas + export OPENBLAS_DIR=$(brew --prefix openblas) fi export NUM_PROC_BUILD=$(nproc 2> /dev/null || sysctl -n hw.ncpu) if [[ "$NUM_PROC_BUILD" -gt "$NUM_PROC_BUILD_MAX" ]]; then diff --git a/cmake/ExternalBLASLAPACK.cmake b/cmake/ExternalBLASLAPACK.cmake index 9307ea32d..6c190e565 100644 --- a/cmake/ExternalBLASLAPACK.cmake +++ b/cmake/ExternalBLASLAPACK.cmake @@ -162,14 +162,13 @@ else() set(OPENBLAS_DIR $ENV{OPENBLAS_ROOT}) else() set(OPENBLAS_DIR) + message(STATUS "Using BLAS/LAPACK located by CMake") endif() if(NOT OPENBLAS_DIR STREQUAL "") # If OpenBLAS was found set the vendor to avoid conflict with Accelerate on Darwin set(BLA_VENDOR "OpenBLAS") message(STATUS "Using BLAS/LAPACK from OpenBLAS") - else() - message(STATUS "Using BLAS/LAPACK located by CMake") endif() list(APPEND CMAKE_PREFIX_PATH ${OPENBLAS_DIR})