PaddiM8 / kalker

Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
https://kalker.xyz
MIT License
1.59k stars 70 forks source link

Kalker wont build on windows #146

Closed tolik518 closed 3 months ago

tolik518 commented 3 months ago

If I try to build kalker on windows (using cargo install kalker), it fails everytime with error: failed to run custom build command for 'gmp-mpfr-sys v1.6.2'.

It seems like gmp-mpfr-sys v1.6.2 isn't available for windows. Is there a chance to ditch it for the future?

> cargo install kalker
    Updating crates.io index
  Installing kalker v2.1.0
    Updating crates.io index
  Downloaded rug v1.24.1
  Downloaded 1 crate (353.5 KB) in 1.10s
   Compiling winapi v0.3.9
   Compiling windows_x86_64_msvc v0.52.4
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling wasm-bindgen-shared v0.2.92
   Compiling libc v0.2.153
   Compiling serde v1.0.197
   Compiling bumpalo v3.15.4
   Compiling log v0.4.21
   Compiling once_cell v1.19.0
   Compiling memchr v2.7.2
   Compiling cfg-if v1.0.0
   Compiling libm v0.2.8
   Compiling az v1.2.1
   Compiling wasm-bindgen v0.2.92
   Compiling rug v1.24.1
   Compiling regex-syntax v0.8.3
   Compiling bitflags v1.3.2
   Compiling unicode-segmentation v1.11.0
   Compiling lazy_static v1.4.0
   Compiling unicode-width v0.1.11
   Compiling scopeguard v1.2.0
   Compiling seahorse v1.1.2
   Compiling aho-corasick v1.1.3
   Compiling regex-automata v0.4.6
   Compiling windows-targets v0.52.4
   Compiling windows-sys v0.52.0
   Compiling quote v1.0.35
   Compiling syn v2.0.57
   Compiling gmp-mpfr-sys v1.6.2
   Compiling toml v0.5.11
   Compiling regex v1.10.4
   Compiling dirs-sys-next v0.1.2
   Compiling fs2 v0.4.3
   Compiling dirs-sys v0.3.7
   Compiling ansi_term v0.12.1
   Compiling atty v0.2.14
   Compiling wasm-bindgen-backend v0.2.92
error: failed to run custom build command for `gmp-mpfr-sys v1.6.2`

Caused by:
  process didn't exit successfully: `C:\Users\USERNAME\AppData\Local\Temp\cargo-installrkBXDW\release\build\gmp-mpfr-sys-bd04239d38a76ace\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=GMP_MPFR_SYS_CACHE
  $ mkdir -p "C:\\Users\\USERNAME\\AppData\\Local\\Temp\\cargo-installrkBXDW\\release\\build\\gmp-mpfr-sys-595ec0c91aaa5f23\\out\\lib"
  $ mkdir -p "C:\\Users\\USERNAME\\AppData\\Local\\Temp\\cargo-installrkBXDW\\release\\build\\gmp-mpfr-sys-595ec0c91aaa5f23\\out\\include"

  --- stderr
  thread 'main' panicked at C:\Users\USERNAME\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gmp-mpfr-sys-1.6.2\build.rs:1070:9:
  Windows MSVC target is not supported (linking would fail)
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `kalker v2.1.0`, intermediate artifacts can be found at `C:\Users\USERNAME\AppData\Local\Temp\cargo-installrkBXDW`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
tolik518 commented 3 months ago

It seems like there's a workaround mentioned in the readme I didn't see. The ticket can be closed.

PaddiM8 commented 3 months ago

It is indeed possible to get it to build on Windows.

It seems like gmp-mpfr-sys v1.6.2 isn't available for windows. Is there a chance to ditch it for the future?

I would still love to replace gmp-mpfr-sys eventually though! It has caused a lot of headaches. Unfortunately, pure-rust libraries don't seem to be mature enough yet.

tolik518 commented 3 months ago

@PaddiM8 Thanks for your reply :) Yeah, using Msys2 just to compile kalker isn't an option for me, since I'd need to install the Msys2 and the whole cargo environment inside it. This would be overkill. I'd love to see it being replaced in the future, but as long it's not the case, I'll stick to using it only on my linux machine :)