-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set CMake version to 1.6 * Fix initial demo related issues (Makefile, deprecated MPI symbols) * Rework README.md
- Loading branch information
Showing
8 changed files
with
353 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
01_ex | ||
02_ex | ||
toy | ||
toy-stack | ||
libtool.so | ||
types.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,48 @@ | ||
BUILDDIR ?= ../build | ||
# NOTE: env TYPEART_PATH must be set to install base path of TypeART | ||
|
||
MPIRUN ?= mpirun | ||
MPICC ?= OMPI_CC=clang mpicc | ||
CC ?= cc | ||
TYPEART_PASS_DIR = $(BUILDDIR)/lib | ||
TYPEART_RUNTIME_DIR = $(BUILDDIR)/runtime | ||
CLFLAGS = -L$(TYPEART_RUNTIME_DIR) -ltypeart-rt | ||
CFLAGS = -Xclang -load -Xclang $(TYPEART_PASS_DIR)/analysis/meminstfinderpass.so -Xclang -load -Xclang $(TYPEART_PASS_DIR)/typeartpass.so -mllvm -alloca-array-only=false -mllvm -typeart-alloca | ||
|
||
TYPEART_LIBPATH = ${TYPEART_PATH}/lib | ||
TYPEART_INCPATH = ${TYPEART_PATH}/include | ||
|
||
typeart_plugin = -load $(TYPEART_LIBPATH)/meminstfinderpass.so -load $(TYPEART_LIBPATH)/typeartpass.so -typeart | ||
typeart_stack_mode_args = -typeart-no-heap -typeart-alloca -typeart-stats -S | ||
typeart_heap_mode_args = -typeart-no-heap=false -typeart-stats -S | ||
|
||
CLFLAGS = -L$(TYPEART_LIBPATH) -ltypeart-rt | ||
|
||
all: libtool.so 01_ex 02_ex toy toy-stack toy-nostack | ||
all: libtool.so 01_ex 02_ex toy toy-stack | ||
|
||
libtool.so: tool.c | ||
$(MPICC) -I../runtime/ -I../typelib/ $(CLFLAGS) -shared -fPIC $< -o $@ | ||
$(MPICC) -I$(TYPEART_INCPATH) $(CLFLAGS) -shared -fPIC $< -o $@ | ||
|
||
01_ex: 01_struct_example.c | ||
$(MPICC) $(CFLAGS) $(CLFLAGS) $< -o $@ -O1 | ||
$(MPICC) -g -O1 -Xclang -disable-llvm-passes -S -emit-llvm $< -o - | opt $(typeart_plugin) $(typeart_heap_mode_args) | opt -O1 -S | opt $(typeart_plugin) $(typeart_stack_mode_args) | llc -x=ir -filetype=obj -o $@.o | ||
$(MPICC) $(CLFLAGS) $@.o -o $@ | ||
02_ex: 02_broken_struct_example.c | ||
$(MPICC) $(CFLAGS) $(CLFLAGS) $< -o $@ -O1 | ||
03_ex: 03_array_example.c | ||
$(MPICC) $(CFLAGS) $(CLFLAGS) $< -o $@ -O1 | ||
|
||
toy: toy.c | ||
$(MPICC) -I../runtime/ -I../typelib/ $(CFLAGS) $(CLFLAGS) $< -o $@ -g | ||
$(MPICC) -g -O1 -Xclang -disable-llvm-passes -S -emit-llvm $< -o - | opt $(typeart_plugin) $(typeart_heap_mode_args) | opt -O1 -S | opt $(typeart_plugin) $(typeart_stack_mode_args) | llc -x=ir -filetype=obj -o $@.o | ||
$(MPICC) $(CLFLAGS) $@.o -o $@ | ||
|
||
toy-stack: toy.c | ||
$(MPICC) -I../runtime/ -I../typelib/ -S -emit-llvm $< -o $@.ll -g | ||
opt -load $(TYPEART_PASS_DIR)/analysis/meminstfinderpass.so -load $(TYPEART_PASS_DIR)/typeartpass.so -typeart -typeart-alloca -alloca-array-only=false < $@.ll -o $@.ll > /dev/null | ||
llc $@.ll -o $@.s | ||
$(MPICC) $(CLFLAGS) $@.s -o $@ | ||
|
||
toy-nostack: toy.c | ||
$(MPICC) -I../runtime/ -I../typelib/ -DNOSTACK -S -emit-llvm $< -o $@.ll -g | ||
opt -load $(TYPEART_PASS_DIR)/analysis/meminstfinderpass.so -load $(TYPEART_PASS_DIR)/typeartpass.so -typeart < $@.ll -o $@.ll > /dev/null | ||
llc $@.ll -o $@.s | ||
$(MPICC) $(CLFLAGS) $@.s -o $@ | ||
$(MPICC) -I$(TYPEART_INCPATH) -g -O1 -Xclang -disable-llvm-passes -S -emit-llvm $< -o - | opt $(typeart_plugin) $(typeart_heap_mode_args) | opt -O1 -S | opt $(typeart_plugin) $(typeart_stack_mode_args) | llc -x=ir -filetype=obj -o $@.o | ||
$(MPICC) $(CLFLAGS) $@.o -o $@ | ||
|
||
toy: toy.c | ||
$(MPICC) -I$(TYPEART_INCPATH) -DNOSTACK -g -O1 -Xclang -disable-llvm-passes -S -emit-llvm $< -o - | opt $(typeart_plugin) $(typeart_heap_mode_args) | opt -O1 -S | opt $(typeart_plugin) $(typeart_stack_mode_args) | llc -x=ir -filetype=obj -o $@.o | ||
$(MPICC) $(CLFLAGS) $@.o -o $@ | ||
|
||
runtoy: toy toy-stack toy-nostack | ||
env LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_RUNTIME_DIR) ./toy | ||
env LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_RUNTIME_DIR) ./toy-stack | ||
env LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_RUNTIME_DIR) ./toy-nostack | ||
runtoy: toy toy-stack | ||
env LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_LIBPATH) ./toy | ||
env LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_LIBPATH) ./toy-stack | ||
|
||
run: run01 run02 run03 | ||
run: run01 run02 | ||
|
||
run01: 01_ex libtool.so | ||
env LD_PRELOAD=./libtool.so LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_RUNTIME_DIR) $(MPIRUN) -np 1 01_ex | ||
env LD_PRELOAD=./libtool.so LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_LIBPATH) $(MPIRUN) -np 1 01_ex | ||
run02: 02_ex libtool.so | ||
env LD_PRELOAD=./libtool.so LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_RUNTIME_DIR) $(MPIRUN) -np 1 02_ex | ||
run03: 03_ex libtool.so | ||
env LD_PRELOAD=./libtool.so LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_RUNTIME_DIR) $(MPIRUN) -np 4 03_ex | ||
|
||
env LD_PRELOAD=./libtool.so LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(TYPEART_LIBPATH) $(MPIRUN) -np 1 02_ex | ||
|
||
clean: | ||
rm *~ libtool.so 01_ex 02_ex types.yaml | ||
rm *.o libtool.so 01_ex 02_ex toy toy-stack types.yaml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters