Makefile.am 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  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. #
  16. include $(top_srcdir)/starpu.mk
  17. AM_CFLAGS = $(HWLOC_CFLAGS) $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(STARPU_FPGA_CPPFLAGS) $(GLOBAL_AM_CFLAGS) -Wno-unused
  18. AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/ -I$(top_builddir)/include
  19. AM_LDFLAGS = @STARPU_EXPORT_DYNAMIC@
  20. LIBS += $(top_builddir)/src/@LIBSTARPU_LINK@ $(HWLOC_LIBS) $(FXT_LIBS)
  21. LIBS += $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(STARPU_COI_LDFLAGS) $(STARPU_SCIF_LDFLAGS)
  22. if STARPU_USE_MPI
  23. LIBS += $(top_builddir)/mpi/src/libstarpumpi-@STARPU_EFFECTIVE_VERSION@.la
  24. AM_CPPFLAGS += -I$(top_srcdir)/mpi/include
  25. if STARPU_SIMGRID
  26. MPI = $(abs_top_builddir)/tools/starpu_smpirun -np 4 -platform $(abs_top_srcdir)/tools/perfmodels/cluster.xml -hostfile $(abs_top_srcdir)/tools/perfmodels/hostfile
  27. NVCCFLAGS += --compiler-options -fPIC
  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. check_PROGRAMS = $(STARPU_EXAMPLES)
  50. noinst_PROGRAMS =
  51. if !STARPU_SIMGRID
  52. if STARPU_USE_MPI
  53. if STARPU_MPI_CHECK
  54. TESTS = $(STARPU_EXAMPLES)
  55. endif
  56. else
  57. TESTS = $(STARPU_EXAMPLES)
  58. endif
  59. endif
  60. if !STARPU_HAVE_WINDOWS
  61. ## test loader program
  62. if !STARPU_CROSS_COMPILING
  63. LOADER = loader
  64. loader_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/src/
  65. LOADER_BIN = ./$(LOADER)
  66. loader_SOURCES = ../../tests/loader.c
  67. noinst_PROGRAMS += loader
  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. if STARPU_USE_CUDA
  119. implicit_stencil_SOURCES += \
  120. life_cuda.cu \
  121. shadow.cu
  122. endif
  123. if STARPU_USE_OPENCL
  124. implicit_stencil_SOURCES += \
  125. life_opencl.c \
  126. shadow_opencl.c
  127. endif
  128. outs = \
  129. 0.5.out \
  130. 0.out \
  131. 1.out \
  132. 2.out \
  133. 3.out \
  134. 4.out \
  135. 6.out \
  136. mpi.out
  137. EXTRA_DIST = $(outs) results run README
  138. pics: $(outs:.out=.xpm)
  139. CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
  140. .out.out2:
  141. $(GREP) '^|' $< | tr -d ' ' > $@
  142. .out2.xpm:
  143. ( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
  144. height=`wc -l < $<` ; \
  145. echo "/* XPM */" ; \
  146. echo "static char * test_xpm[] = {" ; \
  147. echo "\"$$width $$height 9 1\"," ; \
  148. echo "\"_ c None\"," ; \
  149. echo "\"0 c #FF0000\"," ; \
  150. echo "\"1 c #00FF00\"," ; \
  151. echo "\"2 c #0000FF\"," ; \
  152. echo "\"3 c #FFFF00\"," ; \
  153. echo "\"4 c #FF00FF\"," ; \
  154. echo "\"5 c #00FFFF\"," ; \
  155. echo "\"| c #FFFFFF\"," ; \
  156. echo "\"* c #000000\"," ; \
  157. < $< $(SED) -e 's/^/"/' -e 's/$$/",/' | $(SED) -e '$$s/",$$/"};/' ) > $@
  158. view:
  159. feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm