From aff8a0f12c8a98c49a599b8ebdb77cbad880fc3e Mon Sep 17 00:00:00 2001 From: xuwei06 Date: Tue, 13 Dec 2016 13:07:47 -0800 Subject: [PATCH] Fix enable_virtualenv The resource "unsigned char[]" array generated by create_source needs to have 0 ending as a valid C string to be used in PythonUtil.cpp initPython() Change-Id: I5e214606ed9102f37813ea3f07565dc10a9c015e --- cmake/util.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/util.cmake b/cmake/util.cmake index 11641f6064b..eb7db7ce2ef 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -119,7 +119,7 @@ function(link_paddle_exe TARGET_NAME) ${RDMA_LD_FLAGS} ${RDMA_LIBS}) endif() - + if(WITH_PYTHON) target_link_libraries(${TARGET_NAME} ${PYTHON_LIBRARIES}) @@ -136,10 +136,10 @@ function(link_paddle_exe TARGET_NAME) endif() if(WITH_GPU) - if(NOT WITH_DSO OR WITH_METRIC) + if(NOT WITH_DSO OR WITH_METRIC) target_link_libraries(${TARGET_NAME} ${CUDNN_LIBRARY} - ${CUDA_curand_LIBRARY}) + ${CUDA_curand_LIBRARY}) CUDA_ADD_CUBLAS_TO_TARGET(${TARGET_NAME}) endif() @@ -206,5 +206,5 @@ function(create_resources res_file output) # Convert hex data for C compatibility string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," filedata ${filedata}) # Append data to output file - file(APPEND ${output} "const unsigned char ${filename}[] = {${filedata}};\nconst unsigned ${filename}_size = sizeof(${filename});\n") + file(APPEND ${output} "const unsigned char ${filename}[] = {${filedata}0};\nconst unsigned ${filename}_size = sizeof(${filename});\n") endfunction() -- GitLab