From 4ce51ea60e668063000255a8dede8303ba190e69 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Thu, 12 Sep 2019 20:11:21 +0300 Subject: [PATCH] Now the generated CUDA header files are completely local (placed in the build directory) instead of depending on some predefined directory structure. This allows users to swap between build directories without having to recompile. --- CMakeLists.txt | 1 + scripts/compile_acc.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cf61b3..774bfa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ endif () ## Include directories include_directories(.) include_directories(include) +include_directories(${CMAKE_BINARY_DIR}) ## Subdirectories add_subdirectory(src/core) # The core library diff --git a/scripts/compile_acc.sh b/scripts/compile_acc.sh index a91d244..640e129 100755 --- a/scripts/compile_acc.sh +++ b/scripts/compile_acc.sh @@ -5,6 +5,7 @@ then echo "ASTAROTH_HOME environment variable not set, run \"source ./sourceme.sh\" in Astaroth home directory" exit 1 fi +OUTPUT_DIR=${PWD} KERNEL_DIR=${AC_HOME}"/src/core/kernels" ACC_DIR=${AC_HOME}"/acc" @@ -69,11 +70,11 @@ ${ACC_DIR}/compile.sh ${ACC_DIR}/${ACC_SAS} ${ACC_DIR}/compile.sh ${ACC_DIR}/${ACC_SPS} ${ACC_DIR}/compile.sh ${ACC_DIR}/${ACC_HEADER} -echo "Moving stencil_assembly.cuh -> ${AC_HOME}/src/core/kernels" -mv stencil_assembly.cuh ${AC_HOME}/src/core/kernels +echo "Moving stencil_assembly.cuh -> ${OUTPUT_DIR}" +mv stencil_assembly.cuh ${OUTPUT_DIR} -echo "Moving stencil_process.cuh -> ${AC_HOME}/src/core/kernels" -mv stencil_process.cuh ${AC_HOME}/src/core/kernels +echo "Moving stencil_process.cuh -> ${OUTPUT_DIR}" +mv stencil_process.cuh ${OUTPUT_DIR} -echo "Moving stencil_defines.cuh -> ${AC_HOME}/include" -mv stencil_defines.h ${AC_HOME}/include +echo "Moving stencil_defines.cuh -> ${OUTPUT_DIR}" +mv stencil_defines.h ${OUTPUT_DIR}