From fe25bf61e5f9956fed4dd6dd302b79a69d5ba75b Mon Sep 17 00:00:00 2001 From: "Harish S. Kulkarni" Date: Fri, 21 Jun 2019 01:56:57 -0700 Subject: [PATCH 1/4] Fixed build errors resulting from upgrade to VS2019 compilers --- src/Native/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Native/CMakeLists.txt b/src/Native/CMakeLists.txt index a814277e91..0c8e184517 100644 --- a/src/Native/CMakeLists.txt +++ b/src/Native/CMakeLists.txt @@ -8,6 +8,14 @@ set(RESOURCES) include_directories("${CMAKE_BINARY_DIR}/../../") if(WIN32) + # Clobber and reset the default C and CXX flags because + # CMake uses /ZI (Edit and Continue) for generating pdbs + # which is incompatible with the /guard:cf flag we set below + # for security. So we use the default flags set by CMake + # and reset /ZI with /Zi + set(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /JMC") + set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /JMC") + add_definitions(-DWIN32) add_definitions(-D_WIN32=1) add_definitions(-DUNICODE -D_UNICODE) @@ -22,7 +30,7 @@ if(WIN32) add_compile_options($<$:/MT>) add_compile_options($<$:/MT>) add_compile_options(/guard:cf) - add_compile_options(/d2Zi+) # make optimized builds debugging easier + add_compile_options(/Zo) # make optimized builds debugging easier. /Zo is the newer documented flag. add_compile_options(/nologo) # Suppress Startup Banner add_compile_options(/W3) # set warning level to 3 add_compile_options(/WX) # treat warnings as errors From cb446be57b5debba61f711ed55159e16ce575a1f Mon Sep 17 00:00:00 2001 From: "Harish S. Kulkarni" Date: Fri, 21 Jun 2019 09:44:22 -0700 Subject: [PATCH 2/4] Added additional message describing the previous fix --- src/Native/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Native/CMakeLists.txt b/src/Native/CMakeLists.txt index 0c8e184517..96345141b7 100644 --- a/src/Native/CMakeLists.txt +++ b/src/Native/CMakeLists.txt @@ -13,6 +13,9 @@ if(WIN32) # which is incompatible with the /guard:cf flag we set below # for security. So we use the default flags set by CMake # and reset /ZI with /Zi + message("CMAKE_C_FLAGS_DEBUG is ${CMAKE_C_FLAGS_DEBUG}") + message("CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}") + message("In a future version, If the default compiler flags no longer contain the /ZI flag, delete this message block and the two lines below.") set(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /JMC") set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /JMC") From fd25a45190fb57d174def2669e4cf8f35847d68a Mon Sep 17 00:00:00 2001 From: Harish Kulkarni Date: Tue, 9 Jul 2019 21:18:37 -0700 Subject: [PATCH 3/4] Reduced list of TF binaries to only the essential ones --- Directory.Build.targets | 6 +++--- .../Microsoft.ML.DnnAnalyzer.csproj | 8 +++----- .../Microsoft.ML.TensorFlow.Redist.proj | 8 -------- .../Microsoft.ML.Core.Tests.csproj | 8 +++----- .../Microsoft.ML.Functional.Tests.csproj | 8 +++----- test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj | 8 +++----- 6 files changed, 15 insertions(+), 31 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 3a01551bf0..58448682ae 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -22,10 +22,10 @@ - + - $(NativeOutputPath)$(LibPrefix)%(NativeAssemblyReference.Identity)$(LibExtension).%(NativeAssemblyReference.MajorVersion) - $(NativeOutputPath)$(LibPrefix)%(NativeAssemblyReference.Identity).%(NativeAssemblyReference.MajorVersion)$(LibExtension) + $(NativeOutputPath)$(LibPrefix)%(NativeAssemblyReferenceWithMajorVersion.Identity)$(LibExtension).%(NativeAssemblyReferenceWithMajorVersion.MajorVersion) + $(NativeOutputPath)$(LibPrefix)%(NativeAssemblyReferenceWithMajorVersion.Identity).%(NativeAssemblyReferenceWithMajorVersion.MajorVersion)$(LibExtension) diff --git a/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj b/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj index ad4c12fdc1..1fcfc38381 100644 --- a/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj +++ b/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj @@ -13,12 +13,10 @@ - + + $(TensorFlowMajorVersion) - - - $(TensorFlowMajorVersion) - + diff --git a/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj b/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj index d310404bcb..cb8d2ac254 100644 --- a/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj +++ b/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj @@ -9,20 +9,12 @@ diff --git a/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj b/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj index deb41b5c4a..e514000470 100644 --- a/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj +++ b/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj @@ -38,12 +38,10 @@ - + + $(TensorFlowMajorVersion) - - - $(TensorFlowMajorVersion) - + diff --git a/test/Microsoft.ML.Functional.Tests/Microsoft.ML.Functional.Tests.csproj b/test/Microsoft.ML.Functional.Tests/Microsoft.ML.Functional.Tests.csproj index abb06dcc4a..ef3f8517fa 100644 --- a/test/Microsoft.ML.Functional.Tests/Microsoft.ML.Functional.Tests.csproj +++ b/test/Microsoft.ML.Functional.Tests/Microsoft.ML.Functional.Tests.csproj @@ -44,12 +44,10 @@ - + + $(TensorFlowMajorVersion) - - - $(TensorFlowMajorVersion) - + diff --git a/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj b/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj index c499c63a34..7f257530c1 100644 --- a/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj +++ b/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj @@ -45,12 +45,10 @@ - + + $(TensorFlowMajorVersion) - - - $(TensorFlowMajorVersion) - + From 40b47ab378f3c08316d956bf764529a0e5ec307d Mon Sep 17 00:00:00 2001 From: Harish Kulkarni Date: Wed, 10 Jul 2019 13:27:02 -0700 Subject: [PATCH 4/4] Fixed formatting --- .../Microsoft.ML.TensorFlow.Redist.proj | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj b/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj index cb8d2ac254..4d8de1db3a 100644 --- a/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj +++ b/src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.TensorFlow.Redist.proj @@ -6,17 +6,23 @@ - - + - + + Runtime="osx-x64" />