JuliaParallel / ScaLAPACK.jl

Wrap ScaLAPACK in Julia
Other
7 stars 6 forks source link

How to install Scalapack #1

Open ViralBShah opened 9 years ago

ViralBShah commented 9 years ago

I wonder if there is an easy way to install scalapack on mac. Does it work through brew? It didn't work for me:

viral 06:15:50 (master) ~/repos/MPI.jl/test$ brew install homebrew/science/scalapack
==> Installing scalapack from homebrew/homebrew-science
Error: No available formula for veclibfort (dependency of scalapack)
Searching formulae...
Searching taps...

Cc: @staticfloat @tkelman

ViralBShah commented 9 years ago

Also, I do have MPI installed, and ideally, we want scalapack to link to the MPI used by MPI.jl and Julia's BLAS and LAPACK.

andreasnoack commented 9 years ago

I installed ScaLAPACK on my Mac with brew and it worked out of the box. I've seen the veclibfort occasionally and I think I removed and reinstalled all of gcc in brew to make it work, but I'm not sure I remember this correctly.

More generally, I don't know how the binary dependency should be setup here. I don't have much experience in this field so contributions would be very welcome on bindeps setup. However, so far I've been able to run this package on my Mac, julia.mit.edu and the SuperCloud cluster, but it has been necessary to adjust the path manually at each place.

ViralBShah commented 9 years ago

What was the exact command you used for scalapack install through brew?

ViralBShah commented 9 years ago

Ok - I got it now - but I get a libscalapack.a. Did you have to build the dynamic library yourself?

andreasnoack commented 9 years ago

No there is an option for shared libs, brew install scalapack --with-shared-libs

staticfloat commented 9 years ago

Apparently building the shared libraries breaks some of the tests? That doesn't sound good. Also note that the option --openblas isn't advertised, but it looks like if you run brew install scalapack --with-shared-libs --openblas it'll link against OpenBLAS instead of Accelerate.

andreasnoack commented 9 years ago

How does the linking of BLAS work here? How do you usually handle a dependency like this? Do we want to link our own BLAS? As @ViralBShah said, we'd probably also want to make sure that ScaLAPACK links to the same MPI as MPI.jl. Would that be doable with Homebrew.jl and setting some flags?

tkelman commented 9 years ago

Do we want to link our own BLAS?

Probably not, unless you also want to configure ScaLAPACK to use 64-bit integers and call the local BLAS routines via their renamed _64 names.

ViralBShah commented 9 years ago

Having packages use Julia's BLAS/LAPACK is something we have still to work on. There is an issue open somewhere. I think using a different BLAS is still ok, but a different MPI will be trouble.

The ideal thing would be - patched scalapack for 64-bit integers, link against libjuliampi.so from MPI.jl, and link against the BLAS/LAPACK from the julia build. I will try to get all this working with a regular Makefile first, and then we can figure out what to do with brew etc.

ViralBShah commented 9 years ago

@mlubin @iainnz @joehuchette Do you guys have a way to link your packages to the Julia BLAS/LAPACK?

tkelman commented 9 years ago

The only package where that has been done so far is SCS.jl: https://github.com/JuliaOpt/SCS.jl/blob/master/deps/build.jl

staticfloat commented 9 years ago

The way I built the bottles for SCS.jl is to leave the BLAS symbols left undefined, and to leave it up to the process the library is being linked into to provide the basic BLAS symbols. We then compiled two versions of the .dylib, one with a BLASSUFFIX and one without, and linked against the proper one depending on whether we're running a 32 or 64-bit julia. I think this basic procedure should work well for any dependency where we can set a BLASSUFFIX or similar.