Makefile.am 4.7 KB

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