summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuo Yejun <yejun.guo@intel.com>2015-01-09 21:42:55 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-01-12 09:05:24 +0800
commitf9a012929bf1f5b6249482ff169f6e86647f1364 (patch)
treea2daf970216d7218830002d12932a19a1ba50d2d /src
parentd191ae473190bc47e41df6dc3a73cbfd7d3214bb (diff)
add CMake option USE_STANDALONE_GBE_COMPILER and STANDALONE_GBE_COMPILER_DIR
At some platforms with old c/c++ environment, C++11 features are not supported, it results in the failure to build the gbe compiler part which depends on LLVM/clang using C++11 features. The way to resolve is to build a standalone gbe compiler within another feasible system, and build beignet with the already built standalone gbe compiler by setting USE_STANDALONE_GBE_COMPILER=true. The path of the standalone compiler is /usr/local/lib/beignet as default or could be specified by STANDALONE_GBE_COMPILER_DIR. Once USE_STANDALONE_GBE_COMPILER is given, all the gbe compiler relative code will not be built any longer, only libcl.so and libgebinterp.so are built. And libcl.so is special for GEN_PCI_ID, which is queried from the building machie or could be specified as CMake option. v2: separate the CMake option name. update the commit comments. add back the script for gen pci id, and build driver with it. v3: add file FindStandaloneGbeCompiler.cmake to make the main cmakefile clean. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7182bada..a55f84d0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,18 +10,19 @@ foreach (KF ${KERNEL_FILES})
set (input_file ${KERNEL_PATH}/${KF}.cl)
set (output_file ${KERNEL_PATH}/${KF}_str.c)
list (APPEND KERNEL_STR_FILES ${output_file})
+ list (GET GBE_BIN_GENERATER -1 GBE_BIN_FILE)
if(GEN_PCI_ID)
add_custom_command(
OUTPUT ${output_file}
COMMAND rm -rf ${output_file}
COMMAND ${GBE_BIN_GENERATER} -s ${input_file} -o${output_file} -t${GEN_PCI_ID}
- DEPENDS ${input_file} ${CMAKE_CURRENT_BINARY_DIR}/../backend/src/gbe_bin_generater)
+ DEPENDS ${input_file} ${GBE_BIN_FILE})
else(GEN_PCI_ID)
add_custom_command(
OUTPUT ${output_file}
COMMAND rm -rf ${output_file}
COMMAND ${GBE_BIN_GENERATER} -s ${input_file} -o${output_file}
- DEPENDS ${input_file} ${CMAKE_CURRENT_BINARY_DIR}/../backend/src/gbe_bin_generater)
+ DEPENDS ${input_file} ${GBE_BIN_FILE})
endif(GEN_PCI_ID)
endforeach (KF)
endmacro (MakeKernelBinStr)