Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust SGX Example App Compilation Problem #6045

Closed
simplelins opened this issue Jul 13, 2020 · 3 comments · Fixed by #6067
Closed

Rust SGX Example App Compilation Problem #6045

simplelins opened this issue Jul 13, 2020 · 3 comments · Fixed by #6067

Comments

@simplelins
Copy link

simplelins commented Jul 13, 2020

I try to compile the demo " incubator-tvm/apps/sgx", but some error occured , that log show as below, i had tried to build at two machines, the same error showing:
cargo build warning: Patch backtrace v0.3.37 (https://github.com/nhynes/backtrace-rs?branch=fix-sgx#10569cb8)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run cargo update to use the new
version. This may also occur with an optional dependency that is not enabled.
Compiling libc v0.2.62
Compiling cc v1.0.45
Compiling proc-macro2 v0.4.30
Compiling unicode-xid v0.1.0
Compiling syn v0.15.44
Compiling memchr v2.2.1
Compiling autocfg v1.0.0
Compiling semver-parser v0.7.0
Compiling version_check v0.1.5
Compiling cfg-if v0.1.9
Compiling failure_derive v0.1.5
Compiling log v0.4.8
Compiling glob v0.3.0
Compiling autocfg v0.1.6
Compiling lazy_static v1.4.0
Compiling bitflags v1.1.0
Compiling rustc-demangle v0.1.16
Compiling maybe-uninit v2.0.0
Compiling byteorder v1.3.2
Compiling proc-macro2 v1.0.18
Compiling regex-syntax v0.6.12
Compiling quick-error v1.2.2
Compiling unicode-width v0.1.6
Compiling termcolor v1.0.5
Compiling ansi_term v0.11.0
Compiling bindgen v0.51.0
Compiling ryu v1.0.0
Compiling vec_map v0.8.1
Compiling unicode-xid v0.2.0
Compiling strsim v0.8.0
Compiling peeking_take_while v0.1.2
Compiling syn v1.0.34
Compiling arrayvec v0.4.11
Compiling either v1.5.3
Compiling shlex v0.1.1
Compiling matrixmultiply v0.1.15
Compiling nodrop v0.1.13
Compiling scopeguard v1.1.0
Compiling ndarray v0.12.1
Compiling serde v1.0.101
Compiling rawpointer v0.1.0
Compiling plain v0.2.3
Compiling static_assertions v0.3.4
Compiling itoa v0.4.4
Compiling sgx-demo v0.1.0 (/home/lww/project/03_TVM/incubator-tvm/apps/sgx)
Compiling semver v0.9.0
Compiling nom v4.2.3
Compiling nom v5.0.1
Compiling crossbeam-utils v0.7.2
Compiling memoffset v0.5.5
Compiling crossbeam-epoch v0.8.2
Compiling thread_local v0.3.6
Compiling humantime v1.3.0
Compiling num-traits v0.2.8
Compiling num-complex v0.2.3
Compiling textwrap v0.11.0
Compiling clang-sys v0.28.1
Compiling itertools v0.7.11
Compiling itertools v0.8.0
Compiling backtrace-sys v0.1.37
Compiling libloading v0.5.2
Compiling rustc_version v0.2.3
Compiling num_cpus v1.10.1
Compiling aho-corasick v0.7.6
Compiling quote v0.6.13
Compiling atty v0.2.13
Compiling scroll v0.9.2
Compiling lexical-core v0.4.6
Compiling fxhash v0.2.1
Compiling quote v1.0.2
Compiling clap v2.33.0
Compiling regex v1.3.1
Compiling cexpr v0.3.5
Compiling crossbeam-queue v0.2.3
Compiling crossbeam-channel v0.4.2
Compiling backtrace v0.3.41
Compiling crossbeam-deque v0.7.3
Compiling env_logger v0.6.2
Compiling synstructure v0.10.2
Compiling serde_json v1.0.40
Compiling crossbeam v0.7.3
Compiling scroll_derive v0.9.5
Compiling goblin v0.0.24
Compiling failure v0.1.5
Compiling which v2.0.1
Compiling serde_derive v1.0.101
Compiling old-tvm-macros v0.1.1 (/home/lww/project/03_TVM/incubator-tvm/rust/macros)
Compiling tvm-common v0.1.0 (/home/lww/project/03_TVM/incubator-tvm/rust/common)
error[E0277]: the trait bound *mut std::ffi::c_void: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:243:5
|
243 | pub data: *mut ::std::os::raw::c_void,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *mut std::ffi::c_void
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound *mut i64: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:251:5
|
251 | pub shape: *mut i64,
| ^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *mut i64
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound *mut i64: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:254:5
|
254 | pub strides: *mut i64,
| ^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *mut i64
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound *mut std::ffi::c_void: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:270:5
|
270 | pub manager_ctx: *mut ::std::os::raw::c_void,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *mut std::ffi::c_void
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound *const i8: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:348:5
|
348 | pub data: *const ::std::os::raw::c_char,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *const i8
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound *mut std::ffi::c_void: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:931:5
|
931 | pub sync_handle: *mut ::std::os::raw::c_void,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *mut std::ffi::c_void
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 6 previous errors

error[E0277]: the trait bound *const i8: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:348:5
|
348 | pub data: *const ::std::os::raw::c_char,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *const i8
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound *mut std::ffi::c_void: std::default::Default is not satisfied
--> /home/lww/project/03_TVM/incubator-tvm/rust/common/src/c_runtime_api.rs:931:5
|
931 | pub sync_handle: *mut ::std::os::raw::c_void,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for *mut std::ffi::c_void
|
= note: required by std::default::Default::default
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 6 previous errors

For more information about this error, try rustc --explain E0277.
error: could not compile tvm-common.

To learn more, run the command again with --verbose.

`

anyone can explain the reason,thanks

@tqchen
Copy link
Member

tqchen commented Jul 15, 2020

cc @jroesch @nhynes

@tqchen tqchen changed the title compiling error Rust SGX Example App Compilation Problem Jul 15, 2020
@nhynes
Copy link
Member

nhynes commented Jul 15, 2020

odd. builds fine for me. I just pulled and built:

% rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /oasis/.rustup

installed toolchains
--------------------

nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
--------------------------------------

wasm32-wasi
x86_64-fortanix-unknown-sgx
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.46.0-nightly (346aec9b0 2020-07-11)

I'm sure you can use an older nightly (but it has to be a nightly)

cd ~/incubator-tvm
mkdir build && cd build
cmake .. -DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9 -DUSE_LLVM=llvm-config-9
make -j8

then

cd ~/incubator-tvm/apps/sgx
cargo build

@simplelins
Copy link
Author

simplelins commented Jul 21, 2020

thanks for your reply, this question caused by clang-sys at that day,and restored after a few time. Sorry I'm replying so late.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants