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

Incorrect parse result for raw archive path #135

Closed
termoshtt opened this issue Aug 3, 2022 · 3 comments · Fixed by #134
Closed

Incorrect parse result for raw archive path #135

termoshtt opened this issue Aug 3, 2022 · 3 comments · Fixed by #134

Comments

@termoshtt
Copy link

intel-mkl package in ArchLinux provides a pkg-config result:

$ pkg-config --libs mkl-static-lp64-seq
-Wl,--start-group /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/mkl/lib/intel64/libmkl_sequential.a /opt/intel/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl 

Also, intel-mkl package in Debain non-free repository also returns similar result (install directory is different):

$ pkg-config --libs mkl-static-lp64-seq
-Wl,--start-group /usr/lib/x86_64-linux-gnu/libmkl_intel_lp64.a /usr/lib/x86_64-linux-gnu/libmkl_sequential.a /usr/lib/x86_64-linux-gnu/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl

However, this crate fails to parse this output:

fn main() {
    let lib = pkg_config::Config::new()
        .probe("mkl-static-lp64-seq")
        .unwrap();
    println!("{:?}", lib);
}
[dependencies]
pkg-config = "0.3.25"
$ cargo run        
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/pkg-config-test`
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_STATIC
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=SYSROOT
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_STATIC
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rustc-link-lib=pthread
cargo:rustc-link-lib=m
cargo:rustc-link-lib=dl
cargo:rustc-link-arg=-Wl,--start-group
cargo:rustc-link-arg=-Wl,--end-group
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_STATIC
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
Library { libs: ["pthread", "m", "dl"], link_paths: [], frameworks: [], framework_paths: [], include_paths: ["/opt/intel/mkl/include"], ld_args: [["--start-group"], ["--end-group"]], defines: {}, version: "2020", _priv: () }

This should includes three archives shown in original pkg-config mkl-static-lp64-seq command

  • /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a
  • /opt/intel/mkl/lib/intel64/libmkl_sequential.a
  • /opt/intel/mkl/lib/intel64/libmkl_core.a
@sdroege
Copy link
Collaborator

sdroege commented Aug 9, 2022

I think this is solved by #134 . Can you confirm?

@termoshtt
Copy link
Author

Using latest commit in #134

[dependencies]
pkg-config = { git = "https:/Be-ing/pkg-config-rs.git", branch = "library_file_paths" }

Then the above code generated following:

$ cargo run                                                            
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/pkg-config-test`
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_STATIC
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=SYSROOT
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_STATIC
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rustc-link-lib=pthread
cargo:rustc-link-lib=m
cargo:rustc-link-lib=dl
cargo:rustc-link-search=/opt/intel/mkl/lib/intel64
cargo:rustc-link-lib=mkl_intel_lp64
cargo:rustc-link-search=/opt/intel/mkl/lib/intel64
cargo:rustc-link-lib=mkl_sequential
cargo:rustc-link-search=/opt/intel/mkl/lib/intel64
cargo:rustc-link-lib=mkl_core
cargo:rustc-link-arg=-Wl,--start-group
cargo:rustc-link-arg=-Wl,--end-group
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_STATIC
cargo:rerun-if-env-changed=MKL_STATIC_LP64_SEQ_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
Library { libs: ["pthread", "m", "dl"], link_paths: [], frameworks: [], framework_paths: [], include_paths: ["/opt/intel/mkl/include"], ld_args: [["--start-group"], ["--end-group"]], defines: {}, version: "2020", _priv: () }

The static libraries ignored above are now included correctly, i.e. #134 will also resolve this issue.

@sdroege sdroege linked a pull request Aug 9, 2022 that will close this issue
@Be-ing
Copy link
Contributor

Be-ing commented Oct 26, 2022

@termoshtt please test the new 0.3.26 release.

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