Browse Source

doc/chapters/basic-examples.texi: fix compilation line with gcc plugin and explicit that the program can also be compiled without starpu

Nathalie Furmento 12 years ago
parent
commit
cbff41b8f0
1 changed files with 13 additions and 1 deletions
  1. 13 1
      doc/chapters/basic-examples.texi

+ 13 - 1
doc/chapters/basic-examples.texi

@@ -31,6 +31,8 @@ has a single implementation for CPU:
 
 @cartouche
 @smallexample
+#include <stdio.h>
+
 /* @b{Task declaration.}  */
 static void my_task (int x) __attribute__ ((task));
 
@@ -64,11 +66,21 @@ The code can then be compiled and linked with GCC and the
 @code{-fplugin} flag:
 
 @example
-$ gcc hello-starpu.c \
+$ gcc `pkg-config starpu-1.0 --cflags` hello-starpu.c \
     -fplugin=`pkg-config starpu-1.0 --variable=gccplugin` \
     `pkg-config starpu-1.0 --libs`
 @end example
 
+The code can also be compiled without the StarPU C extension and will
+behave as a normal sequential code.
+
+@example
+$ gcc hello-starpu.c
+hello-starpu.c:33:1: warning: ‘task’ attribute directive ignored [-Wattributes]
+$ ./a.out
+Hello, world! With x = 42
+@end example
+
 As can be seen above, the C extensions allows programmers to
 use StarPU tasks by essentially annotating ``regular'' C code.