-
Notifications
You must be signed in to change notification settings - Fork 16
v1.0.1 hangs during compilation of my program on CentOS 6 #8
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
Comments
Interesting, let me find a CentOS 6 machine to reproduce this with. Thanks for reporting the issue! |
It looks like the machine I found with CentOS 6 has too old a CPU to build some of the crates (ring), but I pulled out most of the dependencies to just try getting the build script and ISPC code to compile, and it does look to build the ISPC code successfully, but then fails to find a recent enough vpx version on the machine. Could you check if adding a print and/or exit from the build script here https://github.com/jvo203/fits_web_ql/blob/master/build.rs#L17 gives you some output? Since it hangs, maybe do an abort there, and let me know if it prints? The build script to test could look like: extern crate bindgen;
extern crate ispc;
extern crate metadeps;
use std::process;
use std::env;
use std::path::PathBuf;
fn main() {
let mut cfg = ispc::Config::new();
cfg.optimization_opt(ispc::opt::OptimizationOpt::FastMath);
cfg.addressing(ispc::opt::Addressing::A32);
let ispc_files = vec!["src/fits.ispc"];
for s in &ispc_files[..] {
cfg.file(*s);
}
cfg.compile("spmd");
println!("cargo:warning=Done compiling ISPC");
std::process::exit(1);
// rest of script
} |
As per your reply the develop branch of build.rs now contains on CentOS 6 the compilation hangs indefinitely without printing "Done compiling ISPC": Compiling fits_web_ql v4.1.0 (/mnt/data/chris/projects/fits_web_ql) Compiling actix v0.7.9 replacing ispc = "*" with ispc = "0.3.8" in Cargo.toml fixes the problem immediately: [chris@capricorn fits_web_ql]$ git pull error: failed to run custom build command for --- stderr There seems to be something inherently different between 0.3.8 and the newer version 1.0.X ... |
After cloning ispc-rs to a local folder on CentOS 6 I've used git bisect to help narrow down the source of the problem. Here is the full output. Hope it helps! Our other CentOS 6 server is a production server so definitely it would help if a fix can be found. For the time being the ispc-rs version has been downgraded to 0.3.8 in the master branch of fits_web_ql. [chris@capricorn ~]$ cd projects/ispc-rs/
:100644 100644 2df45f0e35fa980b3e3cc2e379a707d74da9f1a7 cf19ebc8dc96f67c4ee7b558d252e4de0d4e7031 M Cargo.toml |
The bisect helps a lot, thank you for doing it! I'm wondering if the issue is maybe that the bindgen libraries used by ispc-rs and your project are conflicting somehow? In the bad commit (76818f5#diff-29c19683a99ab5fee09f5429920200e5R28) the only real change is updating the dependencies. I updated to use bindgen 0.47.0, though in your project's Cargo.toml it takes any version, so it may be using some older version and conflicting? Would you mind trying to build on 1.0.2 again after doing a If that doesn't work I'll look at getting some of the out of date dependencies updated on our CentOS 6 machine to reproduce the build. As a note, I am able to build the ispc-rs examples on the CentOS 6 machine we have. |
I do "cargo update" on a regular basis. Re-setting the local ispc-rs repository to 1.0.2 and doing "cargo update" on fits_web_ql does not help, the build hangs indefinitely. The CentOS 6 is up-to-date. The only exception is the kernel version, kept at 3.10 for KNC Xeon Phi compatibility. [chris@capricorn ispc-rs]$ cat /etc/redhat-release [chris@capricorn ispc-rs]$ ldd --version [chris@capricorn ispc-rs]$ uname -a [chris@capricorn fits_web_ql]$ cargo update ^C Building [=====================================================> ] 353/355: fits_web_ql(build) |
I manually edited Cargo.toml in the local ispc-rs repository version 0.3.8. Changing bindgen from 0.43 to 0.47 is the single cause of the freezes. But why would that be a problem on CentOS 6 if it does not cause any problems on other platforms (CentOS 7 is OK too)? I always use "cargo update" to keep everything up to date, the Rust version is 1.32. [package] [dependencies] |
Interesting, it seems to not be a version conflict but some issue in bindgen on CentOS 6? Reverting to bindgen 0.43 would be fine with me, I've just been updating it with new releases to keep on the latest version, but the changes from 0.43 to 0.47 (partly listed in https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md#0470) shouldn't make a big difference for generating the ispc bindings. Thanks for helping to track this issue down! If you have some more time and find the latest bindgen after 0.43 which doesn't hang let me know and I'll update to that version, otherwise I'll stick with 0.43 |
Could it be caused by this bindgen change (Update clang-sys #1489)? Anyway, out of sheer curiosity I will try git-bisecting rust-bindgen to see what might be causing the problem. It is very perplexing... v0.43.2 works OK (pulled by ispc-rs 0.3.8). |
Have git-bisected rust-bindgen. Indeed the problem can be traced to (Update clang-sys #1489) rust-lang/rust-bindgen#1489 Bad commit: rust-lang/rust-bindgen@271dc73 [chris@capricorn rust-bindgen]$ git bisect start
:100644 100644 dae460fd65e054493f59000002c7373eda1f9873 47927a6a9c196b7df5f5e29cb81ac0bb178c7e8a M Cargo.lock |
Interesting, I wonder if the "load functions until the version can be determined" mentioned in the PR for that commit is what's causing the hang, and somehow it gets into some infinite loop trying to do this or fails to determine the version. It looks like that commit is part of 0.47, so 0.46 should be ok. I'll update ispc-rs to use 0.46, thanks again for your help tracking this down! |
Could you try out ispc 1.0.3 and let me know if that resolves the hang for you? You may also want to explicitly pick the bindgen version you're using in your Cargo.toml to also be 0.46.0 |
Setting ispc = "*" together with the latest version of your crate now leads to a successful compilation on CentOS 6 without any hanging. Thank you. I guess bindgen and/or clang-sys developers should be made aware of this issue. |
That's good to hear! I wonder what changed in clang-sys to cause it, the load symbols change doesn't seem like it would cause a hang, but I'm not sure. I'll close this issue, thanks again for your help debugging this! |
The previous version 0.3.8 works on CentOS 6, 7, macOS and Ubuntu 18.04 without a hitch. The new version hangs (without any error messages) when called from the build.rs on two separate machines running CentOS 6. All other systems (including CentOS 7) are OK. Downgrading ispc-rs to 0.3.8 in Cargo.toml fixes the problem. The ispc binary is present on my PATH:
ispc --version
Intel(r) SPMD Program Compiler (ispc), 1.9.2 (build commit 417b33ee4ab6ef78 @ 20171111, LLVM 5.0)
This is the initial part of build.rs. For the full source code please see https://github.com/jvo203/fits_web_ql
extern crate bindgen;
extern crate ispc;
extern crate metadeps;
use std::env;
use std::path::PathBuf;
fn main() {
let mut cfg = ispc::Config::new();
cfg.optimization_opt(ispc::opt::OptimizationOpt::FastMath);
cfg.addressing(ispc::opt::Addressing::A32);
let ispc_files = vec!["src/fits.ispc"];
for s in &ispc_files[..] {
cfg.file(*s);
}
cfg.compile("spmd");
(...)
The text was updated successfully, but these errors were encountered: