Page MenuHome

Windows: Move msvc from /MT to /MD
ClosedPublic

Authored by LazyDodo (LazyDodo) on Sat, Nov 2, 10:07 PM.

Details

Summary

Reasons:

  1. No-one seems to remember why we are building with /MT
  2. The thread local vars causing race conditions [1] which is a blocking issue for supporting USD on windows.
  3. We have to ship the CRT libraries anyhow for python.
  4. Intels TBB allocator doesn't like /MT

This patch moves blender over to /MD and moves building of the deps to VS2017 including an new lib folder (win64_vc15) so it should cause minimal disturbance.

Passes the unit tests in both release and debug builds with the same pass-rate as the MT build (one failing test in debug on both builds)

noteworthy changes:

  • yaml-cpp needed a version bump to 0.6.3 build with vs2017
  • OpenCollada needed a similar fix (pull #610) but that hasn't merged in nearly a year so i added it to our patch
  • Both openVDB and OpenColorIO needed a preprocessor define otherwise they defaulted to a dllimport interface which was a warning for the /MT build but a straight up build error with /MD

[1] https://developer.blender.org/D5387

Diff Detail

Repository
rB Blender

Event Timeline

I have a set of libs ready for SVN but did not want to add them before code review.

  • Straighten up linker flags between release and debug

Switching to /MD seems fine to me.

But why 2017 and not 2019?

Also see inlined comment.

source/blender/blenlib/intern/expr_pylike_eval.c
361–362

Please explain what are the exact issues which are being caused.

  • Update comments
LazyDodo (LazyDodo) marked an inline comment as done.Mon, Nov 4, 2:52 PM

2017 since i'd like to support the last 2 versions of msvc (this implicitly means 2015 will be dropped), the backward compatibility story is pretty great (ie libs made with 2017 will link flawlessly on 2019) in recent VS versions however i'm unsure if the other direction is equally great, and i don't want to take the risk there.

source/blender/blenlib/intern/expr_pylike_eval.c
361–362

Thought it was clear, but I clarified it a little better.

Well, i think it's totally fine for master.
But what unclear to me is whether you are aiming this for 2.81 as well?

source/blender/blenlib/intern/expr_pylike_eval.c
361–362

Thanks!

This revision is now accepted and ready to land.Tue, Nov 5, 9:32 AM
LazyDodo (LazyDodo) marked an inline comment as done.
  • update error message on how to resolve missing libs.
This revision was automatically updated to reflect the committed changes.