samuela / rustybox

A free-range, non-GMO fork of busybox in 100% Rust 🦀
811 stars 33 forks source link

quadmath.h: No such file or directory #8

Closed almereyda closed 4 years ago

almereyda commented 4 years ago

After cloning the repository and running cargo build --release (Ubuntu 19.10 arm64), an error is thrown:

$ cargo build --release
info: syncing channel updates for 'nightly-aarch64-unknown-linux-gnu'
info: latest update on 2019-12-03, rust version 1.41.0-nightly (fdc001156 2019-12-02)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-12-02-aarch64-unknown-linux-gnu'
info: latest update on 2019-12-02, rust version 1.41.0-nightly (4007d4ef2 2019-12-01)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-12-01-aarch64-unknown-linux-gnu'
info: latest update on 2019-12-01, rust version 1.41.0-nightly (d8bdb3fdc 2019-11-30)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-11-30-aarch64-unknown-linux-gnu'
info: latest update on 2019-11-30, rust version 1.41.0-nightly (25d8a9494 2019-11-29)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-11-29-aarch64-unknown-linux-gnu'
info: latest update on 2019-11-29, rust version 1.41.0-nightly (bbb664a99 2019-11-28)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-11-28-aarch64-unknown-linux-gnu'
info: latest update on 2019-11-28, rust version 1.41.0-nightly (e87a205c2 2019-11-27)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-11-27-aarch64-unknown-linux-gnu'
info: latest update on 2019-11-27, rust version 1.41.0-nightly (797fd9262 2019-11-26)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-11-26-aarch64-unknown-linux-gnu'
info: latest update on 2019-11-26, rust version 1.41.0-nightly (a44774c3a 2019-11-25)
info: skipping nightly which is missing installed component 'clippy-preview'
info: syncing channel updates for 'nightly-2019-11-25-aarch64-unknown-linux-gnu'
info: latest update on 2019-11-25, rust version 1.41.0-nightly (412f43ac5 2019-11-24)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustc-dev'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustc-dev'
info: installing component 'rustfmt'
    Updating crates.io index
  Downloaded libc v0.2.65
  Downloaded lazy_static v1.4.0
  Downloaded c2rust-asm-casts v0.1.1
  Downloaded f128 v0.2.6
  Downloaded c2rust-bitfields v0.3.0
  Downloaded c2rust-bitfields-derive v0.2.0
  Downloaded quote v0.6.13
  Downloaded syn v0.15.44
  Downloaded num-traits v0.2.9
  Downloaded f128_input v0.2.1
  Downloaded f128_internal v0.2.1
  Downloaded unicode-xid v0.1.0
  Downloaded autocfg v0.1.7
  Downloaded proc-macro2 v0.4.30
  Downloaded cc v1.0.47
   Compiling proc-macro2 v0.4.30
   Compiling autocfg v0.1.7
   Compiling libc v0.2.65
   Compiling cc v1.0.47
   Compiling unicode-xid v0.1.0
   Compiling syn v0.15.44
   Compiling rustybox v0.0.0 (/home/ubuntu/src/github.com/samuela/rustybox)
   Compiling lazy_static v1.4.0
   Compiling c2rust-asm-casts v0.1.1
   Compiling num-traits v0.2.9
   Compiling quote v0.6.13
   Compiling f128_internal v0.2.1
error: failed to run custom build command for `f128_internal v0.2.1`

Caused by:
  process didn't exit successfully: `/home/ubuntu/src/github.com/samuela/rustybox/target/release/build/f128_internal-7dde1865362d42db/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("aarch64-unknown-linux-gnu")
OPT_LEVEL = Some("z")
HOST = Some("aarch64-unknown-linux-gnu")
CC_aarch64-unknown-linux-gnu = None
CC_aarch64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_aarch64-unknown-linux-gnu = None
CFLAGS_aarch64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fp,neon")
running: "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-Bstatic" "-lgfortran" "-lquadmath" "-o" "/home/ubuntu/src/github.com/samuela/rustybox/target/release/build/f128_internal-cd7ce17671f7d9fd/out/src/f128.o" "-c" "src/f128.c"
cargo:warning=src/f128.c:2:10: fatal error: quadmath.h: No such file or directory
cargo:warning=    2 | #include <quadmath.h>
cargo:warning=      |          ^~~~~~~~~~~~
cargo:warning=compilation terminated.
exit code: 1

--- stderr

error occurred: Command "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-Bstatic" "-lgfortran" "-lquadmath" "-o" "/home/ubuntu/src/github.com/samuela/rustybox/target/release/build/f128_internal-cd7ce17671f7d9fd/out/src/f128.o" "-c" "src/f128.c" with args "cc" did not execute successfully (status code exit code: 1).

warning: build failed, waiting for other jobs to finish...
error: build failed
samuela commented 4 years ago

Ah, looks like it's not able to find the right underlying headers from gcc. Do you have build-essential installed? I think that should do the trick...

eren123danyel commented 4 years ago

Ah, looks like it's not able to find the right underlying headers from gcc. Do you have build-essential installed? I think that should do the trick...

Hmm, sorry i'm also getting this error, but I have no idea how to get "build-essential" can you please explain this to me?

Edit: I'm on mac and after some searching around seems like I can't install it?

samuela commented 4 years ago

@eren123danyel Oh yeah, on macOS it'll be a bit different. Does brew install gcc work for you?

Akeboshiwind commented 4 years ago

Hey, I'm having the same issue. gcc was already installed so installing it wouldn't fix anything :/

Akeboshiwind commented 4 years ago

For anyone else on macOS a workaround is to just use docker:

$ docker run -v /Users/oliverm/prog/rustybox/:/usr/src/ -it rust:1.40 bash

And then in the docker container:

$ cd /usr/src
$ cargo build --release
samuela commented 4 years ago

Ok, hopefully b7d7f01 resolves the documentation part of this issue. Let me know if I'm missing anything!

Akeboshiwind commented 4 years ago

The only issue I'm having with the docker workaround is it not connecting with my editor :/. Maybe I'll build one specifically for that.

On Fri, 27 Dec 2019, 03:21 samuela, notifications@github.com wrote:

Ok, hopefully b7d7f01 https://github.com/samuela/rustybox/commit/b7d7f01bdff8a85dfb7dcf984999b82a8ba0757a resolves the documentation part of this issue. Let me know if I'm missing anything!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/samuela/rustybox/issues/8?email_source=notifications&email_token=ACD2NAW55JBSMLTJIG67OL3Q2VYEFA5CNFSM4JU7NDI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHWPENA#issuecomment-569176628, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD2NASD6KUHYSSPKIAU3JLQ2VYEFANCNFSM4JU7NDIQ .

samuela commented 4 years ago

@Akeboshiwind if you use vs code you can do the remote connection over docker extension. It's remarkably good. That's actually my standard dev workflow for this project.

Akeboshiwind commented 4 years ago

I'm an Emacs user actually and I was planning something similar.

Do you know what backend that uses?

On Fri, 27 Dec 2019, 16:33 samuela, notifications@github.com wrote:

@Akeboshiwind https://github.com/Akeboshiwind if you use vs code you can do the remote connection over docker extension. It's remarkably good. That's actually my standard dev workflow for this project.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/samuela/rustybox/issues/8?email_source=notifications&email_token=ACD2NARC7JMISGJ5BVBJEG3Q2YU6DA5CNFSM4JU7NDI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHXN3PI#issuecomment-569302461, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD2NARVHNKVYGLZNKNBOSTQ2YU6DANCNFSM4JU7NDIQ .

samuela commented 4 years ago

Oh well with emacs you could just run emacs within the container I suppose?

Not sure exactly what backend the VSCode extension uses. I'm guessing they built their own kinda thing that handles docker interop.

Akeboshiwind commented 4 years ago

That seems like a nice workflow. I'll have to see if I can replicate it some time.

atiabjobayer commented 1 year ago

Anyone found any solution to get quadmath.h on macOS other than the docker workaround? Any help would be much appreciated.