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

std::experimental::filesystem is deprecated for recent MSVC versions causing compilation failures #343

Closed
Q-Minh opened this issue May 27, 2022 · 7 comments
Labels
ms-windows Related to the Microsoft Windows operating system resolved-on-development

Comments

@Q-Minh
Copy link

Q-Minh commented May 27, 2022

The jitify example program complains about std::experimental::filesystem being deprecated by Microsoft when using C++17 with VS2019. Assuming the __cplusplus is correctly set in the build process, I believe it should suffice to have something like:

#if __cplusplus >= 201703 && defined(_MSC_VER)
  #include <filesystem>
  using fs = std::filesystem;  
#else
  #include <experimental/filesystem>
  using fs = std::experimental::filesystem;
#endif
eyalroz added a commit that referenced this issue May 27, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
@eyalroz
Copy link
Owner

eyalroz commented May 27, 2022

Ok, let's hope this does the trick.

@Q-Minh
Copy link
Author

Q-Minh commented May 28, 2022

Okay, so I just noticed that in the CMakeLists.txt for the examples, you also link jitify with stdc++fs, which isn't available for VS2019 with C++17. After having thought about it, I think it's fine to keep it that way, because you are the one managing how you want to build the examples locally. Users of your library get to decide if they want to build in C++17 with MSVC for their own CMake targets, and they will specify if they need to link to stdc++fs or not, so it's fine to keep your examples c++11/14 compatible.
If you do want your examples to be C++17 compatible for VS2019, then I would simply add some CMake option similar to the -DBUILD_EXAMPLES=ON, you can add some -DBUILD_EXAMPLES_WITH_STANDARD=17 for example. But that's up to you.
Also, it'd be nice if you could prefix your CMake options with some representative name for your library, for example -DCUDA_API_WRAPPERS_BUILD_EXAMPLES=ON, so that the option name doesn't clash with any other dependency that users may have.

@eyalroz
Copy link
Owner

eyalroz commented May 28, 2022

Also, it'd be nice if you could prefix your CMake options with some representative name for your library, for example -DCUDA_API_WRAPPERS_BUILD_EXAMPLES=ON, so that the option name doesn't clash with any other dependency that users may have.

Separate bug for that :-)

@eyalroz
Copy link
Owner

eyalroz commented May 28, 2022

you also link jitify with stdc++fs, which isn't available for VS2019 with C++17

IIANM. that's supposed to do nothing for when the fs library isn't separate. But I may be wrong.

@Q-Minh
Copy link
Author

Q-Minh commented May 28, 2022

you also link jitify with stdc++fs, which isn't available for VS2019 with C++17

IIANM. that's supposed to do nothing for when the fs library isn't separate. But I may be wrong.

Yeah, compilation will still succeed, you'll just get an annoying warning from MSVC.

eyalroz added a commit that referenced this issue May 28, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
@eyalroz
Copy link
Owner

eyalroz commented May 28, 2022

So... I can close this?

@Q-Minh
Copy link
Author

Q-Minh commented May 28, 2022

Yes.

@eyalroz eyalroz added resolved-on-development ms-windows Related to the Microsoft Windows operating system labels May 28, 2022
eyalroz added a commit that referenced this issue May 29, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
eyalroz added a commit that referenced this issue Jun 2, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
eyalroz added a commit that referenced this issue Jun 20, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
eyalroz added a commit that referenced this issue Jun 20, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
eyalroz added a commit that referenced this issue Jun 20, 2022
…ctually shouldn't happen, but still) - let's use `std::filesystem` instead of `std::experimental::filesystem` - as MSVC complains otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ms-windows Related to the Microsoft Windows operating system resolved-on-development
Projects
None yet
Development

No branches or pull requests

2 participants