Makefile.am 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 += --compiler-options -fno-strict-aliasing -I$(top_srcdir)/include/ -I$(top_builddir)/include/ -I$(top_srcdir)/examples/ $(HWLOC_CFLAGS)
  43. .cu.cubin:
  44. $(V_nvcc) $(NVCC) -cubin $< -o $@ $(NVCCFLAGS)
  45. .cu.o:
  46. $(V_nvcc) $(NVCC) $< -c -o $@ $(NVCCFLAGS)
  47. endif
  48. endif
  49. #####################################
  50. # What to install and what to check #
  51. #####################################
  52. if STARPU_HAVE_WINDOWS
  53. check_PROGRAMS = $(STARPU_EXAMPLES)
  54. else
  55. check_PROGRAMS = $(LOADER) $(STARPU_EXAMPLES)
  56. endif
  57. if !STARPU_SIMGRID
  58. if USE_MPI
  59. if STARPU_MPI_CHECK
  60. TESTS = $(STARPU_EXAMPLES)
  61. endif
  62. else
  63. TESTS = $(STARPU_EXAMPLES)
  64. endif
  65. endif
  66. if !STARPU_HAVE_WINDOWS
  67. ## test loader program
  68. if !STARPU_CROSS_COMPILING
  69. LOADER = loader
  70. loader_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
  71. LOADER_BIN = ./$(LOADER)
  72. loader_SOURCES = ../../tests/loader.c
  73. else
  74. LOADER =
  75. LOADER_BIN = $(top_builddir)/examples/stencil/loader-cross.sh
  76. endif
  77. if STARPU_USE_MPI_MASTER_SLAVE
  78. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  79. endif
  80. if STARPU_HAVE_AM111
  81. TESTS_ENVIRONMENT = $(MPI_RUN_ARGS) top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
  82. LOG_COMPILER = $(MPI) $(LOADER_BIN)
  83. else
  84. TESTS_ENVIRONMENT = $(MPI_RUN_ARGS) top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(MPI) $(LOADER_BIN)
  85. endif
  86. endif
  87. ###################
  88. # stencil example #
  89. ###################
  90. STARPU_EXAMPLES = \
  91. stencil \
  92. implicit_stencil
  93. examplebindir = $(libdir)/starpu/examples/stencil
  94. examplebin_PROGRAMS = \
  95. stencil \
  96. implicit_stencil
  97. stencil_SOURCES = \
  98. life.c \
  99. stencil-kernels.c \
  100. stencil-tasks.c \
  101. stencil-blocks.c \
  102. stencil.c
  103. noinst_HEADERS = \
  104. stencil.h \
  105. implicit-stencil.h \
  106. shadow.h
  107. if STARPU_USE_CUDA
  108. stencil_SOURCES += \
  109. life_cuda.cu \
  110. shadow.cu
  111. endif
  112. if STARPU_USE_OPENCL
  113. stencil_SOURCES += \
  114. life_opencl.c \
  115. shadow_opencl.c
  116. endif
  117. implicit_stencil_SOURCES = \
  118. life.c \
  119. implicit-stencil-kernels.c \
  120. implicit-stencil-tasks.c \
  121. implicit-stencil-blocks.c \
  122. implicit-stencil.c
  123. noinst_HEADERS = \
  124. stencil.h \
  125. implicit-stencil.h \
  126. shadow.h
  127. if STARPU_USE_CUDA
  128. implicit_stencil_SOURCES += \
  129. life_cuda.cu \
  130. shadow.cu
  131. endif
  132. if STARPU_USE_OPENCL
  133. implicit_stencil_SOURCES += \
  134. life_opencl.c \
  135. shadow_opencl.c
  136. endif
  137. outs = \
  138. 0.5.out \
  139. 0.out \
  140. 1.out \
  141. 2.out \
  142. 3.out \
  143. 4.out \
  144. 6.out \
  145. mpi.out
  146. EXTRA_DIST = $(outs) results run README
  147. pics: $(outs:.out=.xpm)
  148. CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
  149. .out.out2:
  150. grep '^|' $< | tr -d ' ' > $@
  151. .out2.xpm:
  152. ( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
  153. height=`wc -l < $<` ; \
  154. echo "/* XPM */" ; \
  155. echo "static char * test_xpm[] = {" ; \
  156. echo "\"$$width $$height 9 1\"," ; \
  157. echo "\"_ c None\"," ; \
  158. echo "\"0 c #FF0000\"," ; \
  159. echo "\"1 c #00FF00\"," ; \
  160. echo "\"2 c #0000FF\"," ; \
  161. echo "\"3 c #FFFF00\"," ; \
  162. echo "\"4 c #FF00FF\"," ; \
  163. echo "\"5 c #00FFFF\"," ; \
  164. echo "\"| c #FFFFFF\"," ; \
  165. echo "\"* c #000000\"," ; \
  166. < $< sed -e 's/^/"/' -e 's/$$/",/' | sed -e '$$s/",$$/"};/' ) > $@
  167. view:
  168. feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm