Skip to content

Commit

Permalink
Fix run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rbergen committed Nov 7, 2024
1 parent 67344d8 commit f53f8eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions PrimeCPP/solution_2/run.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
@echo off

IF "%1" == "" || "%1" == "1" || "%1" == "array" (
ECHO Building and running the array approach...
ECHO(
g++ -Ofast PrimeCPP_array.cpp -std=c++17 -lstdc++ -oPrimes_array.exe
.\Primes_array.exe
ECHO(
)

IF "%1" == "" || "%1" == "2" || "%1" == "mask" (
ECHO Building and running the mask approach...
ECHO(
g++ -Ofast PrimeCPP_mask.cpp -std=c++17 -lstdc++ -oPrimes_mask.exe
.\Primes_mask.exe
ECHO(
)
10 changes: 6 additions & 4 deletions PrimeCPP/solution_2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
# gcc -Ofast -std=c++17 PrimeCPP.cpp -lc++ -oPrimes_gcc.exe
# clang -Ofast -std=c++17 -lc++ PrimeCPP.cpp -oPrimes_clang.exe

if [[ "$#" -eq "0" -o "$1" -eq "1" -o "$1" -eq "array" ]]; then
echo "Building and running the array approach"
if [[ $# == 0 || $1 == 1 || $1 == array ]]; then
echo -e "Building and running the array approach...\n"
clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_array.cpp -oprimes_array.exe
./primes_array.exe
echo
fi

if [[ "$#" -eq "0" -o "$1" -eq "2" -o "$1" -eq "mask" ]]; then
echo "Building and running the mask approach"
if [[ $# == 0 || $1 == 2 || $1 == mask ]]; then
echo -e "Building and running the mask approach...\n"
clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_mask.cpp -oprimes_mask.exe
./primes_mask.exe
echo
fi

0 comments on commit f53f8eb

Please sign in to comment.