LAPACK/PETSC

Open discussion regarding features, bugs, issues, vendors, etc.

LAPACK/PETSC

Postby edf » Sat Dec 24, 2005 10:26 am

Hello! I have installed BLAS and LAPACK (libflapack.a) within PETSC-2.3.0 installation. Now I'm installing program which uses PETSC. But this program requires LAPACK to be pre installed. Can I use the one installed with PETSC (fblaslapack)? The program's makefile states:
LAPACKLIB = -llapack.

Could you please help? Thanks in advance!
edf
 
Posts: 3
Joined: Sat Dec 24, 2005 10:06 am

Postby Julien Langou » Sat Dec 24, 2005 1:05 pm

Can I use the one installed with PETSC (fblaslapack)?


Yes sure, this should work without any problem.

If the archive is named libflapack.a and is located in the directory LAPACKDIR then you'll need to give its location with an "-LLAPACKDIR"
and its name with an "-lflapack" (for libflapack.a)
So I assume the libflapack.a library is at the same place as the other PETSc libraries so you do not need to specify the -LLAPACKDIR (already done) and thus this:
Code: Select all
LAPACKLIB = -lflapack

should be ok

I do not know however what is libflapack.a, whether it includes a BLAS library or not, check if there is an libfblas.a in this case you certainly will need to add a "-lfblas" I guess...

(
you can read as well
http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=116
http://www-unix.mcs.anl.gov/petsc/petsc-as/documentation/installation.html#BLAS/LAPACK
)

Julien
Julien Langou
 
Posts: 734
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby edf » Sat Dec 24, 2005 1:33 pm

Julien! Thanks for your reply.

Yes,there is BLAS library libfblas.a.

in this case you certainly will need to add a "-lfblas" I guess...


Add here I assume (when linking LAPACK)?.. Or?..
pgm_driver: pgm_driver.o $(objfiles)
$(CC) -o $@ $^ $(LAPACKLIB)$(lobpcglibLDFLAGS)

Thanks again!
edf
 
Posts: 3
Joined: Sat Dec 24, 2005 10:06 am

Postby Julien Langou » Sat Dec 24, 2005 6:05 pm

I did not try but I would say:

in the definition of LAPACKLIB you add libflapack.a and libfblas.a
Code: Select all
LAPACKLIB = -lflapack -lfblas


I would put a space between $(LAPACKLIB) and $(lobpcglibLDFLAGS), although this might work without, I do not know what is $(lobpcglibLDFLAGS), I guess it's a kind of "-lm" in this case, it is fine after LAPACKLIB.

Note that if LAPACK has been compiled with the Fortran compiler then you'll certainly want to add a kind of "-lg2c" as well (-lg2c for g77/gcc for example, you put it at the end of the compilation line). Or more easily, you change $(CC) by $(F77) when you are making the executable.
If it's a C version of LAPACK then you should be fine with the $(CC).

And finally once everything is working, you certainly will want to have an optimized BLAS library instead of libfblas.a. See:
http://www.netlib.org/lapack/faq.html#1.9
http://www.netlib.org/lapack/faq.html#2.5
but that will be for after something's working.

Julien
Julien Langou
 
Posts: 734
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby edf » Sun Dec 25, 2005 12:49 pm

I decided to install LAPACK provided as RPM. And all works now. Julien, thanks for support!!
edf
 
Posts: 3
Joined: Sat Dec 24, 2005 10:06 am


Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests