LAPACK linking...

This is a discussion on LAPACK linking... within the Tech Board forums, part of the Community Boards category; I have Linear Algebra PACKage, (LAPACK) installed in my computer as I had opted for it during installationof Linux RH8.0. ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    29

    LAPACK linking...

    I have Linear Algebra PACKage, (LAPACK) installed in my computer as I had opted for it during installationof Linux RH8.0. I need to use some of the routines in this package. These routines can be used along with fortran... I need to link the LAPACK when I compile the fortran program... It seems to be similar to linking the math.h files when I say
    cc filename.c -lm

    Can someone let me know how I can link the lapack routines to execute my fortran programs?

    Thanks in Advance...
    C.B.Ashesh,
    Hyderabad, India

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    29
    Hi Salem,

    It was very urgent for me to know the answer and I couldn't think of a better place to post...

    I read that I need to use g77 prog.f -ldxml,
    but that wouldn't work...

    Could u let me know of a forum like this one where fortran/numerical stuff are discussed?

    Ashesh
    C.B.Ashesh,
    Hyderabad, India

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    29
    Finally could compile my program that call LAPACK subroutines.

    To compile a program that calls LAPACK subroutines use "-llapacl" ie.,

    g77 filename.f -llapack

    If "BLAS" subroutines are also called, then use:

    g77 filename.f -llapack -lblas

    One more problem I faced during compiling is as follows:

    In "C" , we can include the files which contain the subroutines that we need by saying
    #include "filename.h"

    In fortran, I have not been able to use include statement. But we can compile by giving the path/file of all the files that have the subroutines.

    g77 filename.f /home/ashesh/fortran/file1.f /home/ashesh/fortran/file2.f -llapack

    is equivalent to including all the program which have the functions I need to call.
    C.B.Ashesh,
    Hyderabad, India

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems linking with g++
    By Just in forum Linux Programming
    Replies: 11
    Last Post: 07-24-2006, 02:35 AM
  2. strange linking error -- can not find shared library
    By George2 in forum C Programming
    Replies: 2
    Last Post: 07-10-2006, 11:51 PM
  3. Replies: 8
    Last Post: 04-27-2006, 11:39 AM
  4. Grrr.... SDL Linking Problem
    By 7EVEN in forum Game Programming
    Replies: 5
    Last Post: 08-12-2005, 09:44 PM
  5. Linking error with DirectDrawCreateEx
    By jjj93421 in forum Game Programming
    Replies: 6
    Last Post: 04-06-2004, 04:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21