File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,4 +31,5 @@ examples/vgg/models/vgg16/*.npy
3131new_sun.png
3232new_sun * .png
3333new_sun_hello.png
34- test /correspondence /gh.out
34+ test /correspondence /gh.out
35+ ! Makefile
Original file line number Diff line number Diff line change 1+ all : myProgram
2+
3+ myProgram : test.chpl libmylib.a # libmylib.a is the dependency for the executable
4+ chpl mylib.h -L. -lmylib -o myProgram test.chpl
5+
6+ # gcc -lm -o myProgram main.o -L. -lmylib
7+
8+ mylib.o : mylib.c mylib.h
9+ gcc -O -c mylib.c mylib.h
10+
11+ libmylib.a : mylib.o
12+ ar rcs libmylib.a mylib.o
13+
14+ libs : libmylib.a
15+
16+ clean :
17+ rm -f myProgram * .o * .a * .gch # This way is cleaner than your clean
Original file line number Diff line number Diff line change 1+
2+ #include "mylib.h"
3+
4+ int myfunction (int a ) {
5+ return a + 1 ;
6+ }
7+
8+
9+
Original file line number Diff line number Diff line change 1+
2+
3+ int myfunction (int a );
4+
Original file line number Diff line number Diff line change 1+ // require "mylib.h", "mylib.c";
2+
3+
4+ extern proc myfunction(x: int ): int ;
5+
6+
7+
8+ writeln (" Hello, world!" );
9+
10+ writeln (myfunction(5 ));
You can’t perform that action at this time.
0 commit comments