kornelski / mozjpeg-sys

Rust bindings for mozjpeg
https://lib.rs/crates/mozjpeg-sys
Other
33 stars 17 forks source link

Can't find "ar" on Win 8.1 with rustc-msvc (and nasm installed) #5

Closed Boscop closed 6 years ago

Boscop commented 6 years ago

I want to use libjpeg-turbo in Rust to decode MJPEG frames at 30fps (the jpeg-decoder crate uses too much CPU), so I downloaded libjpeg-turbo-1.5.90-vc64.exe from here and installed it, now I have jpeg62.dll and turbojpeg.dll, but mozjpeg fails to build:

D:\3rdparty\mozjpeg-sys>cargo build --examples
   Compiling nodrop v0.1.12
   Compiling memoffset v0.2.1
   Compiling cfg-if v0.1.2
   Compiling libc v0.2.40
   Compiling dunce v0.1.1
   Compiling scopeguard v0.3.3
   Compiling lazy_static v1.0.0
   Compiling either v1.5.0
   Compiling winapi v0.3.4
   Compiling rayon-core v1.4.0
   Compiling crossbeam-utils v0.2.2
   Compiling arrayvec v0.4.7
   Compiling num_cpus v1.8.0
   Compiling crossbeam-epoch v0.3.1
   Compiling crossbeam-deque v0.2.0
   Compiling rand v0.4.2
   Compiling rayon v0.9.0
   Compiling rayon v1.0.1
   Compiling nasm-rs v0.1.2
   Compiling cc v1.0.9
   Compiling mozjpeg-sys v0.5.10 (file:///D:/3rdparty/mozjpeg-sys)
error: failed to run custom build command for `mozjpeg-sys v0.5.10 (file:///D:/3
rdparty/mozjpeg-sys)`
process didn't exit successfully: `D:\3rdparty\mozjpeg-sys\target\debug\build\mo
zjpeg-sys-b17db60799551af4\build-script-build` (exit code: 101)
--- stdout
cargo:include=D:\3rdparty\mozjpeg-sys\target\debug\build\mozjpeg-sys-757ded5251b
ff80a\out\include;D:\3rdparty\mozjpeg-sys\vendor
cargo:lib_version=62
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jdmerge-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpe
g-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jdm
erge-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jfdctint-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jf
dctint-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jidctflt-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\ji
dctflt-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jfdctfst-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jf
dctfst-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jfdctflt-sse-64.asm" "-o" "D:\\3rdparty\\mozjpe
g-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jfd
ctflt-sse-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jcgray-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpeg
-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jcgr
ay-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jcsample-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jc
sample-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jidctint-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\ji
dctint-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jccolor-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpe
g-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jcc
olor-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jchuff-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpeg
-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jchu
ff-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jidctfst-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\ji
dctfst-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jdsample-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jd
sample-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jdcolor-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpe
g-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jdc
olor-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jquantf-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpe
g-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jqu
antf-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jidctred-sse2-64.asm" "-o" "D:\\3rdparty\\mozjp
eg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\ji
dctred-sse2-64.o"
running: "nasm" "-fwin64" "-g" "-ID:\\3rdparty\\mozjpeg-sys\\vendor\\simd/" "-ID
:\\3rdparty\\mozjpeg-sys\\vendor\\win/" "-DPIC" "-DWIN64" "-D__x86_64__" "D:\\3r
dparty\\mozjpeg-sys\\vendor/simd/jquanti-sse2-64.asm" "-o" "D:\\3rdparty\\mozjpe
g-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jqu
anti-sse2-64.o"
running: "ar" "crus" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-s
ys-757ded5251bff80a\\out\\mozjpegsimd.lib" "D:\\3rdparty\\mozjpeg-sys\\target\\d
ebug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jfdctflt-sse-64.o"
"D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\
out\\vendor/simd\\jccolor-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\
build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jcgray-sse2-64.o" "D:\\3r
dparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\ve
ndor/simd\\jchuff-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\m
ozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jcsample-sse2-64.o" "D:\\3rdparty
\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/s
imd\\jdcolor-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpe
g-sys-757ded5251bff80a\\out\\vendor/simd\\jdmerge-sse2-64.o" "D:\\3rdparty\\mozj
peg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\j
dsample-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys
-757ded5251bff80a\\out\\vendor/simd\\jfdctfst-sse2-64.o" "D:\\3rdparty\\mozjpeg-
sys\\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jfdct
int-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys-757
ded5251bff80a\\out\\vendor/simd\\jidctflt-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\
\target\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jidctfst-
sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5
251bff80a\\out\\vendor/simd\\jidctint-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\tar
get\\debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jidctred-sse2
-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\debug\\build\\mozjpeg-sys-757ded5251b
ff80a\\out\\vendor/simd\\jquantf-sse2-64.o" "D:\\3rdparty\\mozjpeg-sys\\target\\
debug\\build\\mozjpeg-sys-757ded5251bff80a\\out\\vendor/simd\\jquanti-sse2-64.o"

--- stderr
thread 'main' panicked at 'failed to spawn process: The system cannot find the f
ile specified. (os error 2)', C:\Users\me\.cargo\registry\src\github.com-1ecc629
9db9ec823\nasm-rs-0.1.2\src\lib.rs:329:19
stack backtrace:
   0: std::sys::windows::backtrace::unwind_backtrace
             at C:\projects\rust\src\libstd\sys\windows\backtrace\mod.rs:65
   1: std::sys_common::backtrace::_print
             at C:\projects\rust\src\libstd\sys_common\backtrace.rs:71
   2: std::sys_common::backtrace::print
             at C:\projects\rust\src\libstd\sys_common\backtrace.rs:59
   3: std::panicking::default_hook::{{closure}}
             at C:\projects\rust\src\libstd\panicking.rs:207
   4: std::panicking::default_hook
             at C:\projects\rust\src\libstd\panicking.rs:223
   5: std::panicking::rust_panic_with_hook
             at C:\projects\rust\src\libstd\panicking.rs:402
   6: std::panicking::begin_panic_fmt
             at C:\projects\rust\src\libstd\panicking.rs:349
   7: nasm_rs::run
             at C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\nasm
-rs-0.1.2\src\lib.rs:329
   8: nasm_rs::Build::archive
             at C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\nasm
-rs-0.1.2\src\lib.rs:270
   9: nasm_rs::Build::compile
             at C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\nasm
-rs-0.1.2\src\lib.rs:208
  10: build_script_build::build_nasm
             at .\src\build.rs:228
  11: build_script_build::main
             at .\src\build.rs:137
  12: std::rt::lang_start::{{closure}}<()>
             at C:\projects\rust\src\libstd\rt.rs:74
  13: std::rt::lang_start_internal::{{closure}}
             at C:\projects\rust\src\libstd\rt.rs:59
  14: std::panicking::try::do_call<closure,i32>
             at C:\projects\rust\src\libstd\panicking.rs:306
  15: panic_unwind::__rust_maybe_catch_panic
             at C:\projects\rust\src\libpanic_unwind\lib.rs:102
  16: std::panicking::try
             at C:\projects\rust\src\libstd\panicking.rs:285
  17: std::panic::catch_unwind
             at C:\projects\rust\src\libstd\panic.rs:361
  18: std::rt::lang_start_internal
             at C:\projects\rust\src\libstd\rt.rs:58
  19: std::rt::lang_start<()>
             at C:\projects\rust\src\libstd\rt.rs:74
  20: main
  21: invoke_main
             at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:64
  22: __scrt_common_main_seh
             at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
  23: BaseThreadInitThunk
  24: RtlUserThreadStart
Boscop commented 6 years ago

I guess it would work when this is fixed? https://github.com/medek/nasm-rs/issues/12

kornelski commented 6 years ago

You're right about this. I've updated nasm and published a workaround.

Boscop commented 6 years ago

Thanks, so now it will automatically use nasm (and SIMD) also on Windows?

kornelski commented 6 years ago

Yes