LAPACK as shared library with special name

Post here if you have a question about the installation process

LAPACK as shared library with special name

Postby Spiros » Sun May 29, 2011 10:17 am

Under a Unix environment I'd like to compile LAPACK as shared library, calling it libreflapack.so, and the attached BLAS also as shared library, calling it librefblas.so. How can I use cmake in order to do that? The reason of such a rename is that I want to let libblas.so and liblapack.so free for symbolic links to specific implementations.
Spiros
 
Posts: 1
Joined: Sun May 29, 2011 9:58 am

Re: LAPACK as shared library with special name

Postby admin » Tue May 31, 2011 4:35 am

You can use the cmake build and check the option BUILD_SHARED_LIB.
Once you got your .so libraries, move them where you want them, change they name, and update your LD_LIBRARY_PATH variable.
To compile use:
Code: Select all
gfortran -o myprog.exe myprog.f -L"directory where are my lib"  -lreflapack -lrefblas

Julie
admin
Site Admin
 
Posts: 502
Joined: Wed Dec 08, 2004 7:07 pm

Re: LAPACK as shared library with special name

Postby admin » Tue May 31, 2011 4:39 am

Otherwise it is also possible to overload a routine by adding it in the link after the library where the other one is defined.
For example, if you have your own DGESV routine (in a file let's say mydegesv.f), that has the same DGESV interface than the one in LAPACK
The following way to link and compile
Code: Select all
gfortran -c mydgesv.f
gfortran -o myprog.exe myprog.f  -llapack  mydgesv.o -lblas
should allow you to use your own dgesv routine.
It is not 100% guarantee but most of the time it works.
Julie
admin
Site Admin
 
Posts: 502
Joined: Wed Dec 08, 2004 7:07 pm


Return to Installation

Who is online

Users browsing this forum: No registered users and 2 guests