Skip to content

Commit b564cf9

Browse files
committed
Fix some places where bash label should be console label for windows.
1 parent 74949f6 commit b564cf9

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

content/learning-paths/servers-and-cloud-computing/cpp-profile-guided-optimisation/how-to-3.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For this example, you can use an Arm computer (Linux or Windows).
1616

1717
## What tools are needed to run a Google Benchmark example on Linux?
1818

19-
For Linux, run the following commands to install the prerequisite packages:
19+
Run the following commands to install the prerequisite packages:
2020

2121
```bash
2222
sudo apt update
@@ -25,11 +25,11 @@ sudo apt install gcc g++ make libbenchmark-dev -y
2525

2626
## What tools are needed to run a Google Benchmark example on Windows?
2727

28-
If you are using Windows, download the [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) to install the prerequisite packages.
28+
Download the [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) to install the prerequisite packages.
2929

3030
Next, install the static version of Google Benchmark for Arm64 via vcpkg. Run the following commands in Powershell as Administrator:
3131

32-
```bash
32+
```console
3333
cd C:\git
3434
git clone https://github.com/microsoft/vcpkg.git
3535
cd vcpkg
@@ -73,7 +73,7 @@ g++ -O3 -std=c++17 div_bench.cpp -lbenchmark -lpthread -o div_bench.base
7373

7474
**(Windows)** Compile with the command:
7575

76-
```bash
76+
```console
7777
cl /D BENCHMARK_STATIC_DEFINE div_bench.cpp /link /LIBPATH:"$VCPKG\lib" benchmark.lib benchmark_main.lib shlwapi.lib
7878
```
7979

@@ -85,7 +85,7 @@ cl /D BENCHMARK_STATIC_DEFINE div_bench.cpp /link /LIBPATH:"$VCPKG\lib" benchmar
8585

8686
**(Windows)** Run the program:
8787

88-
```bash
88+
```console
8989
.\div_bench.exe
9090
```
9191

content/learning-paths/servers-and-cloud-computing/cpp-profile-guided-optimisation/how-to-5.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ layout: learningpathall
1010

1111
To generate a binary optimized using runtime profile data, first build an instrumented binary that records usage data. Before building, open the Arm dev shell so that the compiler is in your PATH:
1212

13-
```bash
13+
```console
1414
& "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\Tools\Launch-VsDevShell.ps1" -Arch arm64
1515
```
1616

1717
(**note:** you may need to change the version number in your Visual Studio path, depending on which Visual Studio version you've installed.)
1818

1919
Next, set an environment variable to refer to the installed packages directory:
2020

21-
```bash
21+
```console
2222
$VCPKG="C:\git\vcpkg\installed\arm64-windows-static"
2323
```
2424

2525
Next, run the following command, which includes the `/GENPROFILE` flag, to build the instrumented binary:
2626

27-
```bash
27+
```console
2828
cl /O2 /GL /D BENCHMARK_STATIC_DEFINE /I "$VCPKG\include" /Fe:div_bench.exe div_bench.cpp /link /LTCG /GENPROFILE /PGD:div_bench.pgd /LIBPATH:"$VCPKG\lib" benchmark.lib benchmark_main.lib shlwapi.lib
2929
```
3030

@@ -46,15 +46,15 @@ The linker options used in this command are:
4646

4747
Next, run the instrumented binary to generate the profile data:
4848

49-
```bash
49+
```console
5050
.\div_bench.exe
5151
```
5252

5353
This execution creates profile data files (typically with a `.pgc` extension) in the same directory.
5454

5555
Now recompile the program using the `/USEPROFILE` flag to apply optimizations based on the collected data:
5656

57-
```bash
57+
```console
5858
cl /O2 /GL /D BENCHMARK_STATIC_DEFINE /I "$VCPKG\include" /Fe:div_bench_opt.exe div_bench.cpp /link /LTCG:PGOptimize /USEPROFILE /PGD:div_bench.pgd /LIBPATH:"$VCPKG\lib" benchmark.lib benchmark_main.lib shlwapi.lib
5959
```
6060

@@ -64,7 +64,7 @@ In this command, the [USEPROFILE linker option](https://learn.microsoft.com/en-u
6464

6565
Now run the optimized binary:
6666

67-
```bash
67+
```console
6868
.\div_bench_opt.exe
6969
```
7070

0 commit comments

Comments
 (0)