Improve MinGW compatibility#3090
Open
Ashutosh0x wants to merge 2 commits intogoogle-deepmind:mainfrom
Open
Conversation
This commit addresses several build and link issues when using the MinGW-w64 toolchain: - Fix redefinition of 'stat' in user_vfs.cc by checking if it's already a macro. - Support thread-safe 'localtime_s' on Windows by using _WIN32 instead of _MSC_VER in engine_util_errmem.c. - Use the correct --stack flag for GNU ld on Windows in MujocoLinkOptions.cmake. Fixes google-deepmind#3037, google-deepmind#3038, google-deepmind#3040
Collaborator
Contributor
Author
|
Thanks for checking! PR #3083 and #3084 addressed specific Windows/MinGW issues individually, but during testing I found additional build and linking problems that still prevented a clean out-of-the-box MinGW-w64 build. This PR bundles the remaining fixes (stat macro conflict, localtime_s detection, and GNU ld stack flag) so MuJoCo can compile successfully in a modern MinGW environment end-to-end |
Contributor
Author
|
I've removed the redundant linker flag changes, as they are already covered in #3083. This PR now solely focuses on the stats macro and thread-safe localtime fixes. |
Collaborator
|
#3084 has the stats and local time fixes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request addresses several build and link issues encountered when compiling MuJoCo with the MinGW-w64 toolchain.
Changes
These changes combined with PR #3086 (printf format errors) should allow MuJoCo to build out-of-the-box with modern MinGW-w64 environments.
Fixes #3037, #3038, #3040