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

Reuse OpenBLAS installation from Julia distribution #16

Closed
jiahao opened this issue Oct 13, 2015 · 8 comments
Closed

Reuse OpenBLAS installation from Julia distribution #16

jiahao opened this issue Oct 13, 2015 · 8 comments

Comments

@jiahao
Copy link
Contributor

jiahao commented Oct 13, 2015

Currently, PETSc.jl fails to build PETSc on a Linux system without a BLAS package installed at the system level.

Instead, it would be preferable to reuse the OpenBLAS or MKL BLAS installation that comes with Julia, especially if Julia is built from source.

It looks like the relevant ./configure options are

BLAS/LAPACK:
  --with-blas-lib=<libraries: e.g. [/Users/..../libblas.a,...]>
       Indicate the library(s) containing BLAS
  --known-64-bit-blas-indices=<bool>
       Indicate if using 64 bit integer BLAS  current: 0
@jiahao
Copy link
Contributor Author

jiahao commented Oct 13, 2015

Although it looks like the name mangling we do on 64-bit platforms makes it impossible for PETSc to understand.

For reference, the Ubuntu packages needed are installed by apt-get install libopenblas-dev liblapack-dev

PETSc's ./configure script appears to know if it's being run from a script and emits no messages...

@stevengj
Copy link
Contributor

@jedbrown, would PETSc be open to a patch to use a BLAS library with mangled names?

In particular, Julia compiles BLAS with a 64-bit integer interface (instead of the default 32-bit integer API), and to avoid conflicts with other BLAS libraries (when libraries using a 32-bit BLAS are loaded) we rename both the the library (to libopenblas64_.so) and the symbols (by appending 64_, e.g. dgemm64_).

It would be nice to be able to compile PETSc to use the 64-bit BLAS as well, and similarly to link the mangled symbols. This looks easy to do, since petscblaslapack_c.h already defines macros for all of the BLAS and LAPACK symbols.

@stevengj
Copy link
Contributor

(See also OpenMathLib/OpenBLAS#646)

@jedbrown
Copy link

jedbrown commented Nov 18, 2015 via email

@stevengj
Copy link
Contributor

They are specific to Julia. As far as we can tell, there are no common ABI conventions for the 64-bit BLAS, and the situation is something of a mess. (See the linked OpenBLAS discussion and also JuliaLang/julia#4923.)

Basically you should support adding an arbitrary suffix/prefix to the BLAS and LAPACK symbols, maybe as configure options, along with an arbitrary path to the libraries.

@stevengj
Copy link
Contributor

Correction: the 64_ suffix is also used by the 64-bit SunPerf BLAS, apparently.

@nalimilan
Copy link

And now that 64_ suffix is also used by a Fedora/EPEL OpenBLAS package.

@stevengj
Copy link
Contributor

I've started a PETSc PR: https://bitbucket.org/petsc/petsc/pull-requests/394

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

No branches or pull requests

5 participants