Makefile.am 5.0 KB

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