Browse Source

tools/release: Add examples/release/Makefile to test StarPU examples
against an installed version of StarPU. That can also be used to test
examples using a previous API.

Nathalie Furmento 12 years ago
parent
commit
817773b67a
3 changed files with 150 additions and 0 deletions
  1. 3 0
      ChangeLog
  2. 105 0
      tools/release/Makefile
  3. 42 0
      tools/release/README

+ 3 - 0
ChangeLog

@@ -130,6 +130,9 @@ Small features:
     activity polling method for StarPU-MPI.
   * Permit to disable sequential consistency for a given task.
   * New batch files to run StarPU applications with Microsoft Visual C
+  * Add examples/release/Makefile to test StarPU examples against an
+    installed version of StarPU. That can also be used to test
+    examples using a previous API.
 
 Changes:
   * Fix the block filter functions.

+ 105 - 0
tools/release/Makefile

@@ -0,0 +1,105 @@
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2009-2011  Université de Bordeaux 1
+# Copyright (C) 2010-2013  Centre National de la Recherche Scientifique
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+STARPU		?=	undefined
+EXAMPLE		?= 	undefined
+
+TARGETS	=	hello_world
+TARGETS +=	block
+TARGETS	+=	mult
+TARGETS	+=	variable
+TARGETS	+=	incrementer
+
+ifeq ($(STARPU),undefined)
+all:
+	@echo
+	@echo "ERROR. You need to set the variable STARPU to the name of the pkg-config StarPU package"
+	@echo
+clean:; rm -f $(TARGETS) *.o
+
+else
+ifeq ($(EXAMPLE),undefined)
+all:
+	@echo
+	@echo "ERROR. You need to set the variable EXAMPLE to the directory hosting the example sources"
+	@echo
+clean:; rm -f $(TARGETS) *.o
+
+else
+
+CFLAGS          +=      $$(pkg-config --cflags $(STARPU))
+LDFLAGS         +=      $$(pkg-config --libs $(STARPU))
+
+HAS_CUDA	=	$(shell pkg-config --libs $(STARPU) |grep -i cuda)
+NVCC		?=	nvcc
+HAS_OPENCL	=	$(shell pkg-config --libs $(STARPU) |grep -i opencl)
+
+%.o: $(EXAMPLE)/basic_examples/%.cu
+	$(NVCC) $(CFLAGS) $< -c
+%.o: $(EXAMPLE)/basic_examples/%.c
+	$(CC) $(CFLAGS) $< -c
+
+%.o: $(EXAMPLE)/incrementer/%.cu
+	$(NVCC) $(CFLAGS) $< -c
+%.o: $(EXAMPLE)/incrementer/%.c
+	$(CC) $(CFLAGS) $< -c
+
+all: $(TARGETS)
+
+BLOCK_PREREQUISITES	=	block.o block_cpu.o
+ifneq ($(strip $(HAS_CUDA)),)
+BLOCK_PREREQUISITES	+=	block_cuda.o
+BLOCK_COMPILER		=	$(NVCC)
+else
+BLOCK_COMPILER		=	$(CC)
+endif
+ifneq ($(strip $(HAS_OPENCL)),)
+BLOCK_PREREQUISITES    +=	block_opencl.o
+endif
+block: $(BLOCK_PREREQUISITES)
+	$(BLOCK_COMPILER) $(LDFLAGS) $^ -o $@
+
+VARIABLE_PREREQUISITES	=	variable.o variable_kernels_cpu.o
+ifneq ($(strip $(HAS_CUDA)),)
+VARIABLE_PREREQUISITES	+=	variable_kernels.o
+VARIABLE_COMPILER	=	$(NVCC)
+else
+VARIABLE_COMPILER	=	$(CC)
+endif
+ifneq ($(strip $(HAS_OPENCL)),)
+VARIABLE_PREREQUISITES    +=	variable_kernels_opencl.o
+endif
+variable: $(VARIABLE_PREREQUISITES)
+	$(VARIABLE_COMPILER) $(LDFLAGS) $^ -o $@
+
+INCREMENTER_PREREQUISITES	=	incrementer.o
+ifneq ($(strip $(HAS_CUDA)),)
+INCREMENTER_PREREQUISITES	+=	incrementer_kernels.o
+INCREMENTER_COMPILER		=	$(NVCC)
+else
+INCREMENTER_COMPILER		=	$(CC)
+endif
+ifneq ($(strip $(HAS_OPENCL)),)
+INCREMENTER_PREREQUISITES    +=	incrementer_kernels_opencl.o
+endif
+incrementer: $(INCREMENTER_PREREQUISITES)
+	$(INCREMENTER_COMPILER) $(LDFLAGS) $^ -o $@
+
+clean:; rm -f $(TARGETS) *.o
+
+
+endif
+endif

+ 42 - 0
tools/release/README

@@ -0,0 +1,42 @@
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2013  Centre National de la Recherche Scientifique
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+The makefile in this directory should be used to test the compilation and execution of StarPU examples against an installed version of StarPU.
+
+For example, if StarPU is installed in
+
+$HOME/softs/starpu-1.1
+
+and the examples to be tested in
+
+$HOME/src/starpu/trunk/examples
+
+one first need to set the following variables
+
+export STARPUPATH=$HOME/softs/starpu-1.1
+export PKG_CONFIG_PATH=$STARPUPATH/lib/pkgconfig/:$PKG_CONFIG_PATH
+export LD_LIBRARY_PATH=$STARPUPATH/lib:$LD_LIBRARY_PATH
+
+and then call
+
+make STARPU=starpu-1.1 EXAMPLE=$HOME/src/starpu/trunk/examples
+
+to produce the executables.
+
+Examples using an old StarPU API can also be tested, for example the branch 1.0
+
+make STARPU=starpu-1.0 EXAMPLE=$HOME/src/starpu/branches/starpu-1.0/examples/
+
+Note the variable STARPU is set to starpu-1.0 to use the 1.0 API.