Thread Closed

LAPACK for Fortran under Cygwin

 
Share Thread
Dec7-09, 12:59 AM   #1
 

LAPACK for Fortran under Cygwin


I just installed LAPACK, but I'm not sure how to use it. The documentation tells about the routines, but the problem is my compiler isn't recognizing them.

For example...I wrote a simple Fortran program to test a routine (SGESV):

Code:
      program testlapack
          implicit  none

          integer N
          parameter(N=10)
          integer NRHS
          parameter(NRHS=1)
          integer LDA
          parameter(LDA=10)
          integer IPIV(N)
          integer LDB
          parameter(LDB=N)
          real A(LDA,N)
          real B(LDB,NRHS)
          integer INFO
          external SGESV

          call SGESV(N,NRHS,A,LDA,IPIV,B,LDB,INFO)

       end
Then I compile in and it fails...

Code:
$ g77 -ff90 -o test test.for 
/cygdrive/c/Users/david/AppData/Local/Temp/ccU0lt1W.o:test.for:(.text+0x4e): undefined reference to `_sgesv_'
collect2: ld returned 1 exit status
Is there something line an "include" or "use" statement that I have to include in my code file so the compiler will recognize these LAPACK routines?

Thanks.
PhysOrg.com science news on PhysOrg.com

>> Leading 3-D printer firms to merge in $403M deal (Update)
>> LA to give every student an iPad; $30M order
>> CIA faulted for choosing Amazon over IBM on cloud contract
Dec7-09, 02:15 AM   #2
 
I seem to have found a solution by specifying a linker flag:

Code:
$ g77 -ff90 -o test test.for -llapack
Dec7-09, 03:01 AM   #3
 
Recognitions:
Science Advisor Science Advisor
Yup, that's how you link to a library.
Thread Closed

Similar discussions for: LAPACK for Fortran under Cygwin
Thread Forum Replies
Cygwin, why does my lab recommend to NOT use it? Math & Science Software 15
Fortran - Cygwin, gfortran and emacs! Programming & Comp Sci 6
Accessing Fortran Modules within a Fortran library from Fortran Programming & Comp Sci 0
Cygwin specific package to installl SSH Computing & Technology 2
Cygwin Computing & Technology 1