diff --git a/cmake/generic.cmake b/cmake/generic.cmake index ea5ce122b6f0d47649626e96ae1d762d93a43c02..d725751e8267ca4e73f801fa258f350187a44939 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -309,7 +309,7 @@ function(cc_test TARGET_NAME) if(WIN32) target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog shlwapi openblas) else(WIN32) - target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog openblas) + target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog) endif(WIN32) add_dependencies(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog) add_test(NAME ${TARGET_NAME} diff --git a/cmake/inference_lib.cmake b/cmake/inference_lib.cmake index 514227a636a8dd83b17e2f930584668df07a6d43..3be45ea363b9263193a7356c95cefc3de534b4fc 100644 --- a/cmake/inference_lib.cmake +++ b/cmake/inference_lib.cmake @@ -51,11 +51,18 @@ function(copy TARGET) COMMAND ${CMAKE_COMMAND} -E copy "${src_file}" "${dst}" COMMENT "copying ${src_file} -> ${dst}") endforeach() - else() # not windows - add_custom_command(TARGET ${TARGET} PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}" - COMMAND ${CMAKE_COMMAND} -E copy "${src_files}" "${dst}" + else(WIN32) # not windows + add_custom_command(TARGET ${TARGET} PRE_BUILD + COMMAND mkdir -p "${dst}" + COMMAND cp -r "${src}" "${dst}" COMMENT "copying ${src} -> ${dst}") + #add_custom_command(TARGET ${TARGET} PRE_BUILD + # COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}") + #message("mkdir " ${TARGET}) + #add_custom_command(TARGET ${TARGET} PRE_BUILD + # COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}" + # COMMAND ${CMAKE_COMMAND} -E copy_directory "${src_files}" "${dst}" + # COMMENT "copying ${src} -> ${dst}") endif(WIN32) endforeach() endfunction() diff --git a/paddle/fluid/framework/ir/node.cc b/paddle/fluid/framework/ir/node.cc index d2f729afc4870ce0fd464b849bf194a6497e3b28..94bf8cb10b2d0ab0d7cd5d89cd9aa75072314496 100644 --- a/paddle/fluid/framework/ir/node.cc +++ b/paddle/fluid/framework/ir/node.cc @@ -17,8 +17,9 @@ limitations under the License. */ namespace paddle { namespace framework { namespace ir { +// msvc15 don't support constexpr in correct way. #if !defined(_WIN32) -constexpr char Node::kControlDepVarName[] = "__control_var"; +constexpr char Node::kControlDepVarName[]; #else const char Node::kControlDepVarName[] = "__control_var"; #endif diff --git a/paddle/fluid/operators/save_combine_op.cc b/paddle/fluid/operators/save_combine_op.cc index 5b05f757c0355ed15617dea925b5d4929fcbfee0..6ab50964553cd4ddd1b66d74f96df8bd591c1461 100644 --- a/paddle/fluid/operators/save_combine_op.cc +++ b/paddle/fluid/operators/save_combine_op.cc @@ -49,7 +49,7 @@ class SaveCombineOp : public framework::OperatorBase { } MkDirRecursively(DirName(filename).c_str()); - std::ofstream fout(filename); + std::ofstream fout(filename, std::ios_base::out | std::ios_base::binary); PADDLE_ENFORCE(static_cast(fout), "Cannot open %s to write", filename);