Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --dynamic-runtime option to compile with /MD[d] in MSVC for compat #2894

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

sinbad
Copy link
Contributor

@sinbad sinbad commented Jun 30, 2020

I wanted to try Bullet in an environment where I can't control the MSVC CRT in use, so I needed to use /MD[d] instead of /MT[d] as the CRT option. This PR adds --dynamic-runtime option to the premake build to that effect.

I don't know if you want this as an option since by default the example browser won't build with it (not a problem for me), or at the least you might not want the .bat by default. But it works from a library POV and is useful for people in my position (I saw a thread or 2 in the forum about it) so I thought I'd send a PR.

Cheers Erwin! You probably don't remember but we met at Siggraph many MANY years ago when I was running Ogre3d and we shared a BOF room once. :)

@erwincoumans
Copy link
Member

Thanks Steve! Of course I remember those fun SIGGRAPH times! Hope you are doing well!
Yes, let's add the option. I think it is also available in the cmake build system (even though I prefer static linking usually).
Let me see about the new bat file, if it doesn't work for the example browser, that will be confusing, perhaps we can make it work?
Of, and if a project involves Python, you may give pybullet a try, it installs even simpler (pip install pybullet)

@sinbad
Copy link
Contributor Author

sinbad commented Jul 1, 2020

:) Ok actually the example browser does build, you just have to delete the pdb first if you'd previously built with /MT because of the fastlink option. So that's all fine.

I prefer static linking too - even with this option Bullet itself is still a static library, it's just the CRT used is the DLL version. So from the perspective of user apps it's not really any different, except compatibility with the CRT they're already using. That's why I thought I'd call it --dynamic-runtime instead of the shorter --dynamic which might have implied building Bullet as DLLs.

pybullet sounds great but I'm linking this into Unreal - I need deterministic physics for something without making source changes to UE, so I want to run my own little sim for it. I like that Bullet is deterministic if used carefully and has a rolling friction model. Unreal requires /MD[d] though, hence this PR.

@erwincoumans
Copy link
Member

Sounds good. I started working on another physics engine. It can be a differentiable physics engine, but also a fully deterministic physics engine cross platform, by using the fixed point scalar. It is still limited of features, but it may be of interest. See

https://github.com/google-research/tiny-differentiable-simulator

@erwincoumans erwincoumans merged commit 73fffd1 into bulletphysics:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants