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

Add include path to Rust build script #6765

Closed
wants to merge 1 commit into from

Conversation

gussmith23
Copy link
Contributor

@jroesch

I'm not sure what we want to do here. I needed to add this path to make the build script work on my system -- perhaps there's something I should do on my side, though?

@tkonolige
Copy link
Contributor

tkonolige commented Oct 26, 2020

Could you post the error message you get when building?

I don't think we should hardcode a path like this.

@gussmith23
Copy link
Contributor Author

gussmith23 commented Oct 28, 2020

error: failed to run custom build command for `tvm-sys v0.1.0 (https://github.com/apache/incubator-tvm?branch=main#4c4888bc)`

Caused by:
  process didn't exit successfully: `/home/gus/glenside-evaluation/target/debug/build/tvm-sys-6e86f41bfc277513/build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=TVM_HOME
  cargo:rustc-link-lib=dylib=tvm
  cargo:rustc-link-search=/home/gus/tvm/build

  --- stderr
  /home/gus/tvm/3rdparty/dlpack/include/dlpack/dlpack.h:30:10: fatal error: 'stddef.h' file not found
  /home/gus/tvm/3rdparty/dlpack/include/dlpack/dlpack.h:30:10: fatal error: 'stddef.h' file not found, err: true
  Error: failed to generate bindings

Yeah, I agree that it doesn't make sense to hardcode it here. I'm having a hell of a time resolving this on one of our machines, and I have to assume it's because of how the machine is configured. We have stddef.h (multiple, in fact) but I have no idea which toolchain rust is trying to use here, so I don't know which one it's failing to find.

It seems to be happening in bindgen, and there's a running thread about issues like this: rust-lang/rust-bindgen#1226. It seems like it's not actually an issue on their side, but it's common when using bindgen.

@tkonolige
Copy link
Contributor

tkonolige commented Oct 28, 2020

Have you tried specifying LLVM_CONFIG_PATH to point to your llvm install?

@gussmith23
Copy link
Contributor Author

Yes, it's set! I think I was getting a different error before I realized I needed to set that.

@tqchen tqchen closed this Oct 28, 2020
@tqchen
Copy link
Member

tqchen commented Oct 28, 2020

Closing, glad that the problem is resolved

@gussmith23
Copy link
Contributor Author

Oops, this problem isn't resolved! Sorry, didn't mean to imply that. I had already set LLVM_CONFIG_PATH before getting this error.

@tqchen
Copy link
Member

tqchen commented Oct 28, 2020

In this case it is indeed versy strange that stddef is not part of your include path, how about you add it to your CPLUS_INCLUDE_PATH and C_INCLUDE_PATH env variable in your system?

@gussmith23
Copy link
Contributor Author

gussmith23 commented Nov 3, 2020 via email

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 this pull request may close these issues.

3 participants