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

Failed to build rustc_codegen_nvvm #89

Open
dest1n1s opened this issue Sep 28, 2022 · 6 comments
Open

Failed to build rustc_codegen_nvvm #89

dest1n1s opened this issue Sep 28, 2022 · 6 comments

Comments

@dest1n1s
Copy link

Hello! I'm also trying to build the add example on Windows 11, but facing the error of failed to run custom build command for `rustc_codegen_nvvm v0.3.0` .

It seems that there's some wrong with -wd4141-like command line options on g++.exe.

I've tried to use LLVM 7.1.0 built from source code using Visual Studio 2022, and that from this repo, but they're causing the same error.

I'm using g++ built by MSYS2 project, version 12.2.0.

Here is the complete error log:

error: failed to run custom build command for rustc_codegen_nvvm v0.3.0
Caused by:
process didn't exit successfully: D:\Destiny\Program\git_repo\raddar\target\debug\build\rustc_codegen_nvvm-9f804d9c977ae1d3\build-script-build (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=LLVM_CONFIG
cargo:rerun-if-env-changed=USE_PREBUILT_LLVM
cargo:rustc-cfg=llvm_component="bitreader"
cargo:rustc-cfg=llvm_component="bitwriter"
cargo:rustc-cfg=llvm_component="ipo"
cargo:rustc-cfg=llvm_component="lto"
cargo:rustc-cfg=llvm_component="nvptx"
cargo:rerun-if-env-changed=LLVM_RUSTLLVM
cargo:rerun-if-changed=rustc_llvm_wrapper
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-gnu")
CXX_x86_64-pc-windows-gnu = None
CXX_x86_64_pc_windows_gnu = None
HOST_CXX = None
CXX = None
CXXFLAGS_x86_64-pc-windows-gnu = None
CXXFLAGS_x86_64_pc_windows_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
running: "g++.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "rustc_llvm_wrapper" "-ID:\Destiny\Program\Service\llvm-7.1.0-prebuild\include" "/DWIN32" "/D_WINDOWS" "/Zc:inline" "/Zc:strictStrings" "/Oi" "/Zc:rvalueCast" "/W4" "-wd4141" "-wd4146" "-wd4180" "-wd4244" "-wd4258" "-wd4267" "-wd4291" "-wd4345" "-wd4351" "-wd4355" "-wd4456" "-wd4457" "-wd4458" "-wd4459" "-wd4503" "-wd4624" "-wd4722" "-wd4800" "-wd4100" "-wd4127" "-wd4512" "-wd4505" "-wd4610" "-wd4510" "-wd4702" "-wd4245" "-wd4706" "-wd4310" "-wd4701" "-wd4703" "-wd4389" "-wd4611" "-wd4805" "-wd4204" "-wd4577" "-wd4091" "-wd4592" "-wd4319" "-wd4324" "-w14062" "-we4238" "/EHs-c-" "/GR-" "-D_CRT_SECURE_NO_DEPRECATE" "-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_NONSTDC_NO_DEPRECATE" "-D_CRT_NONSTDC_NO_WARNINGS" "-D_SCL_SECURE_NO_DEPRECATE" "-D_SCL_SECURE_NO_WARNINGS" "-DUNICODE" "-D_UNICODE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_NVPTX" "-o" "D:\Destiny\Program\git_repo\raddar\target\debug\build\rustc_codegen_nvvm-9a28ca0012fa4c4c\out\rustc_llvm_wrapper/PassWrapper.o" "-c" "rustc_llvm_wrapper/PassWrapper.cpp"
running: "g++.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "rustc_llvm_wrapper" "-ID:\Destiny\Program\Service\llvm-7.1.0-prebuild\include" "/DWIN32" "/D_WINDOWS" "/Zc:inline" "/Zc:strictStrings" "/Oi" "/Zc:rvalueCast" "/W4" "-wd4141" "-wd4146" "-wd4180" "-wd4244" "-wd4258" "-wd4267" "-wd4291" "-wd4345" "-wd4351" "-wd4355" "-wd4456" "-wd4457" "-wd4458" "-wd4459" "-wd4503" "-wd4624" "-wd4722" "-wd4800" "-wd4100" "-wd4127" "-wd4512" "-wd4505" "-wd4610" "-wd4510" "-wd4702" "-wd4245" "-wd4706" "-wd4310" "-wd4701" "-wd4703" "-wd4389" "-wd4611" "-wd4805" "-wd4204" "-wd4577" "-wd4091" "-wd4592" "-wd4319" "-wd4324" "-w14062" "-we4238" "/EHs-c-" "/GR-" "-D_CRT_SECURE_NO_DEPRECATE" "-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_NONSTDC_NO_DEPRECATE" "-D_CRT_NONSTDC_NO_WARNINGS" "-D_SCL_SECURE_NO_DEPRECATE" "-D_SCL_SECURE_NO_WARNINGS" "-DUNICODE" "-D_UNICODE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_NVPTX" "-o" "D:\Destiny\Program\git_repo\raddar\target\debug\build\rustc_codegen_nvvm-9a28ca0012fa4c4c\out\rustc_llvm_wrapper/RustWrapper.o" "-c" "rustc_llvm_wrapper/RustWrapper.cpp"
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4141'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4141'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4146'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4146'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4180'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4180'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4244'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4244'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4258'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4258'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4267'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4267'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4291'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4291'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4345'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4345'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4351'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4351'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4355'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4355'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4456'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4456'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4457'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4457'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4458'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4458'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4459'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4459'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4503'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4503'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4624'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4624'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4722'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4722'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4800'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4800'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4100'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4100'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4127'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4127'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4512'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4505'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4512'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4610'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4505'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4510'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4610'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4702'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4510'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4245'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4702'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4706'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4245'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4310'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4706'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4701'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4310'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4703'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4701'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4389'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4703'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4611'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4389'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4805'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4611'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4204'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4805'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4577'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4204'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4091'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4577'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4592'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4091'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4319'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4592'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4324'
cargo:warning=g++.exe: error: unrecognized command-line option '-w14062'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4319'
cargo:warning=g++.exe: error: unrecognized command-line option '-we4238'
cargo:warning=g++.exe: error: unrecognized command-line option '-wd4324'
exit code: 1
cargo:warning=g++.exe: error: unrecognized command-line option '-w14062'
cargo:warning=g++.exe: error: unrecognized command-line option '-we4238'
exit code: 1
--- stderr
error occurred: Command "g++.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "rustc_llvm_wrapper" "-ID:\Destiny\Program\Service\llvm-7.1.0-prebuild\include" "/DWIN32" "/D_WINDOWS" "/Zc:inline" "/Zc:strictStrings" "/Oi" "/Zc:rvalueCast" "/W4" "-wd4141" "-wd4146" "-wd4180" "-wd4244" "-wd4258" "-wd4267" "-wd4291" "-wd4345" "-wd4351" "-wd4355" "-wd4456" "-wd4457" "-wd4458" "-wd4459" "-wd4503" "-wd4624" "-wd4722" "-wd4800" "-wd4100" "-wd4127" "-wd4512" "-wd4505" "-wd4610" "-wd4510" "-wd4702" "-wd4245" "-wd4706" "-wd4310" "-wd4701" "-wd4703" "-wd4389" "-wd4611" "-wd4805" "-wd4204" "-wd4577" "-wd4091" "-wd4592" "-wd4319" "-wd4324" "-w14062" "-we4238" "/EHs-c-" "/GR-" "-D_CRT_SECURE_NO_DEPRECATE" "-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_NONSTDC_NO_DEPRECATE" "-D_CRT_NONSTDC_NO_WARNINGS" "-D_SCL_SECURE_NO_DEPRECATE" "-D_SCL_SECURE_NO_WARNINGS" "-DUNICODE" "-D_UNICODE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_NVPTX" "-o" "D:\Destiny\Program\git_repo\raddar\target\debug\build\rustc_codegen_nvvm-9a28ca0012fa4c4c\out\rustc_llvm_wrapper/RustWrapper.o" "-c" "rustc_llvm_wrapper/RustWrapper.cpp" with args "g++.exe" did not execute successfully (status code exit code: 1).

@locadani
Copy link

Hi, I have the same problem and I just noticed that in the file ".cargo\registry\src\github.com-1ecc6299db9ec823\rustc_codegen_nvvm-0.3.0\build.rs", the static PREBUILT_LLVM_URL points to a non existing page. I don't know how to solve this, but maybe it helps

@dest1n1s
Copy link
Author

Hi, I have the same problem and I just noticed that in the file ".cargo\registry\src\github.com-1ecc6299db9ec823\rustc_codegen_nvvm-0.3.0\build.rs", the static PREBUILT_LLVM_URL points to a non existing page. I don't know how to solve this, but maybe it helps

I've solved the problem by changing the toolchain from gnu to msvc. Maybe you can try this.

@locadani
Copy link

Thank you for replying. I am using the nightly-msvc already, I solved it with the prebuild LLVM

@ja-softdevel
Copy link

@locadani What steps did you to take to resolve the issue?

@locadani
Copy link

I don't remember exactly because it was some time ago. I was running on linux and here is what I remember.
I downloaded this prebuilt binary here. Then right click it and from its properties make it executable. Finally create and envirnomental variable LLVM_CONFIG that points to the executable (or folder, i am not sure but i think executable). This should work.
But I want to say that I couldn't manage to make it work. This solves just one of the many I have found.
So I also attach some other problems I have encountered and how i have solved them, hoping it is useful and someone might find out how to make it run.

Here:
SomeProblems.txt

@ja-softdevel
Copy link

@locadani Thanks for the info. I had found the LLVM stuff in the Dockerfile and was working on that. I haven't made this work yet, but I'm sure at some point it will. {hopefully}

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

3 participants