ChristianBelloni / complex-bessel-rs

Rust wrapper of the Fortran subroutines developed by D.E. Amos
MIT License
1 stars 1 forks source link

Compilation failed with gfortran 8.5.0 #3

Closed Renmusxd closed 1 month ago

Renmusxd commented 3 months ago

Attempting to compile this library on a remote machine running GNU Fortran (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22) failed with cargo error: empty search path given via '-l'

I recognize this is below the gcc version requirement in the README, but it failed only because in build.rs the following lines

let res = Command::new("gfortran")
    .arg("-print-file-name=libgfortran.a")
    .output()
    .unwrap()
    .stdout;

returned an empty string and rustc was passed -L ''. By manually replacing the above lines with println!("cargo:rustc-link-search=libgfortran.a"); compilation succeeded and as far as I can tell no further issues arose.

Weirdly, on the same machine the command appears to have the correct output:

> gfortran -print-file-name=libgfortran.a
libgfortran.a

Feel free to close this issue if needed, but having libgfortran.a as a fallback string in case of an empty response, or some error messages to clarify the issue and how to resolve it may be helpful.

Thanks for the library! It's been immensely useful.

ChristianBelloni commented 1 month ago

Heyyy, i'm really sorry for the delay, I've been swamped at work, as soon as possible I'll add a fallback in case of an empty string.

Thank you for the feedback!

ChristianBelloni commented 1 month ago

Fixed!