Lapack and blas Accelerate Framework MAC makefile

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

Lapack and blas Accelerate Framework MAC makefile

Postby danishgondal » Mon Jun 08, 2015 3:02 pm

I wish to compile Fortran source code which uses functions from LAPACK and BLAS. When I compile a single source code file e.g.

Code: Select all
gfortran -g -framework Accelerate test.f

it works.

However, I have many source code files which I want to compile through Makefile. When I modify my Makefile by adding:

Code: Select all
LDFLAGS= -framework Accelerate

(Not sure it is the right way but that's how someone seemed to do it) I get the error that the lapack function used inside is unrecognized.
Can someone tell me what modification to do in the makefile?

Here is the error I get:
Code: Select all
gfortran -g test.o  -o a.out
Undefined symbols for architecture x86_64:
  "_sgesv_", referenced from:
     _MAIN__ in test.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [a.out] Error 1

sgesv is the lapack subroutine being called which shall be included in veclib/accelerate framework
danishgondal
 
Posts: 1
Joined: Mon Jun 08, 2015 2:53 pm

Re: Lapack and blas Accelerate Framework MAC makefile

Postby admin » Tue Jun 09, 2015 11:28 pm

Looks like you are having an issue with your Makefile.
In the linking sequence you need -framework Accelerate

Code: Select all
gfortran -g test.o  -o a.out  -framework Accelerate
admin
Site Admin
 
Posts: 609
Joined: Wed Dec 08, 2004 7:07 pm


Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 2 guests