1

I'm trying to create a rust project using the bellperson crate. Before even actually implementing it in my code (instead of the bellman crate), I just tried building with it, but I'm getting an error.

My Cargo.toml:

[package]
name = "temp1"
version = "0.1.0"
edition = "2018"

[dependencies]
bellperson = "0.9.2"

my main.rs:

fn main() {
println!("yay");
}

the error:

warning: cl : Command line warning D9024 : unrecognized source file type './asm/mul_4.S', object file assumed
warning: cl : Command line warning D9027 : source file './asm/mul_4.S' ignored

error: failed to run custom build command for `fff v0.2.2`

Caused by:
  process didn't exit successfully: `C:\Users\dana\Desktop\project\save to disk\target\debug\build\fff-733f5e53c9fbd315\build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
DEBUG = Some("true")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-c" "-FoC:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o" "-c" "./asm/mul_4.S"
cargo:warning=cl : Command line warning D9024 : unrecognized source file type './asm/mul_4.S', object file assumed
cargo:warning=cl : Command line warning D9027 : source file './asm/mul_4.S' ignored
cl : Command line warning D9021 : no action performed
exit code: 0
AR_x86_64-pc-windows-msvc = None
AR_x86_64_pc_windows_msvc = None
HOST_AR = None
AR = None
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX64\\x64\\lib.exe" "-out:C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\libff-derive-crypto.a" "-nologo" "C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o"
LINK : fatal error LNK1181: cannot open input file 'C:\Users\dana\Desktop\project\save to disk\target\debug\build\fff-051a6b4af5fa312a\out\.\asm\mul_4.o'
exit code: 1181

--- stderr


error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX64\\x64\\lib.exe" "-out:C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\libff-derive-crypto.a" "-nologo" "C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o" with args "lib.exe" did not execute successfully (status code exit code: 1181).

any ideas on how to solve this, or why is it happening? thanks!

--edit-- tried running it using Cygwin, ran CC=gcc AR=gcc cargo build, got a similar error:

error: failed to run custom build command for `fff v0.2.2`

Caused by:
  process didn't exit successfully: `C:\Users\dana\Desktop\project\save to disk\t
arget\debug\build\fff-733f5e53c9fbd315\build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = Some("gcc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-fram
e-pointer" "-m64" "-Wall" "-Wextra" "-c" "-FoC:\\Users\\dana\\Desktop\\project\\s
ave to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o" "-c"
 "./asm/mul_4.S"
exit code: 0
AR_x86_64-pc-windows-msvc = None
AR_x86_64_pc_windows_msvc = None
HOST_AR = None
AR = Some("gcc")
running: "gcc" "-out:C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\deb
ug\\build\\fff-051a6b4af5fa312a\\out\\libff-derive-crypto.a" "-nologo" "C:\\Users
\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312
a\\out\\./asm/mul_4.o"
cargo:warning=gcc: error: C:\Users\dana\Desktop\project\save to disk\target\debug
\build\fff-051a6b4af5fa312a\out\./asm/mul_4.o: No such file or directory
cargo:warning=gcc: error: unrecognized command line option ‘-nologo’
cargo:warning=gcc: fatal error: no input files
cargo:warning=compilation terminated.
exit code: 1

--- stderr


error occurred: Command "gcc" "-out:C:\\Users\\dana\\Desktop\\project\\save to di
sk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\libff-derive-crypto.a" "-nol
ogo" "C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-
051a6b4af5fa312a\\out\\./asm/mul_4.o" with args "gcc" did not execute successfull
y (status code exit code: 1).



warning: build failed, waiting for other jobs to finish...
error: build failed

--2nd edit-- tried with MinGW, ran cargo build. still doesn't work, still a similar issue:

warning: cl : Command line warning D9024 : unrecognized source file type './asm/mul_4.S', object file assumed
warning: cl : Command line warning D9027 : source file './asm/mul_4.S' ignored

error: failed to run custom build command for `fff v0.2.2`

Caused by:
  process didn't exit successfully: `C:\Users\dana\Desktop\project\save to disk\target\debug\build\fff-733f5e53c9fbd315\build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
DEBUG = Some("true")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-c" "-FoC:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o" "-c" "./asm/mul_4.S"
cargo:warning=cl : Command line warning D9024 : unrecognized source file type './asm/mul_4.S', object file assumed
cargo:warning=cl : Command line warning D9027 : source file './asm/mul_4.S' ignored
cl : Command line warning D9021 : no action performed
exit code: 0
AR_x86_64-pc-windows-msvc = None
AR_x86_64_pc_windows_msvc = None
HOST_AR = None
AR = None
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX64\\x64\\lib.exe" "-out:C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\libff-derive-crypto.a" "-nologo" "C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o"
LINK : fatal error LNK1181: cannot open input file 'C:\Users\dana\Desktop\project\save to disk\target\debug\build\fff-051a6b4af5fa312a\out\.\asm\mul_4.o'
exit code: 1181

--- stderr


error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX64\\x64\\lib.exe" "-out:C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\libff-derive-crypto.a" "-nologo" "C:\\Users\\dana\\Desktop\\project\\save to disk\\target\\debug\\build\\fff-051a6b4af5fa312a\\out\\./asm/mul_4.o" with args "lib.exe" did not execute successfully (status code exit code: 1181).



warning: build failed, waiting for other jobs to finish...
error: build failed
 
justme1205
  • 21
  • 2
  • Looks like the `fff` crate contains an assembly file that can't be built with MSVC. You probably need to install a GNU toolchain, e.g. with cygwin. I haven't used Windows in 20 years, so I won't be able to help with the details. – Sven Marnach Jul 14 '20 at 09:40
  • tried with Cygwin, ran CC=gcc AR=gcc cargo build, still doesn't work :( – justme1205 Jul 14 '20 at 11:27
  • Looks like your target triple is still set to `x86_64-pc-windows-msvc`, so the `cc` crate will pass options suitable for the MSVC tool chain. I don't really know whether you can compile Rust on cygwin, or whether you should use MinGW instead. Google will probably know better than someone who never uses Windows. – Sven Marnach Jul 14 '20 at 12:27
  • Google found this: https://stackoverflow.com/q/47379214 So maybe you are better off with MinGW, which also gives you a GNU toolchain. – Sven Marnach Jul 14 '20 at 12:28
  • tried with MinGW - still doesn't work :( – justme1205 Jul 14 '20 at 13:40
  • The last log you pasted uses MSVC, not MinGW. – Sven Marnach Jul 14 '20 at 14:35

0 Answers0