Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows and MacOS to the testing workflows #60

Open
weslleyspereira opened this issue Mar 14, 2022 · 1 comment
Open

Add Windows and MacOS to the testing workflows #60

weslleyspereira opened this issue Mar 14, 2022 · 1 comment

Comments

@weslleyspereira
Copy link
Collaborator

Recently (#56), I added a workflow to test the building system on Ubuntu. It will be good to have at least one configuration to Windows, and another to MacOS.

Here was my first attempt, that do not work:

diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
index 4d080e2..2fec569 100644
--- a/.github/workflows/cmake.yml
+++ b/.github/workflows/cmake.yml
@@ -33,7 +33,12 @@ defaults:
 jobs:
 
   build-all:
-    runs-on: ubuntu-latest
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ macos-latest, windows-latest, ubuntu-latest ]
 
     steps:
 
@@ -43,19 +48,42 @@ jobs:
     - name: Install ninja-build tool
       uses: seanmiddleditch/gha-setup-ninja@v3
 
-    - name: Setup MPI
+    - name: Setup MPI on Ubuntu
+      if: ${{ matrix.os == 'ubuntu-latest' }}
       # uses: mpi4py/setup-mpi@v1
       run: |
         sudo apt -y update
         sudo apt -y install openmpi-bin libopenmpi-dev
 
-    - name: Install BLAS and LAPACK
-      run: sudo apt -y install libblas-dev liblapack-dev
+    - name: Setup MPI and gfortran on MacOS
+      if: ${{ matrix.os == 'macos-latest' }}
+      # uses: mpi4py/setup-mpi@v1
+      run: |
+        brew install open-mpi
+
+    - name: Setup MPI on Windows
+      if: ${{ matrix.os == 'windows-latest' }}
+      uses: mpi4py/setup-mpi@v1
+
+    # - name: Install BLAS and LAPACK
+    #   run: sudo apt -y install libblas-dev liblapack-dev
+
+    - name: Specific configurations for CMake on MacOS
+      if: ${{ matrix.os == 'macos-latest' }}
+      run: >
+        cmake -B build -G Ninja
+        -DCMAKE_C_COMPILER="mpicc"
+        -DCMAKE_Fortran_COMPILER="mpifort"
+
+    - name: Specific configurations for CMake on Windows
+      if: ${{ matrix.os == 'windows-latest' }}
+      run: >
+        cmake -B build -G Ninja
+        -D MPI_BASE_DIR="$MSMPI_BIN"
         
     - name: CMake configuration
       run: >
-        cmake -B build
-        -G Ninja
+        cmake -B build -G Ninja
         -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
         -D CMAKE_INSTALL_PREFIX=${{github.workspace}}/scalapack_install
         -D BUILD_SHARED_LIBS=ON

Error on Windows:

 CMake Error at CMakeLists.txt:71 (message):
  --> MPI Library NOT FOUND -- please set MPI_BASE_DIR accordingly --

Error on MacOS:

CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fortran_PREPROCESS_SOURCE
CMake Error at /usr/local/Cellar/cmake/3.22.3/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
  Failed to generate test project build system.
@scivision
Copy link

The MacOS CI is added in #77
Due to MacOS-specific Scalapack code issues, I made MacOS a separate job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants