-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
When I compile OpenBLAS with NOFORTRAN=1 some LAPACK (e.g. dpotrf) routines are not available #1284
Comments
Most of the LAPACK functions in OpenBLAS are verbatim copies of the netlib reference implementation which happens to be written in FORTRAN, there is only a select few (in interface/lapack) that get replaced by C functions. (While these happen to include the portf functions, dgels and at least some of the larf variants are not reimplemented). So a NOFORTRAN=1 build will |
Thanks, for fast answer. My project is dynamic library with fPIC code. So I rebuid libgfortran and libquadmath (which are parts of gcc) from sources with forcing extra fPIC flag. Looks that this ld version 2.24(which have been released in ~2013 http://ftp.gnu.org/gnu/binutils/) is buggy. Version 2.25 is also buggy and has various patches during 2014-2015. During linkage of final shared library I received the similar problem to this issue: |
Does it exist plans to implement this functions in future? |
Not to my knowledge. The closest effort is probably ReLAPACK (which got added recently), but it reimplements only those functions for which a recursive algorithm seemed appropriate and still makes calls to regular LAPACK functions. |
In Ubuntu you need matching gcc and gfortran versions. Ones shipped with system are always good. You can not compile fortran files with C compiler (or java compiler or whatever) |
Or you can re-package static .a library using ar, syntax is much like tar. |
@burlachenkok There were changes to the format of the ELF object files in binutils 2.26 for x86-64 architectures. If you create object files with code from binutils 2.26 or later for x86-64 and if you try to use this object code with binutils 2.25 or earlier, then you will get the error
There are two ways to avoid this problem:
The changes to binutils-gdb were made in commit 56ce. The binutils-gdb changelog mentions the update. Note that the integer identifier of the new relocation type is 42 (0x2a, see |
@cconrads-scicomp Thanks for answer. If I will move to new version of binutils 2.26 or later then It will be fine in my dev machine to build library. But then will it be possible to loader with old version to load my shared library or no? |
You just need to assure same version of binutils is used throughout all build, and complete build happens on oldest system you are trying to target. |
Loading shared libraries should work irrespective of the binutils version used to create the library;
|
You need to build on old (even unpatched) system to have old glibc/pthread import (it versions symbols), in worst case after 10 years you will need to install -compat package for respective library. |
Maybe LATL https://github.com/langou/latl a C++ template implementation of LAPACK and BLAS can be used for the "missing" parts, if you are willing to add C++ code to your fortran-free project. |
From an unrelated discussion at lapack, there is also SLATE http://icl.utk.edu/slate/, also written in C++ |
martin-frbg mentioned converting LAPACK files with f2c. I noticed a clapack mentioned at netlib.org. Would that work with OpenBLAS? I'm looking for a Fortran free solution that might work with Android. I also ran across FLENS ( http://apfel.mathematik.uni-ulm.de/~lehn/FLENS/index.html ) which mentions a C++ version of LAPACK. Haven't had a chance to try it yet, but I'm wondering if that would provide an alternative option. |
You need to search yourself for functions you need. |
Depends on your needs - OpenBLAS itself does not require LAPACK. The CLAPACK from netlib is (an old version of) LAPACK converted with f2c so should work as long as you do not need any of the functions that were added to LAPACK in recent years. I have no experience with any of the C++ based projects mentioned above, but expect they will be reasonably complete (mhh... flens and slate appear to implement subsets of even the "old" LAPACK only as yet?) and probably offer at least C bindings. |
Recent discussions at Reference-LAPACK mentioned LAPACK++ https://bitbucket.org/icl/lapackpp and its possible integration into netlib, but this appears to be a C++ API similar to LAPACKE on top of the original FORTRAN code, not a rewrite. |
I'm trying right now to just bring in a single file (dgesv.c) from Here's my procedure:
When I do this, the symbols from I think I need to add |
But if anyone has an answer for how to build OpenBLAS with all of CLAPACK, that would be even better |
nothing in lapack-netlib gets compiled when NOFORTRAN=1, the cblas there is only present because it comes with the netlib Reference-LAPACK sources. |
That was very helpful, thank you! |
Dear @martin-frbg and all, I've just come across this issue when trying to build OpenBLAS for Android. Do I understand correctly that PR #3539 would add support for a number of additional symbols to pure CBLAS (without the need for Fortran)? That would be great! |
CBLAS should be complete as-is, what the PR would do is enable the LAPACK functions (where the canonical C interface is LAPACKE). What was discussed above for DGESV was just a dirty trick to get a single LAPACK function interfaced with OpenBLAS after converting it from Fortran to C. |
That looks awesome! Thanks for implementing this feature, can’t wait to use it! |
Hi,
I'd like to build complete version of openBlas with maximum support of lapack/blas routines without using gfortran in runtime.
When I'm building openBlas from:
develop branch from commit 50715e8
with specifying NOFORTRAN=1 in make command
In this circumstances I don't have several routines in the final static library. They are:
What is interesting this all symbols are defined if build withtout
NOFORTRAN=1
.Unfortunately I want to have OpenBlas library without dependencies in gfortran
The text was updated successfully, but these errors were encountered: