Makefile.am 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2012, 2015-2016 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. 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. TESTS = $(STARPU_EXAMPLES)
  54. endif
  55. if !STARPU_HAVE_WINDOWS
  56. ## test loader program
  57. if !STARPU_CROSS_COMPILING
  58. LOADER = loader
  59. loader_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
  60. LOADER_BIN = ./$(LOADER)
  61. loader_SOURCES = ../../tests/loader.c
  62. else
  63. LOADER =
  64. LOADER_BIN = $(top_builddir)/examples/stencil/loader-cross.sh
  65. endif
  66. if STARPU_HAVE_AM111
  67. TESTS_ENVIRONMENT = top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
  68. LOG_COMPILER = $(LOADER_BIN)
  69. else
  70. TESTS_ENVIRONMENT = top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
  71. endif
  72. endif
  73. ###################
  74. # stencil example #
  75. ###################
  76. STARPU_EXAMPLES = \
  77. stencil \
  78. implicit_stencil
  79. examplebindir = $(libdir)/starpu/examples/stencil
  80. examplebin_PROGRAMS = \
  81. stencil \
  82. implicit_stencil
  83. stencil_SOURCES = \
  84. life.c \
  85. stencil-kernels.c \
  86. stencil-tasks.c \
  87. stencil-blocks.c \
  88. stencil.c
  89. noinst_HEADERS = \
  90. stencil.h \
  91. shadow.h
  92. if STARPU_USE_CUDA
  93. stencil_SOURCES += \
  94. life_cuda.cu \
  95. shadow.cu
  96. endif
  97. if STARPU_USE_OPENCL
  98. stencil_SOURCES += \
  99. life_opencl.c \
  100. shadow_opencl.c
  101. endif
  102. implicit_stencil_SOURCES = \
  103. life.c \
  104. implicit-stencil-kernels.c \
  105. implicit-stencil-tasks.c \
  106. implicit-stencil-blocks.c \
  107. implicit-stencil.c
  108. noinst_HEADERS = \
  109. implicit-stencil.h \
  110. shadow.h
  111. if STARPU_USE_CUDA
  112. implicit_stencil_SOURCES += \
  113. life_cuda.cu \
  114. shadow.cu
  115. endif
  116. if STARPU_USE_OPENCL
  117. implicit_stencil_SOURCES += \
  118. life_opencl.c \
  119. shadow_opencl.c
  120. endif
  121. outs = \
  122. 0.5.out \
  123. 0.out \
  124. 1.out \
  125. 2.out \
  126. 3.out \
  127. 4.out \
  128. 6.out \
  129. mpi.out
  130. EXTRA_DIST = $(outs) results run README
  131. pics: $(outs:.out=.xpm)
  132. CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
  133. .out.out2:
  134. grep '^|' $< | tr -d ' ' > $@
  135. .out2.xpm:
  136. ( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
  137. height=`wc -l < $<` ; \
  138. echo "/* XPM */" ; \
  139. echo "static char * test_xpm[] = {" ; \
  140. echo "\"$$width $$height 9 1\"," ; \
  141. echo "\"_ c None\"," ; \
  142. echo "\"0 c #FF0000\"," ; \
  143. echo "\"1 c #00FF00\"," ; \
  144. echo "\"2 c #0000FF\"," ; \
  145. echo "\"3 c #FFFF00\"," ; \
  146. echo "\"4 c #FF00FF\"," ; \
  147. echo "\"5 c #00FFFF\"," ; \
  148. echo "\"| c #FFFFFF\"," ; \
  149. echo "\"* c #000000\"," ; \
  150. < $< sed -e 's/^/"/' -e 's/$$/",/' | sed -e '$$s/",$$/"};/' ) > $@
  151. view:
  152. feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm