Explorar o código

Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/starpu/starpu

Samuel Thibault %!s(int64=5) %!d(string=hai) anos
pai
achega
c6a0ea3240
Modificáronse 4 ficheiros con 26 adicións e 8 borrados
  1. 1 1
      configure.ac
  2. 2 1
      julia/examples/execute.sh.in
  3. 12 3
      julia/src/translate_headers.jl
  4. 11 3
      julia/src/utils.jl

+ 1 - 1
configure.ac

@@ -3520,7 +3520,7 @@ AC_CONFIG_COMMANDS([executable-scripts], [
   test -e tools/starpu_trace_state_stats.py || ln -sf $ac_abs_top_srcdir/tools/starpu_trace_state_stats.py tools/starpu_trace_state_stats.py
   chmod +x tools/starpu_trace_state_stats.py
   chmod +x julia/examples/execute.sh
-  for x in julia/examples/check_deps/check_deps.sh julia/examples/mult/mult_starpu.sh julia/examples/mult/perf.sh julia/examples/variable/variable.sh julia/examples/task_insert_color/task_insert_color.sh julia/examples/vector_scal/vector_scal.sh julia/examples/mandelbrot/mandelbrot.sh; do
+  for x in julia/examples/check_deps/check_deps.sh julia/examples/mult/mult_starpu.sh julia/examples/mult/perf.sh julia/examples/variable/variable.sh julia/examples/task_insert_color/task_insert_color.sh julia/examples/vector_scal/vector_scal.sh julia/examples/mandelbrot/mandelbrot.sh julia/examples/callback/callback.sh julia/examples/dependency/task_dep.sh julia/examples/dependency/tag_dep.sh julia/examples/dependency/end_dep.sh julia/examples/axpy/axpy.sh; do
       test -e $x || mkdir -p $(dirname $x) && ln -sf $ac_abs_top_srcdir/$x $(dirname $x)
   done
 ])

+ 2 - 1
julia/examples/execute.sh.in

@@ -17,7 +17,8 @@
 
 set -x
 export JULIA_LOAD_PATH=@STARPU_SRC_DIR@/julia:$JULIA_LOAD_PATH
-export STARPU_INCLUDE_DIR=@STARPU_BUILD_DIR@/include
+export STARPU_BUILD_DIR=@STARPU_BUILD_DIR@
+export STARPU_SRC_DIR=@STARPU_SRC_DIR@
 export STARPU_JULIA_LIB=@STARPU_BUILD_DIR@/julia/src/.libs/libstarpujulia-1.3.so
 export STARPU_JULIA_BUILD=@STARPU_BUILD_DIR@/julia
 export JULIA_NUM_THREADS=8

+ 12 - 3
julia/src/translate_headers.jl

@@ -23,11 +23,20 @@ function starpu_translate_headers()
         mkdir((@__DIR__)*"/../gen")
     end
 
-    STARPU_INCLUDE=fstarpu_include_dir()
-    STARPU_HEADERS = [joinpath(STARPU_INCLUDE, header) for header in readdir(STARPU_INCLUDE) if endswith(header, ".h")]
+    STARPU_BUILD_INCLUDE=joinpath(fstarpu_build_dir(), "include")
+    STARPU_SRC_INCLUDE=joinpath(fstarpu_src_dir(), "include")
+    STARPU_HEADERS = [joinpath(STARPU_BUILD_INCLUDE, header) for header in readdir(STARPU_BUILD_INCLUDE) if endswith(header, ".h")]
+    if STARPU_SRC_INCLUDE != STARPU_BUILD_INCLUDE
+        for header in readdir(STARPU_SRC_INCLUDE)
+            if endswith(header, ".h")
+                push!(STARPU_HEADERS, joinpath(STARPU_SRC_INCLUDE, header))
+            end
+        end
+    end
+
     LIBCLANG_INCLUDE = joinpath(dirname(LLVM_jll.libclang_path), "..", "include", "clang-c") |> normpath
 
-    clang_args = ["-I", STARPU_INCLUDE]
+    clang_args = ["-I", STARPU_BUILD_INCLUDE, "-I", STARPU_SRC_INCLUDE]
 
     for header in find_std_headers()
         push!(clang_args, "-I")

+ 11 - 3
julia/src/utils.jl

@@ -21,10 +21,18 @@ function fstarpu_task_library_name()
     return x
 end
 
-function fstarpu_include_dir()
-    x=get(ENV, "STARPU_INCLUDE_DIR", C_NULL)
+function fstarpu_build_dir()
+    x=get(ENV, "STARPU_BUILD_DIR", C_NULL)
     if (x == C_NULL)
-        error("Environment variable STARPU_INCLUDE_DIR must be defined")
+        error("Environment variable STARPU_BUILD_DIR must be defined")
+    end
+    return x
+end
+
+function fstarpu_src_dir()
+    x=get(ENV, "STARPU_SRC_DIR", C_NULL)
+    if (x == C_NULL)
+        error("Environment variable STARPU_SRC_DIR must be defined")
     end
     return x
 end