Makefile.mk 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2018-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. # Copyright (C) 2018 Alexis Juven
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. CC = gcc
  18. CFLAGS += $(shell pkg-config --cflags starpu-1.3)
  19. LDFLAGS += $(shell pkg-config --libs starpu-1.3)
  20. all: libjlstarpu_c_wrapper.so build/mult build/extern_tasks.so build/generated_tasks.so
  21. libjlstarpu_c_wrapper.so: ../src/Wrapper/C/jlstarpu_task_submit.c ../src/Wrapper/C/jlstarpu_simple_functions.c ../src/Wrapper/C/jlstarpu_data_handles.c
  22. $(CC) -O3 -shared -fPIC $(CFLAGS) $^ -o $@ $(LDFLAGS)
  23. build/mult: mult.c build/cpu_mult.o build/gpu_mult.o
  24. $(CC) $(CFLAGS) -O3 $^ -o $@ $(LDFLAGS)
  25. build/gpu_mult.o: gpu_mult.cu
  26. nvcc -c -O3 $(CFLAGS) $^ -o $@
  27. build/cpu_mult.o: cpu_mult.c
  28. $(CC) -c $(CFLAGS) -O3 $^ -o $@ $(LDFLAGS)
  29. build/extern_tasks.so: build/cpu_mult.so build/gpu_mult.so
  30. gcc -shared -fPIC $^ -o $@
  31. build/cpu_mult.so: cpu_mult.c
  32. $(CC) -O3 -shared -fPIC $(CFLAGS) $^ -o $@ $(LDFLAGS)
  33. build/gpu_mult.so: gpu_mult.cu
  34. nvcc -O3 $(CFLAGS) $^ --shared --compiler-options '-fPIC' -o $@
  35. build/generated_tasks.so: cpu_cuda_mult.jl
  36. julia $^
  37. clean:
  38. rm build/* libjlstarpu_c_wrapper.so