Makefile.am 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  16. include $(top_srcdir)/starpu.mk
  17. AM_CFLAGS += -Wno-unused
  18. AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/ -I$(top_builddir)/include $(STARPU_H_CPPFLAGS)
  19. AM_LDFLAGS = @STARPU_EXPORT_DYNAMIC@
  20. LIBS += $(top_builddir)/src/@LIBSTARPU_LINK@
  21. LIBS += $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS)
  22. LIBS += $(STARPU_EXPORTED_LIBS)
  23. if STARPU_USE_MPI
  24. LIBS += $(top_builddir)/mpi/src/libstarpumpi-@STARPU_EFFECTIVE_VERSION@.la
  25. AM_CPPFLAGS += -I$(top_srcdir)/mpi/include
  26. if STARPU_SIMGRID
  27. MPI = $(abs_top_builddir)/tools/starpu_smpirun -np 4 -platform $(abs_top_srcdir)/tools/perfmodels/cluster.xml -hostfile $(abs_top_srcdir)/tools/perfmodels/hostfile
  28. NVCCFLAGS += --compiler-options -fPIC
  29. else
  30. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  31. endif
  32. else
  33. MPI =
  34. endif
  35. CC = $(CC_OR_MPICC)
  36. if STARPU_USE_CUDA
  37. if STARPU_COVERITY
  38. include $(top_srcdir)/starpu-mynvcc.mk
  39. else
  40. NVCCFLAGS += --compiler-options -fno-strict-aliasing -I$(top_srcdir)/include/ -I$(top_builddir)/include/ -I$(top_srcdir)/examples/ $(HWLOC_CFLAGS)
  41. .cu.cubin:
  42. $(V_nvcc) $(NVCC) -cubin $< -o $@ $(NVCCFLAGS)
  43. .cu.o:
  44. $(V_nvcc) $(NVCC) $< -c -o $@ $(NVCCFLAGS)
  45. endif
  46. endif
  47. #####################################
  48. # What to install and what to check #
  49. #####################################
  50. check_PROGRAMS = $(STARPU_EXAMPLES)
  51. noinst_PROGRAMS =
  52. if !STARPU_SIMGRID
  53. if STARPU_USE_MPI
  54. if STARPU_MPI_CHECK
  55. TESTS = $(STARPU_EXAMPLES)
  56. endif
  57. else
  58. TESTS = $(STARPU_EXAMPLES)
  59. endif
  60. endif
  61. if !STARPU_HAVE_WINDOWS
  62. ## test loader program
  63. if !STARPU_CROSS_COMPILING
  64. LOADER = loader
  65. loader_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/src/
  66. LOADER_BIN = ./$(LOADER)
  67. loader_SOURCES = ../../tests/loader.c
  68. noinst_PROGRAMS += loader
  69. else
  70. LOADER =
  71. LOADER_BIN = $(top_builddir)/examples/stencil/loader-cross.sh
  72. endif
  73. if STARPU_USE_MPI_MASTER_SLAVE
  74. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  75. endif
  76. if STARPU_HAVE_AM111
  77. TESTS_ENVIRONMENT = $(MPI_RUN_ARGS) top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
  78. LOG_COMPILER = $(MPI) $(LOADER_BIN)
  79. else
  80. TESTS_ENVIRONMENT = $(MPI_RUN_ARGS) top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(MPI) $(LOADER_BIN)
  81. endif
  82. endif
  83. ###################
  84. # stencil example #
  85. ###################
  86. STARPU_EXAMPLES = \
  87. stencil \
  88. implicit_stencil
  89. examplebindir = $(libdir)/starpu/examples/stencil
  90. examplebin_PROGRAMS = \
  91. stencil \
  92. implicit_stencil
  93. stencil_SOURCES = \
  94. life.c \
  95. stencil-kernels.c \
  96. stencil-tasks.c \
  97. stencil-blocks.c \
  98. stencil.c
  99. noinst_HEADERS = \
  100. stencil.h \
  101. implicit-stencil.h \
  102. shadow.h
  103. if STARPU_USE_CUDA
  104. stencil_SOURCES += \
  105. life_cuda.cu \
  106. shadow.cu
  107. endif
  108. if STARPU_USE_OPENCL
  109. stencil_SOURCES += \
  110. life_opencl.c \
  111. shadow_opencl.c
  112. endif
  113. implicit_stencil_SOURCES = \
  114. life.c \
  115. implicit-stencil-kernels.c \
  116. implicit-stencil-tasks.c \
  117. implicit-stencil-blocks.c \
  118. implicit-stencil.c
  119. if STARPU_USE_CUDA
  120. implicit_stencil_SOURCES += \
  121. life_cuda.cu \
  122. shadow.cu
  123. endif
  124. if STARPU_USE_OPENCL
  125. implicit_stencil_SOURCES += \
  126. life_opencl.c \
  127. shadow_opencl.c
  128. endif
  129. outs = \
  130. 0.5.out \
  131. 0.out \
  132. 1.out \
  133. 2.out \
  134. 3.out \
  135. 4.out \
  136. 6.out \
  137. mpi.out
  138. EXTRA_DIST = $(outs) results run README
  139. pics: $(outs:.out=.xpm)
  140. CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
  141. .out.out2:
  142. $(GREP) '^|' $< | tr -d ' ' > $@
  143. .out2.xpm:
  144. ( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
  145. height=`wc -l < $<` ; \
  146. echo "/* XPM */" ; \
  147. echo "static char * test_xpm[] = {" ; \
  148. echo "\"$$width $$height 9 1\"," ; \
  149. echo "\"_ c None\"," ; \
  150. echo "\"0 c #FF0000\"," ; \
  151. echo "\"1 c #00FF00\"," ; \
  152. echo "\"2 c #0000FF\"," ; \
  153. echo "\"3 c #FFFF00\"," ; \
  154. echo "\"4 c #FF00FF\"," ; \
  155. echo "\"5 c #00FFFF\"," ; \
  156. echo "\"| c #FFFFFF\"," ; \
  157. echo "\"* c #000000\"," ; \
  158. < $< $(SED) -e 's/^/"/' -e 's/$$/",/' | $(SED) -e '$$s/",$$/"};/' ) > $@
  159. view:
  160. feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm