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

Compile Error when cargo build #13

Open
wanglu4042 opened this issue Nov 9, 2024 · 3 comments
Open

Compile Error when cargo build #13

wanglu4042 opened this issue Nov 9, 2024 · 3 comments

Comments

@wanglu4042
Copy link

Hi, I am a beginner of RUST,when I try to use nova-scotia = "0.5.0" and nova-snark = "0.37.0", I met two error.
The first was:

(base) PS D:\ZKP_file\Work\project_1> cargo build --release
   Compiling pasta-msm v0.1.4
The following warnings were emitted during compilation:

warning: [email protected]: Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU
warning: [email protected]: Compiler family detection failed due to error: ToolFamilyMacroNotFound: Expects macro `__clang__`, `__GNUC__` or `__EMSCRIPTEN__`, `__VXWORKS__` or accepts cl style flag `-?`, but found none
warning: [email protected]: cl: ������ error D8021 :��Ч����ֵ������/Wno-unused-function��

error: failed to run custom build command for `pasta-msm v0.1.4`

Caused by:
  process didn't exit successfully: `D:\ZKP_file\Work\project_1\target\release\build\pasta-msm-33270b74460bbfc5\build-script-build` (exit code: 1)
  --- stderr


  error occurred: Command "nvcc" "-ccbin=C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" "-Xcompiler" "-nologo" "-Xcompiler" "-MD" "-Xcompiler" "-O2" "-Xcompiler" "-Brepro" "-I" "C:\\Users\\WANGLU\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\semolina-0.1.4\\src" "-I" "C:\\Users\\WANGLU\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\sppark-0.1.10\\sppark" "-Xcompiler" "-W4" "-Xcompiler" "-Wno-unused-function" "-arch=sm_70" "-DTAKE_RESPONSIBILITY_FOR_ERROR_MESSAGE" "-D__ADX__" "-o" "D:\\ZKP_file\\Work\\project_1\\target\\release\\build\\pasta-msm-aca72caebecc5d3d\\out\\0c0a7217c765217b-pallas.o" "-c" "cuda/pallas.cu" with args nvcc did not execute successfully (status code exit code: 2).

And when I switch to rustup default stable-x86_64-pc-windows-gnu, this happened

The following warnings were emitted during compilation:

warning: [email protected]: Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU
warning: [email protected]: Compiler family detection failed due to error: ToolFamilyMacroNotFound: Expects macro `__clang__`, `__GNUC__` or `__EMSCRIPTEN__`, `__VXWORKS__` or accepts cl style flag `-?`, but found none

error: failed to run custom build command for `sppark v0.1.10`

Caused by:
  process didn't exit successfully: `D:\ZKP_file\Work\project_1\target\release\build\sppark-d53db918cf6e85b1\build-script-build` (exit code: 101)
  --- stdout
  cargo:ROOT=C:\Users\WANGLU\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sppark-0.1.10\sppark
  cargo:rerun-if-env-changed=NVCC
  cargo:rerun-if-env-changed=HIPCC
  OPT_LEVEL = Some(3)
  OUT_DIR = Some(D:\ZKP_file\Work\project_1\target\release\build\sppark-314519af72447ce2\out)
  TARGET = Some(x86_64-pc-windows-gnu)
  HOST = Some(x86_64-pc-windows-gnu)
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-gnu
  CXX_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_gnu
  CXX_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=NVCC_x86_64-pc-windows-gnu
  NVCC_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=NVCC_x86_64_pc_windows_gnu
  NVCC_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=HOST_NVCC
  HOST_NVCC = None
  cargo:rerun-if-env-changed=NVCC
  NVCC = None
  cargo:warning=Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU
  cargo:warning=Compiler family detection failed due to error: ToolFamilyMacroNotFound: Expects macro `__clang__`, `__GNUC__` or `__EMSCRIPTEN__`, `__VXWORKS__` or accepts cl style flag `-?`, but found none
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,sse,sse2,sse3)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  nvcc fatal   : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.

  --- stderr
  thread 'main' panicked at C:\Users\WANGLU\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sppark-0.1.10\build.rs:123:68:
  impossible: Os { code: 2, kind: NotFound, message: "系统找不到指定的文件。" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Could you help me with that?
Thanks!

@dot-asm
Copy link
Collaborator

dot-asm commented Nov 15, 2024

The build script is programmed to not pass Wno-unused-function argument on Windows, so this shouldn't happen. Though it's assumed that user uses the msvc toolchain to compile. This is assumed to be safe bet, because Nvidia support exclusively Microsoft compiler. What does rustup toolchain list print on your computer?

@wanglu4042
Copy link
Author

Hi!
Thanks for your reply.
Below is the result from running the rustup toolchain list
image
I still did not run cargo build --release successfully.
Looking forward to your reply!
Thanks.

ps: BTW, can I use nova-scotia = "0.5.0" and nova-snark = "0.37.0" only on Windows computer with Nvidia GPU? Is macos supported?

@dot-asm
Copy link
Collaborator

dot-asm commented Dec 13, 2024

So assertion is that with msvc as default toolchain pasta-msm build.rs script passes -Wno-unused-function to cl compiler. This shouldn't be possible and I can attest that it works for me. "Works" in sense that on my computer the build script in question does not pass the problematic option. This is where my troubleshooting stops. If I can't reproduce it, user is on their own. I'd suggest to perform fresh Rust installation with all default settings.

Formally speaking one can make a case for making the build.rs be more nuanced and handle this edge case. The problem is that I still don't understand what is the case and would need to reproduce the problem...

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

No branches or pull requests

2 participants