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

Improve Windows compatibility #1255

Merged
merged 1 commit into from
Aug 2, 2024
Merged

Conversation

WFKala
Copy link

@WFKala WFKala commented Jul 30, 2024

Improve windows installing instruction, add alternative windows methods for File I/O, add Windows SDK specific header option of max(), fix struct initialization

Improve windows installing instruction, add alternative windows methods for File I/O, add Windows SDK specific header option of max(), fix struct initialization
@WFKala
Copy link
Author

WFKala commented Jul 30, 2024

Hi, I found currently open_spiel cannot be compiled under Windows when following the installing instruction. There are some small necessary fixes to let it work under Windows ( Windows 11 / Visual Studio 2022 Community).

  • (STRUCT){a,b,c} => STRUCT{a,b,c} : the original struct initialization method with extra () does not work in MSVC.
  • realpath / PATH_MAX : there are Linux-only file IO functions/constants and an alternative method on Windows must be provided to let it work.
  • std::max: Windows SDK has a macro "max" which conflicts with std::max, so one need the Windows-only switch #define NOMINMAX to turn off it.
  • Other compilation options: to use the correct C++ standard, deal with chess characters, deal with large object files in pyspiel, one need options "/std:c++17 /utf-8 /bigobj in MSVC.

@lanctot
Copy link
Collaborator

lanctot commented Jul 30, 2024

Nice! Thank you!

@lanctot lanctot added Windows This is about support on the Windows platform imported This PR has been imported and awaiting internal review. Please avoid any more local changes, thanks! merged internally The code is now submitted to our internal repo and will be merged in the next github sync. labels Aug 1, 2024
@lanctot lanctot merged commit 023847b into google-deepmind:master Aug 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported This PR has been imported and awaiting internal review. Please avoid any more local changes, thanks! merged internally The code is now submitted to our internal repo and will be merged in the next github sync. Windows This is about support on the Windows platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants