This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Added building SparseSimulator without Cake #840
Merged
kuzminrobin
merged 9 commits into
feature/sparse-simulator
from
kuzminrobin/sparseSimIntegr02
Oct 4, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f5160a1
Added building SparseSimulator without Cake.
kuzminrobin 5c77135
Updated the README.md, removed build.cake
kuzminrobin 385938a
Fixed the Linux build
kuzminrobin 15fa102
Removed the OpenMP mentioning.
kuzminrobin 8cae79d
Fixed the build for CI case.
kuzminrobin 800bc95
Force use of Chocolatey installed clang-11 (#841)
swernli bc454f2
Added SparseSimulaotr to CI build and test
kuzminrobin 757f247
Minor err msg improvement
kuzminrobin 35778e3
CR changes.
kuzminrobin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,70 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| #Requires -Version 7.1 | ||
|
|
||
| & (Join-Path $PSScriptRoot .. .. .. .. build set-env.ps1) | ||
| $FailureCommands = 'Write-Host "##vso[task.logissue type=error;] Failed to build SparseSimulator. See errors below or above." ; Pop-Location ; Exit 1' | ||
|
|
||
| # BULD NATIVE PART | ||
|
|
||
| # mkdir Native\build\(Debug|Release) | ||
| $BuildDir = (Join-Path $PSScriptRoot "Native" "build" $Env:BUILD_CONFIGURATION) | ||
| if (-not (Test-Path $BuildDir)) { | ||
| New-Item -Path $BuildDir -ItemType "directory" | Out-Null | ||
| } | ||
|
|
||
| # pushd Native\build\(Debug|Release) | ||
| Push-Location $BuildDir | ||
|
|
||
| $CmakeConfigCommand = "cmake -G Ninja -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON -D CMAKE_BUILD_TYPE=$Env:BUILD_CONFIGURATION -S ..\.. " # Without `-G Ninja` the compiler chosen is always `cl.exe`. | ||
|
|
||
| if (($IsMacOS) -or ((Test-Path Env:/AGENT_OS) -and ($Env:AGENT_OS.StartsWith("Darwin")))) | ||
| { | ||
| Write-Host "On MacOS build using the default C/C++ compiler (should be AppleClang)" | ||
| } | ||
| else { | ||
| if (($IsLinux) -or ((Test-Path Env:AGENT_OS) -and ($Env:AGENT_OS.StartsWith("Lin")))) | ||
| { | ||
| Write-Host "On Linux build using Clang" | ||
| $CC = "clang-11" | ||
| $CXX = "clang++-11" | ||
| #$clangTidy = "-DCMAKE_CXX_CLANG_TIDY=clang-tidy-11" | ||
| } | ||
| elseif (($IsWindows) -or ((Test-Path Env:AGENT_OS) -and ($Env:AGENT_OS.StartsWith("Win")))) | ||
| { | ||
| Write-Host "On Windows build using Clang" | ||
| $CC = "clang.exe" | ||
| $CXX = "clang++.exe" | ||
|
|
||
| if (!(Get-Command clang -ErrorAction SilentlyContinue) -and (choco find --idonly -l llvm) -contains "llvm") { | ||
| # LLVM was installed by Chocolatey, so add the install location to the path. | ||
| $env:PATH += ";$($env:SystemDrive)\Program Files\LLVM\bin" | ||
| } | ||
|
|
||
| #if (Get-Command clang-tidy -ErrorAction SilentlyContinue) { | ||
| # # Only run clang-tidy if it's installed. This is because the package used by chocolatey on | ||
| # # the build pipeline doesn't include clang-tidy, so we allow skipping that there and let | ||
| # # the Linux build catch tidy issues. | ||
| # $clangTidy = "-DCMAKE_CXX_CLANG_TIDY=clang-tidy" | ||
| #} | ||
|
Comment on lines
+45
to
+50
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to preserve the |
||
| } | ||
|
|
||
| $CmakeConfigCommand += " -D CMAKE_C_COMPILER=$CC -D CMAKE_CXX_COMPILER=$CXX " | ||
| } | ||
|
|
||
| # Generate the build scripts: | ||
| ( Invoke-Expression $CmakeConfigCommand ) || ( Invoke-Expression $FailureCommands ) | ||
|
|
||
| # Invoke the build scripts: | ||
| ( cmake --build . ) || ( Invoke-Expression $FailureCommands ) | ||
|
|
||
| # popd | ||
| Pop-Location | ||
|
|
||
|
|
||
| # BUILD C# PART AND TESTS | ||
|
|
||
| Push-Location $PSScriptRoot | ||
| ( dotnet build . --configuration $Env:BUILD_CONFIGURATION ) || ( Invoke-Expression $FailureCommands ) | ||
| Pop-Location | ||
This file contains hidden or 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,11 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| & (Join-Path $PSScriptRoot .. .. .. .. build set-env.ps1) | ||
|
|
||
| $FailureCommands = 'Write-Host "##vso[task.logissue type=error;] Failed to test SparseSimulator. See errors below or above." ; Pop-Location ; Exit 1' | ||
|
|
||
| Push-Location $PSScriptRoot | ||
| ( dotnet test . --configuration $Env:BUILD_CONFIGURATION ) || ` | ||
| ( Invoke-Expression $FailureCommands ) | ||
| Pop-Location |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to preserve the
clangTidyfragments for now.