1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-12-01 12:34:20 +00:00
hpc-2022-g3/openmp/lab3/Makefile

33 lines
642 B
Makefile
Raw Normal View History

2021-04-21 08:16:41 +00:00
ifndef EXERCISE
EXERCISE=exercise1.c
endif
CC=clang
LD=ld
OBJDUMP=objdump
OPT=-O3 -g
OMP=-fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda
CFLAGS=$(OPT) $(OMP) -I. $(EXT_CFLAGS)
LDFLAGS=-lm $(EXT_LDFLAGS)
SRCS=utils.c
OBJS=$(SRCS:.c=.o) $(EXERCISE:.c=.o)
EXE=$(EXERCISE:.c=.exe)
$(EXE): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
all: $(EXE)
.PHONY: run profile clean
run: $(EXE)
2021-04-21 09:04:24 +00:00
./$(EXE) $(EXT_ARGS)
2021-04-21 08:16:41 +00:00
profile: $(EXE)
sudo LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/ext/lib:${LD_LIBRARY_PATH} LIBRARY_PATH=/usr/ext/lib:${LIBRARY_PATH} /usr/local/cuda/bin/nvprof ./$(EXE) $(EXT_ARGS)
2021-04-21 08:16:41 +00:00
clean:
rm -f $(OBJS) *.o *.exe *.out *~