-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge: add Github action for windows
This adds Github action for windows. Summary: - split install and compile in OSX-build - add ginkgo_modify_flags to fix NVCC `""` in MSVC - fix windows installation - move `ginkgo_switch_windows_link` into `make/windows_helper.cmake` - add Windows Github action - MSVC: cuda (only compile), ref (build/test/install) - MinGW: omp (build/test/install) - Cygwin: omp (build/test/install) Related PR: #471
- Loading branch information
Showing
10 changed files
with
252 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: Windows-build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
windows_cuda: | ||
name: cuda102/release/shared (only compile) | ||
runs-on: [windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: setup | ||
run: | | ||
choco install cuda -y | ||
- name: configure | ||
run: | | ||
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." | ||
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | ||
refreshenv | ||
mkdir build | ||
cd build | ||
$env:PATH="$pwd\windows_shared_library;$env:PATH" | ||
cmake -DGINKGO_BUILD_CUDA=ON -DGINKGO_BUILD_OMP=OFF .. | ||
cmake --build . -j8 --config Release | ||
windows_ref: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {shared: "ON", build_type: "Debug", name: "reference/debug/shared"} | ||
- {shared: "OFF", build_type: "Release", name: "reference/release/static"} | ||
# Debug static needs too much storage | ||
# - {shared: "OFF", build_type: "Debug", name: "reference/debug/static"} | ||
name: msvc/${{ matrix.config.name }} | ||
runs-on: [windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: shared_env | ||
if: matrix.config.shared == 'ON' | ||
run: | | ||
echo "::set-env name=origin_path::$env:PATH" | ||
echo "::add-path::$pwd\build\windows_shared_library" | ||
- name: debug_env | ||
if: matrix.config.build_type == 'Debug' | ||
run: | | ||
echo "::set-env name=CXXFLAGS::/bigobj" | ||
- name: configure | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DBUILD_SHARED_LIBS=${{ matrix.config.shared }} -DGINKGO_BUILD_CUDA=OFF -DGINKGO_BUILD_OMP=OFF .. | ||
cmake --build . -j8 --config ${{ matrix.config.build_type }} | ||
ctest . -C ${{ matrix.config.build_type }} | ||
- name: install_shared_env | ||
if: matrix.config.shared == 'ON' | ||
run: | | ||
echo "::set-env name=PATH::C:\Program Files (x86)\Ginkgo\lib;$env:origin_path" | ||
- name: install | ||
run: | | ||
cd build | ||
cmake --install . --config ${{ matrix.config.build_type }} | ||
cmake --build . --target test_install --config ${{ matrix.config.build_type }} | ||
windows_mingw: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {shared: "ON", build_type: "Debug", name: "omp/debug/shared"} | ||
- {shared: "OFF", build_type: "Release", name: "omp/release/static"} | ||
name: mingw/${{ matrix.config.name }} | ||
runs-on: [windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: shared_env | ||
if: matrix.config.shared == 'ON' | ||
run: | | ||
echo "::set-env name=origin_path::$env:PATH" | ||
echo "::add-path::$pwd\build\windows_shared_library" | ||
- name: debug_env | ||
if: matrix.config.build_type == 'Debug' | ||
run: | | ||
echo "::set-env name=CXXFLAGS::-Wa,-mbig-obj" | ||
- name: configure | ||
# Use cmd to remove the path easily | ||
run: | | ||
set PATH=%PATH:C:\Program Files\Git\bin;=% | ||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=% | ||
mkdir build | ||
cd build | ||
cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=${{ matrix.config.shared }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} .. | ||
cmake --build . -j8 | ||
ctest . | ||
shell: cmd | ||
- name: install_shared_env | ||
if: matrix.config.shared == 'ON' | ||
run: | | ||
echo "::set-env name=PATH::C:\Program Files (x86)\Ginkgo\lib;$env:origin_path" | ||
- name: install | ||
run: | | ||
set PATH=%PATH:C:\Program Files\Git\bin;=% | ||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=% | ||
cd build | ||
cmake --install . | ||
cmake --build . --target test_install | ||
shell: cmd | ||
|
||
windows_cygwin: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {shared: "ON", build_type: "Debug", name: "omp/debug/shared"} | ||
- {shared: "OFF", build_type: "Release", name: "omp/release/static"} | ||
name: cygwin/${{ matrix.config.name }} | ||
runs-on: [windows-latest] | ||
steps: | ||
- run: git config --global core.autocrlf input | ||
- uses: actions/checkout@v2 | ||
- name: setup | ||
run: | | ||
choco install cygwin -y | ||
choco install cyg-get -y | ||
cyg-get cmake make gcc-g++ git | ||
- name: shared_static_env | ||
run: | | ||
echo "::set-env name=shared_ON_path::;$pwd\build\windows_shared_library" | ||
echo "::set-env name=shared_OFF_path::" | ||
- name: debug_env | ||
if: matrix.config.build_type == 'Debug' | ||
run: | | ||
echo "::set-env name=CXXFLAGS::-Wa,-mbig-obj" | ||
- name: configure | ||
run: | | ||
path C:\tools\cygwin\bin%shared_${{ matrix.config.shared }}_path% | ||
mkdir build | ||
cd build | ||
bash -c "cmake -DBUILD_SHARED_LIBS=${{ matrix.config.shared }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} .." | ||
bash -c "make -j8" | ||
bash -c "make test" | ||
shell: cmd | ||
- name: install_shared | ||
if: matrix.config.shared == 'ON' | ||
run: | | ||
path C:\tools\cygwin\bin | ||
cd build | ||
bash -c "make install" | ||
bash -c "export PATH=/usr/local/lib:$PATH && make test_install" | ||
shell: cmd | ||
- name: install_static | ||
if: matrix.config.shared == 'OFF' | ||
run: | | ||
path C:\tools\cygwin\bin | ||
cd build | ||
bash -c "make install" | ||
bash -c "make test_install" | ||
shell: cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function(ginkgo_switch_windows_link lang from to) | ||
foreach(flag_var | ||
"CMAKE_${lang}_FLAGS" "CMAKE_${lang}_FLAGS_DEBUG" "CMAKE_${lang}_FLAGS_RELEASE" | ||
"CMAKE_${lang}_FLAGS_MINSIZEREL" "CMAKE_${lang}_FLAGS_RELWITHDEBINFO" | ||
) | ||
if(${flag_var} MATCHES "/${from}") | ||
string(REGEX REPLACE "/${from}" "/${to}" ${flag_var} "${${flag_var}}") | ||
endif(${flag_var} MATCHES "/${from}") | ||
if(${flag_var} MATCHES "-${from}") | ||
string(REGEX REPLACE "-${from}" "-${to}" ${flag_var} "${${flag_var}}") | ||
endif(${flag_var} MATCHES "-${from}") | ||
set(${flag_var} "${${flag_var}}" CACHE STRING "" FORCE) | ||
endforeach() | ||
endfunction() | ||
|
||
macro(ginkgo_switch_to_windows_static lang) | ||
ginkgo_switch_windows_link(${lang} "MD" "MT") | ||
endmacro() | ||
|
||
macro(ginkgo_switch_to_windows_dynamic lang) | ||
ginkgo_switch_windows_link(${lang} "MT" "MD") | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.