Makefile.am 4.7 KB

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