Makefile.am 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2011,2016,2017 Inria
  4. # Copyright (C) 2011-2019 CNRS
  5. # Copyright (C) 2010-2017 Université de Bordeaux
  6. #
  7. # StarPU is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # StarPU is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. #
  16. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. #
  18. include $(top_srcdir)/starpu.mk
  19. AM_CFLAGS = $(HWLOC_CFLAGS) $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(GLOBAL_AM_CFLAGS) -Wno-unused
  20. LIBS = $(top_builddir)/src/@LIBSTARPU_LINK@ $(HWLOC_LIBS) @LIBS@ $(FXT_LIBS)
  21. AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/ -I$(top_builddir)/include
  22. AM_LDFLAGS = @STARPU_EXPORT_DYNAMIC@ $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(STARPU_COI_LDFLAGS) $(STARPU_SCIF_LDFLAGS)
  23. if USE_MPI
  24. LIBS += $(top_builddir)/mpi/src/libstarpumpi-@STARPU_EFFECTIVE_VERSION@.la
  25. AM_CPPFLAGS += -I$(top_srcdir)/mpi/include
  26. if STARPU_SIMGRID
  27. MPI = $(abs_top_builddir)/tools/starpu_smpirun -np 4 -platform $(abs_top_srcdir)/tools/perfmodels/cluster.xml -hostfile $(abs_top_srcdir)/tools/perfmodels/hostfile
  28. else
  29. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  30. endif
  31. else
  32. MPI =
  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 += --compiler-options -fno-strict-aliasing -I$(top_srcdir)/include/ -I$(top_builddir)/include/ -I$(top_srcdir)/examples/ $(HWLOC_CFLAGS)
  40. .cu.cubin:
  41. $(V_nvcc) $(NVCC) -cubin $< -o $@ $(NVCCFLAGS)
  42. .cu.o:
  43. $(V_nvcc) $(NVCC) $< -c -o $@ $(NVCCFLAGS)
  44. endif
  45. endif
  46. #####################################
  47. # What to install and what to check #
  48. #####################################
  49. if STARPU_HAVE_WINDOWS
  50. check_PROGRAMS = $(STARPU_EXAMPLES)
  51. else
  52. check_PROGRAMS = $(LOADER) $(STARPU_EXAMPLES)
  53. endif
  54. if !STARPU_SIMGRID
  55. if USE_MPI
  56. if STARPU_MPI_CHECK
  57. TESTS = $(STARPU_EXAMPLES)
  58. endif
  59. else
  60. TESTS = $(STARPU_EXAMPLES)
  61. endif
  62. endif
  63. if !STARPU_HAVE_WINDOWS
  64. ## test loader program
  65. if !STARPU_CROSS_COMPILING
  66. LOADER = loader
  67. loader_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
  68. LOADER_BIN = ./$(LOADER)
  69. loader_SOURCES = ../../tests/loader.c
  70. else
  71. LOADER =
  72. LOADER_BIN = $(top_builddir)/examples/stencil/loader-cross.sh
  73. endif
  74. if STARPU_USE_MPI_MASTER_SLAVE
  75. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  76. endif
  77. if STARPU_HAVE_AM111
  78. TESTS_ENVIRONMENT = $(MPI_RUN_ARGS) top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
  79. LOG_COMPILER = $(MPI) $(LOADER_BIN)
  80. else
  81. TESTS_ENVIRONMENT = $(MPI_RUN_ARGS) top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(MPI) $(LOADER_BIN)
  82. endif
  83. endif
  84. ###################
  85. # stencil example #
  86. ###################
  87. STARPU_EXAMPLES = \
  88. stencil \
  89. implicit_stencil
  90. examplebindir = $(libdir)/starpu/examples/stencil
  91. examplebin_PROGRAMS = \
  92. stencil \
  93. implicit_stencil
  94. stencil_SOURCES = \
  95. life.c \
  96. stencil-kernels.c \
  97. stencil-tasks.c \
  98. stencil-blocks.c \
  99. stencil.c
  100. noinst_HEADERS = \
  101. stencil.h \
  102. implicit-stencil.h \
  103. shadow.h
  104. if STARPU_USE_CUDA
  105. stencil_SOURCES += \
  106. life_cuda.cu \
  107. shadow.cu
  108. endif
  109. if STARPU_USE_OPENCL
  110. stencil_SOURCES += \
  111. life_opencl.c \
  112. shadow_opencl.c
  113. endif
  114. implicit_stencil_SOURCES = \
  115. life.c \
  116. implicit-stencil-kernels.c \
  117. implicit-stencil-tasks.c \
  118. implicit-stencil-blocks.c \
  119. implicit-stencil.c
  120. noinst_HEADERS = \
  121. stencil.h \
  122. implicit-stencil.h \
  123. shadow.h
  124. if STARPU_USE_CUDA
  125. implicit_stencil_SOURCES += \
  126. life_cuda.cu \
  127. shadow.cu
  128. endif
  129. if STARPU_USE_OPENCL
  130. implicit_stencil_SOURCES += \
  131. life_opencl.c \
  132. shadow_opencl.c
  133. endif
  134. outs = \
  135. 0.5.out \
  136. 0.out \
  137. 1.out \
  138. 2.out \
  139. 3.out \
  140. 4.out \
  141. 6.out \
  142. mpi.out
  143. EXTRA_DIST = $(outs) results run README
  144. pics: $(outs:.out=.xpm)
  145. CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
  146. .out.out2:
  147. $(GREP) '^|' $< | tr -d ' ' > $@
  148. .out2.xpm:
  149. ( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
  150. height=`wc -l < $<` ; \
  151. echo "/* XPM */" ; \
  152. echo "static char * test_xpm[] = {" ; \
  153. echo "\"$$width $$height 9 1\"," ; \
  154. echo "\"_ c None\"," ; \
  155. echo "\"0 c #FF0000\"," ; \
  156. echo "\"1 c #00FF00\"," ; \
  157. echo "\"2 c #0000FF\"," ; \
  158. echo "\"3 c #FFFF00\"," ; \
  159. echo "\"4 c #FF00FF\"," ; \
  160. echo "\"5 c #00FFFF\"," ; \
  161. echo "\"| c #FFFFFF\"," ; \
  162. echo "\"* c #000000\"," ; \
  163. < $< $(SED) -e 's/^/"/' -e 's/$$/",/' | $(SED) -e '$$s/",$$/"};/' ) > $@
  164. view:
  165. feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm