Skip to content

Commit 1ab80d3

Browse files
Fix -O2 flag place
1 parent 6ea76df commit 1ab80d3

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

Languages/Cpp/Example1/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ C++ code illustrating using C++ on the FASRC cluster. `sum.cpp` computes integer
1313
// Program: sum.cpp
1414
// Computes integer sum from 1 to N where N
1515
// is a number read from the command line
16-
// Compile: g++ -o sum.x sum.cpp
1716
//==========================================================
1817
#include <iostream>
1918
#include <string>
@@ -51,15 +50,15 @@ salloc --partition test --time 00:30:00 -c 2 --mem-per-cpu 2G
5150

5251
```bash
5352
module load intel
54-
icpc -o sum.x sum.cpp -O2 # for intel version < 24, use `icpc`
55-
icpx -o sum.x sum.cpp -O2 # for intel version >= 24, use `icpx`.
53+
icpc -O2 -o sum.x sum.cpp # for intel version < 23.2, use `icpc`
54+
icpx -O2 -o sum.x sum.cpp # for intel version >= 23.2, use `icpx`.
5655
```
5756

5857
* GNU compilers, e.g.,
5958

6059
```bash
6160
module load gcc
62-
g++ -o sum.x sum.cpp -O2
61+
g++ -O2 -o sum.x sum.cpp
6362
```
6463

6564
### Run interactive code

Languages/Cpp/Example2/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Since this code reads an input from the command line, it cannot be run as a batc
1616
1717
Computes sum of integers from 1 to N
1818
( N is read from command line )
19-
20-
Compile: g++ -o sum2.x sum2.cpp
2119
*/
2220
#include <iostream>
2321
#include <string>
@@ -69,15 +67,15 @@ salloc --partition test --time 00:30:00 -c 2 --mem-per-cpu 2G
6967

7068
```bash
7169
module load intel
72-
icpc -o sum2.x sum2.cpp -O2 # for intel version < 24, use `icpc`
73-
icpx -o sum2.x sum2.cpp -O2 # for intel version >= 24, use `icpx`.
70+
icpc -O2 -o sum2.x sum2.cpp # for intel version < 23.2, use `icpc`
71+
icpx -O2 -o sum2.x sum2.cpp # for intel version >= 23.2, use `icpx`.
7472
```
7573

7674
* GNU compilers, e.g.,
7775

7876
```bash
7977
module load gcc
80-
g++ -o sum2.x sum2.cpp -O2
78+
g++ -O2 -o sum2.x sum2.cpp
8179
```
8280

8381
### Run interactive code

Languages/Cpp/Example3/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ salloc --partition test --time 00:30:00 -c 2 --mem-per-cpu 2G
7373

7474
```bash
7575
module load intel
76-
icpc -O2 -o allocate.x allocate.cpp -O2 # for intel version < 23.2, use `icpc`
77-
icpx -O2 -o allocate.x allocate.cpp -O2 # for intel version >= 23.2, use `icpx`.
76+
icpc -O2 -o allocate.x allocate.cpp # for intel version < 23.2, use `icpc`
77+
icpx -O2 -o allocate.x allocate.cpp # for intel version >= 23.2, use `icpx`.
7878
```
7979

8080
* GNU compilers, e.g.,

0 commit comments

Comments
 (0)