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

windows platform support #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NinjaCats
Copy link

add patch and cmake file
tested on Windows10 11th Gen Intel(R) Core(TM) i7-11700 NVIDIA GeForce RTX 3070
Hello World

N=2048,
do_smooth=False,
):
- preset_name = str(folder).split("/")[-2]
Copy link
Contributor

@araistrick araistrick Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mazeyu This path manipulation should be done with pathlib Path().parts[-2], which is multiplatform and would avoid the need for a windows only .patch file

if (auxs == NULL) n_auxiliaries = 0;
#pragma omp parallel for
- for (size_t idx = 0; idx < size; idx++) {
+ for (int idx = 0; idx < size; idx++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type change should be made to be a single type that is multiplatform. Is size_t not supported on windows? If so we should use a different type, but it should be some other unsigned int type rather than a signed int.

Copy link
Author

@NinjaCats NinjaCats Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I received error C3016: 'idx': the index variable in the OpenMP 'for' statement must be a signed integer when compiling with MSVC 19.

Can we replace this type with a macro and let CMake determine this type for different platforms?

\ No newline at end of file
+ if sys.platform == 'win32':
+ #replace suffix .so to .dll
+ path = Path(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be included into the main repo rather than a .patch file

@@ -0,0 +1,97 @@
cmake_minimum_required(VERSION 3.2)
Copy link
Contributor

@araistrick araistrick Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem great and very useful even independently of windows, @mazeyu please review

@araistrick araistrick added the enhancement New feature or request label Aug 4, 2023
@araistrick
Copy link
Contributor

araistrick commented Aug 4, 2023

We appreciate your PR - I have sent it off to @mazeyu to test aswell. Is there any chance you could divide up the changes into more commits (especially a separate commit for the Cmake stuff) as this would make it easier to accept / include only part of the PR if we deem that necessary.

Also, I likely will not accept any PR that uses a patch file, as I feel this is hard to maintain. We will work towards a single set of code that works on all platforms, but dont feel obliged to make these changes yourself as hopefully Zeyu the code owner can look at them once you have split up the rest of your changes into separate commits.

@NinjaCats
Copy link
Author

We appreciate your PR - I have sent it off to @mazeyu to test aswell. Is there any chance you could divide up the changes into more commits (especially a separate commit for the Cmake stuff) as this would make it easier to accept / include only part of the PR if we deem that necessary.

Also, I likely will not accept any PR that uses a patch file, as I feel this is hard to maintain. We will work towards a single set of code that works on all platforms, but dont feel obliged to make these changes yourself as hopefully Zeyu the code owner can look at them once you have split up the rest of your changes into separate commits.

Thank you. I submitted that the patch file was simply an attempt to provide testing for multi-platform support without disrupting the existing code. I will separate it and resubmit the changes.

@araistrick
Copy link
Contributor

All makes sense, just a formatting change really, and still a huge huge benefit to everyone as it is, we really appreciate the work.

The multiple commits thing also isn't strictly necessary as I think we will likely merge everything here. If you did have time to move things from the patch into the source files that would be awesome but no obligation as this is already great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants