diff --git a/build.bat b/build.bat index 76d7f192629..ddb2e8affe6 100644 --- a/build.bat +++ b/build.bat @@ -31,6 +31,7 @@ cd %CD%/mindspore cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -G "CodeBlocks - MinGW Makefiles" ../.. IF NOT %errorlevel% == 0 ( + echo "cmake fail." goto run_fail ) @@ -40,6 +41,7 @@ IF "%1%" == "" ( cmake --build . --target package -- -j%1% ) IF NOT %errorlevel% == 0 ( + echo "build fail." goto run_fail ) @@ -49,6 +51,6 @@ goto run_eof :run_fail cd %BASEPATH% - echo "build fail." + set errorlevel=1 :run_eof diff --git a/mindspore/ccsrc/device/cpu/cpu_kernel_factory.cc b/mindspore/ccsrc/device/cpu/cpu_kernel_factory.cc index 5aba329e12a..77a33453444 100644 --- a/mindspore/ccsrc/device/cpu/cpu_kernel_factory.cc +++ b/mindspore/ccsrc/device/cpu/cpu_kernel_factory.cc @@ -31,7 +31,9 @@ CPUKernelFactory &CPUKernelFactory::Get() { void CPUKernelFactory::Register(const std::string &kernel_name, CPUKernelCreator &&kernel_creator) { if (kernel_creators_.find(kernel_name) == kernel_creators_.end()) { (void)kernel_creators_.emplace(kernel_name, kernel_creator); +#if !defined(_WIN32) && !defined(_WIN64) MS_LOG(DEBUG) << "CPUKernelFactory register operator: " << kernel_name; +#endif } } diff --git a/mindspore/ccsrc/utils/log_adapter.cc b/mindspore/ccsrc/utils/log_adapter.cc index 4c197a0bdf9..0cd9b64a9bd 100644 --- a/mindspore/ccsrc/utils/log_adapter.cc +++ b/mindspore/ccsrc/utils/log_adapter.cc @@ -229,13 +229,19 @@ static void InitMsLogLevel() { extern "C" { // shared lib init hook +#if defined(_WIN32) || defined(_WIN64) +__attribute__((constructor)) void mindspore_log_init(void) { +#else void mindspore_log_init(void) { +#endif #ifdef USE_GLOG // do not use glog predefined log prefix FLAGS_log_prefix = false; static bool is_glog_initialzed = false; if (!is_glog_initialzed) { +#if !defined(_WIN32) && !defined(_WIN64) google::InitGoogleLogging("mindspore"); +#endif is_glog_initialzed = true; } // set default log level to WARNING