Skip to content

Commit

Permalink
Adds tests for windows-latest on cmake.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
weslleyspereira committed May 24, 2023
1 parent 0c44dd4 commit 633440e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- try-github-actions
- try-github-actions-for-windows
paths:
- .github/workflows/cmake.yml
- '**CMakeLists.txt'
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ macos-latest, ubuntu-latest ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
fflags: [
"-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all",
"-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all -fopenmp" ]
Expand All @@ -72,26 +72,28 @@ jobs:
- name: Checkout LAPACK
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3

- name: Use GCC-11 on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: >
cmake -B build
cmake -B build -G Ninja
-D CMAKE_C_COMPILER="gcc-11"
-D CMAKE_Fortran_COMPILER="gfortran-11"
-D USE_FLAT_NAMESPACE:BOOL=ON
# - name: Use Unix Makefiles on Windows
# if: ${{ matrix.os == 'windows-latest' }}
# run: >
# cmake -B build
# -G "Unix Makefiles"
# -D CMAKE_C_FLAGS="${{env.CFLAGS}} -Wl,--stack=1000000000"
- name: Special flags for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: >
cmake -B build -G Ninja
-D CMAKE_EXE_LINKER_FLAGS="-Wl,--allow-multiple-definition,--stack=1000000000"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B build
cmake -B build -G Ninja
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
-D CBLAS:BOOL=ON
Expand Down
6 changes: 4 additions & 2 deletions CBLAS/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#######################################################################

macro(add_cblas_test output input target)
set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
if(NOT "${input}" STREQUAL "")
set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
endif()
set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${output}")
set(testName "${target}")

if(EXISTS "${TEST_INPUT}")
if(DEFINED TEST_INPUT AND EXISTS "${TEST_INPUT}")
add_test(NAME CBLAS-${testName} COMMAND "${CMAKE_COMMAND}"
-DTEST=$<TARGET_FILE:${target}>
-DINPUT=${TEST_INPUT}
Expand Down

0 comments on commit 633440e

Please sign in to comment.