flang-compiler / flang

Flang is a Fortran language front-end designed for integration with LLVM.
Other
798 stars 134 forks source link

Support for gfortran ABI ? #89

Open cournape opened 7 years ago

cournape commented 7 years ago

I built a recent master of flang and tried to build a non trivial piece of fortran code, scipy. The build went well, and I could even run some of the tests, but then the test suite crashes when calling BLASdotu function. I suspect this is because the default BLAS/LAPACK on my debian system is built with the gfortran ABI. Is there a way to control the ABI for emitted code by flang ?

friedc commented 1 year ago

Could you try out if including -fuse-ld=ld in the linker options solves the issue for you?

jeffhammond commented 1 year ago

I recommend just compiling BLAS/LAPACK with Flang. They are open-source. OpenBLAS and BLIS both accept a Fortran compiler argument if you want a high-performance BLAS library.

It is possible that BLIS does not yet know about the Flang ABI for DOT but that's a trivial bug to fix if it's reported (e.g. https://github.com/flame/blis/pull/637).

bryanpkc commented 1 year ago

Binaries and .mod files produced with Flang are not compatible with those produced with gfortran. You have to build the application and all libraries with the same toolchain.

vchuravy commented 1 year ago

Is there documentation on the Flange ABI? The original post mentioned scipy. Users like Julia and Python need to know the ABI in order to call fortran applications.

If the ABI is consistent with gfortran that makes our lives easier.

jeffhammond commented 1 year ago

At least part of it is described in https://releases.llvm.org/11.0.1/tools/flang/docs/Calls.html but I don't think that answers all the questions, in particular, the one here.