Makefile.am 4.9 KB

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