rustformers / llm

[Unmaintained, see README] An ecosystem of Rust libraries for working with large language models

Home Page:https://docs.rs/llm/latest/llm/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failure on Windows

NuSkooler opened this issue · comments

I'm attempting to build from source on Windows, but am getting C++ related build failures. Is this supported? Do I need a different version of MSVC? Details below.

error: failed to run custom build command for `ggml-sys v0.2.0-dev (G:\dev\llm\crates\ggml\sys)`

Caused by:
  process didn't exit successfully: `G:\dev\llm\target\release\build\ggml-sys-e40fe4cf527e7b33\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=llama-cpp
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-pc-windows-msvc")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  DEBUG = Some("false")
  running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "llama-cpp" "/arch:AVX2" "-DGGML_USE_K_QUANTS" "-DNDEBUG" "-FoG:\\dev\\llm\\target\\release\\build\\ggml-sys-6fc7c701f9a4332b\\out\\llama-cpp/ggml.o" "-c" "llama-cpp/ggml.c"
  ggml.c
  g:\dev\llm\crates\ggml\sys\llama-cpp\ggml.h(1646): error C2146: syntax error: missing ')' before identifier 'x'
  g:\dev\llm\crates\ggml\sys\llama-cpp\ggml.h(1646): error C2061: syntax error: identifier 'x'
  g:\dev\llm\crates\ggml\sys\llama-cpp\ggml.h(1646): error C2059: syntax error: ';'
  g:\dev\llm\crates\ggml\sys\llama-cpp\ggml.h(1646): error C2059: syntax error: ','
  g:\dev\llm\crates\ggml\sys\llama-cpp\ggml.h(1646): error C2059: syntax error: ')'

Which rust version are you using? And are you using the MSVC version included in the rustup installer or a externally installed one?

@LLukas22 Apologies, I could have sworn the Rust version was above.

rustc 1.71.0 (8ede3aae2 2023-07-12)
rustup 1.26.0 (5af9b9484 2023-04-05)
cargo 1.71.0 (cfd3bbd8f 2023-06-08)

Visual Studio was installed using their installer. It's a working C++ installation (at least for other cases). Includes Windows 10+ SDKs, all the headers, etc.

My current setup is:

rustc 1.70.0 (90c541806 2023-05-31)
rustup 1.26.0 (5af9b9484 2023-04-05)
cargo 1.70.0 (ec8a8a0ca 2023-04-25)
MSVC 14.35.32215

The CI/CD currently also runs as expected and uses a default rust 1.65 setup.

Maybe check if the git-submodule was checked out correctly.

@LLukas22 Re-cloned, no errors. Tried applying the latest dot version to my VS install without luck either. Finally updated to VS to 2022 (cl.exe 19.36.32537) and it worked without issue.

I'm sure this can be closed unless others are seeing the same.