ChristianBelloni / complex-bessel-rs

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

Failed to build on Arch linux (wsl) #4

Open seanxnie opened 2 weeks ago

seanxnie commented 2 weeks ago

Hi, I encountered a building error on Arch linux (wsl): Compiling complex-bessel-rs v1.2.1 (/home/user/complex-bessel-rs-master) error: empty search path given via-L` error: could not compile complex-bessel-rs (lib) due to 1 previous error I found out that it happened during invokinggfortrancommand and may be caused by the missinglibstdc++-static` library. However, I can't figure out how to install and test this scheme in Arch. Kindly request to solve this issue.

ChristianBelloni commented 2 weeks ago

Hi, thanks for the feedback, just a couple of questions. What version of complex-bessel are you running? i pushed an update a couple of weeks ago and i'd like to know if maybe that messed some things up. can you run gfortran -print-file-name=libgfortran.a and comment here what's the output?

seanxnie commented 2 weeks ago

Thank you for the reply. I used the latest one just pulled for github few days ago. However, when I tried gfortran -print-file-name=libgfortran.a command, the output from different platforms was inconsistent. In my Arch WSL (Windows subsystem on Linux), the output was just libgfortran.a, meaning that the path variable was just empty. That explained why. In my Solus VM with gfortran installed, and Window 10 with quickstart fortran installed, the command returned the full path. And therefore, the compilation was successful. The error is more likely caused by WSL, or maybe Arch Linux itself. The command can't guarantee consistent result on different platforms.

seanxnie commented 2 weeks ago

Solved. Please use gfortran -print-file-name=libgfortran.so instead of gfortran -print-file-name=libgfortran.a in the build.rs file. since libgfortran.a is not available in Arch.

ChristianBelloni commented 2 weeks ago

Hi, thank you for the quick reply, I'm not really sure that's correct, so files are s hared o bjects used for dynamic linking, a files are used for static linking. The only thing I can think of is to skip adding the path to the search paths if it's empty since your distribution of fortran seems to resolve correctly its std lib, as soon as I get home I'll push a fix, please let me know if that corrects your issue

seanxnie commented 2 weeks ago

I appreciate your help! I also find an issue in Windows (10) platform: when linking with gfortran -print-file-name=libgfortran.a command from Quickstart Fortran, the complex-bessel-rs crate was compiled successfully, but my rust program failed with an linking error code note: LINK : fatal error LNK1181: cannot open input file 'gfortran.lib'. Please let me know whether you encountered this issue before. Maybe I choose the wrong Fortran compiler on Windows.

ChristianBelloni commented 2 weeks ago

Hi, no I'm sorry, never encountered before and unfortunately I don't have a working windows PC to test it on, this weekend I'll see if I can test it on GH actions

seanxnie commented 1 week ago

Thank you so much!