Преглед изворни кода

doc: merge sections 3.1 and 4.1

Nathalie Furmento пре 12 година
родитељ
комит
b6861cbe67
2 измењених фајлова са 27 додато и 37 уклоњено
  1. 2 33
      doc/chapters/basic-examples.texi
  2. 25 4
      doc/chapters/using.texi

+ 2 - 33
doc/chapters/basic-examples.texi

@@ -7,43 +7,12 @@
 @c See the file starpu.texi for copying conditions.
 
 @menu
-* Compiling and linking options::
 * Hello World::                 Submitting Tasks
 * Vector Scaling Using the C Extension::
 * Vector Scaling Using StarPu's API::
 * Vector Scaling on an Hybrid CPU/GPU Machine::  Handling Heterogeneous Architectures
 @end menu
 
-@node Compiling and linking options
-@section Compiling and linking options
-
-Let's suppose StarPU has been installed in the directory
-@code{$STARPU_DIR}. As explained in @ref{Setting flags for compiling and linking applications},
-the variable @code{PKG_CONFIG_PATH} needs to be set. It is also
-necessary to set the variable @code{LD_LIBRARY_PATH} to locate dynamic
-libraries at runtime.
-
-@example
-% PKG_CONFIG_PATH=$STARPU_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
-% LD_LIBRARY_PATH=$STARPU_DIR/lib:$LD_LIBRARY_PATH
-@end example
-
-The Makefile could for instance contain the following lines to define which
-options must be given to the compiler and to the linker:
-
-@cartouche
-@example
-CFLAGS          +=      $$(pkg-config --cflags starpu-1.0)
-LDFLAGS         +=      $$(pkg-config --libs starpu-1.0)
-@end example
-@end cartouche
-
-Make sure that @code{pkg-config --libs starpu-1.0} actually produces some output
-before going further: @code{PKG_CONFIG_PATH} has to point to the place where
-@code{starpu-1.0.pc} was installed during @code{make install}.
-
-Also pass the @code{--static} option if the application is to be linked statically.
-
 @node Hello World
 @section Hello World
 
@@ -106,8 +75,8 @@ $ gcc hello-starpu.c \
     `pkg-config starpu-1.0 --libs`
 @end example
 
-As can be seen above, basic use the C extensions allows programmers to
-use StarPU tasks while essentially annotating ``regular'' C code.
+As can be seen above, the C extensions allows programmers to
+use StarPU tasks by essentially annotating ``regular'' C code.
 
 @node Hello World using StarPU's API
 @subsection Hello World using StarPU's API

+ 25 - 4
doc/chapters/using.texi

@@ -2,19 +2,19 @@
 
 @c This file is part of the StarPU Handbook.
 @c Copyright (C) 2009--2011  Universit@'e de Bordeaux 1
-@c Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+@c Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
 @c Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
 @c See the file starpu.texi for copying conditions.
 
 @menu
-* Setting flags for compiling and linking applications::
+* Setting flags for compiling::
 * Running a basic StarPU application::
 * Kernel threads started by StarPU::
 * Enabling OpenCL::
 @end menu
 
-@node Setting flags for compiling and linking applications
-@section Setting flags for compiling and linking applications
+@node Setting flags for compiling
+@section Setting flags for compiling, linking and running applications
 
 Compiling and linking an application against StarPU may require to use
 specific flags or libraries (for instance @code{CUDA} or @code{libspe2}).
@@ -40,9 +40,30 @@ with the @code{libstarpu} package. Similar packages are provided for
 % pkg-config --libs starpu-1.0    # options for the linker
 @end example
 
+Make sure that @code{pkg-config --libs starpu-1.0} actually produces some output
+before going further: @code{PKG_CONFIG_PATH} has to point to the place where
+@code{starpu-1.0.pc} was installed during @code{make install}.
+
 Also pass the @code{--static} option if the application is to be
 linked statically.
 
+It is also necessary to set the variable @code{LD_LIBRARY_PATH} to
+locate dynamic libraries at runtime.
+
+@example
+% LD_LIBRARY_PATH=$prefix_dir/lib:$LD_LIBRARY_PATH
+@end example
+
+When using a Makefile, the following lines can be added to set the
+options for the compiler and the linker:
+
+@cartouche
+@example
+CFLAGS          +=      $$(pkg-config --cflags starpu-1.0)
+LDFLAGS         +=      $$(pkg-config --libs starpu-1.0)
+@end example
+@end cartouche
+
 @node Running a basic StarPU application
 @section Running a basic StarPU application