Makefile.am 4.9 KB

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