CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   gfortran and LAPACK (http://www.cfd-online.com/Forums/main/70450-gfortran-lapack.html)

HaKu November 24, 2009 20:07

gfortran and LAPACK
 
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

DoHander November 27, 2009 18:02

Lapack with gfortran
 
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

HaKu November 28, 2009 09:34

thanks
 
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

DoHander November 28, 2009 11:40

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

HaKu November 29, 2009 22:29

ok
 
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 November 30, 2009 13:33

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 November 30, 2009 16:45

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

DoHander November 30, 2009 17:26

Link to gfortran
 
http://quatramaran.ens.fr/~coudert/g...an-windows.exe

HaKu December 1, 2009 02:11

thanks man... it is working now so will give the lapack installing a shot now..

regards

HaKu December 1, 2009 20:31

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

sarajags_89 December 29, 2010 14:44

Hey

Thanks!. It worked pretty well

Quote:

Originally Posted by DoHander (Post 238003)
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



All times are GMT -4. The time now is 14:38.