forked from kaby76/Campy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.sh
49 lines (49 loc) · 1.05 KB
/
demo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
mkdir test
cd test
dotnet new console
cat - << HERE > Program.cs
namespace test
{
class Program
{
static void Main(string[] args)
{
int n = 4;
int[] x = new int[n];
Campy.Parallel.For(n, i => x[i] = i);
for (int i = 0; i < n; ++i)
System.Console.WriteLine(x[i]);
}
}
}
HERE
dotnet add package Campy
dotnet build
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
dotnet publish -r ubuntu.16.04-x64
cd bin/Debug/netcoreapp2.1/ubuntu.16.04-x64/publish/
./test
;;
Darwin*)
echo Cannot target Mac yet.
exit 1
;;
CYGWIN*)
dotnet publish -r win10-x64
cd bin/Debug/netcoreapp2.1/win10-x64/publish/
./test.exe
;;
MINGW*)
dotnet publish -r win10-x64
cd bin/Debug/netcoreapp2.1/win10-x64/publish/
./test.exe
;;
*)
echo Unknown machine.
exit 1
;;
esac
echo Output should be four lines of integers, 0 to 3.