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