Skip to content

Conversation

@sepcnt
Copy link

@sepcnt sepcnt commented May 19, 2024

Get run-c and run-cu works with MSVC.

  • /experimental:c11atomics and -std=c11 is required for stdatomic
  • Extremely large array (>=2GB) is not allowed on Windows so we have to use a pointer instead
  • CUDA also needs some work for allocation
  • threads.h rather than pthreads.h for compatibility.
  • time64() with QueryPerformanceCounter()

Add GitHub Actions CI for building and linting.

(This is a clean PR from #294)

@kings177
Copy link
Contributor

kings177 commented May 20, 2024

Rust and CU version works fine, C doesn't, might be because of the experimental:c11atomics not being fully supported by MSVC?

pasting the error for better reference:

 WARNING: Failed to compile hvm.c: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-std:c11" "/experimental:c11atomics" "-DTPC_L2=4" "-FoC:\\Users\\yanki\\hvm\\target\\release\\build\\hvm-fee5e6bdbeba46c9\\out\\2e40c9e35e9506f4-hvm.o" "-c" "src/hvm.c" with args cl.exe did not execute successfully (status code exit code: 2).
warning: [email protected]: Ignoring hvm.c and proceeding with build. The C runtime will not be available.

@sepcnt
Copy link
Author

sepcnt commented May 20, 2024

Rust and CU version works fine, C doesn't, might be because of the experimental:c11atomics not being fully supported by MSVC?

pasting the error for better reference:

 WARNING: Failed to compile hvm.c: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-std:c11" "/experimental:c11atomics" "-DTPC_L2=4" "-FoC:\\Users\\yanki\\hvm\\target\\release\\build\\hvm-fee5e6bdbeba46c9\\out\\2e40c9e35e9506f4-hvm.o" "-c" "src/hvm.c" with args cl.exe did not execute successfully (status code exit code: 2).
warning: [email protected]: Ignoring hvm.c and proceeding with build. The C runtime will not be available.

Yes you will need at least msvc 17.5.
Otherwise a larger polyfill for atomic will be required.
You can check the action on the fork to view successful build configuration of all platforms.

@kings177
Copy link
Contributor

could you also remove the windows disclaimer from the README.md and add that for windows, you need MSVC ver >= 17.5 please?

@kings177
Copy link
Contributor

On both windows and linux seems like it's ok, can't test on a mac right now, will try it later.

@edusporto
Copy link
Contributor

Tested on MacOS, all examples in examples get the same results but it seems slightly slower, could be statistically insignificant since I only ran each test once

image

We're still discussing a few things internally before merging, specially the changes to Net allocation
We're also still developing automated tests so it gets easier to compare such changes

@VictorTaelin
Copy link
Member

Thanks for the PR! I really appreciate it. It changes some things I'm not aware will be safe though. I'll go through it later, when we have more tests

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.

4 participants