CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

gfortran and LAPACK

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2009, 19:07
Default gfortran and LAPACK
  #1
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
hey

cany anybody tell me how i can install LAPACK with gfortran.... i have a code tht has lapack libararies used in it and i want to run it with gfortran..

kindly let me know step by step procedure... i will be very much grateful ...

kind regards
HaKu is offline   Reply With Quote

Old   November 27, 2009, 17:02
Default Lapack with gfortran
  #2
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 19
DoHander is on a distinguished road
You have 3 options:

1. Get a Linux, you will have all you need: gfortran, Blas, Lapack.
2. Use a Windows machine with Cygwin, when you install Cygwin make sure to check gfortran, Blas and Lapack. PROBABLY the most convenient solution for a Windows user.
3. Stand alone gfortran on a Windows machine. You must:
  • Download Lapack from http://www.netlib.org/lapack/ . I think the name is lapack.tgz
  • Go from your Command prompt to Lapack\Blas\SRC and write:
  • gfortran -c *.f
  • The above will compile BLAS
  • Now create the actual library:
  • ar rcs libblas.a *.o
  • Put libblas.a in a safe place
  • Go from your Command prompt to Lapack\SRC and write:
  • gfortran -c *.f
  • Now create the actual library:
  • ar rcs liblapack.a *.o
  • Put liblapack.a in the same place as libblas.a
4. Suppose you have a program named foo.f90 that will use Lapack, in order to compile this you will use (you must have libblas.a and liblapack.a in the same folder with your program):
gfortran foo.f90 libblas.a liblapack.a
or (not sure about the order)
gfortran foo.f90 liblapack.a libblas.a
5. You should end up with something like a.exe wich is your executable.


Happy number crunching.

Do
DoHander is offline   Reply With Quote

Old   November 28, 2009, 08:34
Default thanks
  #3
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
hey

thank you very very much for detailed answer..

one question.... after compiling BLAS u said to compile actualy library .... the command for that should i have to type it in SRC directory as well .. if not then where i need to write this command..

thanks once again.. i appreciate ur help.. was really lost in all this lapack and Blas installation..

cheers and have a good day
HaKu is offline   Reply With Quote

Old   November 28, 2009, 10:40
Default
  #4
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 19
DoHander is on a distinguished road
Lapack contains:

a few folders - one of them is SRC ( the source of Lapack) and one is Blas that contains himself a SRC (the source of Blas).

So, if you have Lapack on your C drive, for compiling Blas you will write your commands in:

C:\Lapack\Blas\src

and for compiling Lapack in

C:\Lapack\src

Do
DoHander is offline   Reply With Quote

Old   November 29, 2009, 21:29
Default ok
  #5
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
thanks a lot man .. i will do it.. if i run in any problem.. ill ask again.. i appreciate ur help

have a good day
HaKu is offline   Reply With Quote

Old   November 30, 2009, 12:33
Default
  #6
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
hey

i know tht my gfortran works properly as i am able to compile the programs from there and get the results..

but when i write this commond

gfortran -c *.f

it says tht gfortran is not recognised....thoug gfortran is there..

do u know whts going on??

kind regards
HaKu is offline   Reply With Quote

Old   November 30, 2009, 15:45
Default
  #7
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
i think i have somehow messed up with my gfortran.. whts the easiest way to install it as satand alone and not with cygwin...

kind regards
HaKu is offline   Reply With Quote

Old   November 30, 2009, 16:26
Default Link to gfortran
  #8
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 19
DoHander is on a distinguished road
http://quatramaran.ens.fr/~coudert/g...an-windows.exe
DoHander is offline   Reply With Quote

Old   December 1, 2009, 01:11
Default
  #9
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
thanks man... it is working now so will give the lapack installing a shot now..

regards
HaKu is offline   Reply With Quote

Old   December 1, 2009, 19:31
Default
  #10
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
hey

i have installed the lapack and i do see the two libariries so i think installation is done ok... do u have any small fortran program tht i can use to check if lapack is installed or not?? or any reference from where i can get a small code to check the installation.. thanks

kind regards
HaKu is offline   Reply With Quote

Old   December 29, 2010, 13:44
Default
  #11
Member
 
sarangarajan
Join Date: Sep 2009
Posts: 31
Rep Power: 16
sarajags_89 is on a distinguished road
Hey

Thanks!. It worked pretty well

Quote:
Originally Posted by DoHander View Post
You have 3 options:

1. Get a Linux, you will have all you need: gfortran, Blas, Lapack.
2. Use a Windows machine with Cygwin, when you install Cygwin make sure to check gfortran, Blas and Lapack. PROBABLY the most convenient solution for a Windows user.
3. Stand alone gfortran on a Windows machine. You must:
  • Download Lapack from http://www.netlib.org/lapack/ . I think the name is lapack.tgz
  • Go from your Command prompt to Lapack\Blas\SRC and write:
  • gfortran -c *.f
  • The above will compile BLAS
  • Now create the actual library:
  • ar rcs libblas.a *.o
  • Put libblas.a in a safe place
  • Go from your Command prompt to Lapack\SRC and write:
  • gfortran -c *.f
  • Now create the actual library:
  • ar rcs liblapack.a *.o
  • Put liblapack.a in the same place as libblas.a
4. Suppose you have a program named foo.f90 that will use Lapack, in order to compile this you will use (you must have libblas.a and liblapack.a in the same folder with your program):
gfortran foo.f90 libblas.a liblapack.a
or (not sure about the order)
gfortran foo.f90 liblapack.a libblas.a
5. You should end up with something like a.exe wich is your executable.


Happy number crunching.

Do
sarajags_89 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:31.