Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of IMSL Fortran Numerical Libraries with GFORTRAN COMPILER

Status
Not open for further replies.

lesaadmi

Technical User
Aug 29, 2012
11
MX
Hello,

a long time ago I used to program using MICROSOFT DEVELOPER STUDIO FORTRAN, and I used the IMSL Fortran Numerical Libraries to solve some numerical problems. Now I am using the GFORTRAN COMPILER, but I can not compile my script because I do not have the IMSL Fortran Numerical Libraries.

Is there any way to used the IMSL Fortran Numerical Libraries with the GFORTRAN COMPILER?
Are there any libraries similar to the IMSL Fortran Numerical Libraries for GFORTRAN COMPILER? If so, how can I used them?

I would appreciate any help.
 
Is there anyway to use IMSL Libraries? I think there might if you pay for it...right? I mean, IMSL library is a commercial product.

Other than that, you may want to look into using something like LAPACK.
 
Thank you very much for the quick answer, I will look into Lapack.
 
I have installed LAPACK and it seems I have created the libraries liblapack.a and libblas.a, Now I am trying to complile my script, but I receive the next message. What does it mean?

C:\Users\LESAADMI\Desktop\test>GFORTRAN test1.for liblapack.a libblas.a
liblapack.a(dgesvd.o):dgesvd.f:(.text+0x1e29): undefined reference to `dlamch_'
liblapack.a(dgesvd.o):dgesvd.f:(.text+0x1e43): undefined reference to `dlamch_'
liblapack.a(dlascl.o):dlascl.f:(.text+0x3a6): undefined reference to `dlamch_'
liblapack.a(dbdsqr.o):dbdsqr.f:(.text+0x31a): undefined reference to `dlamch_'
liblapack.a(dbdsqr.o):dbdsqr.f:(.text+0x334): undefined reference to `dlamch_'
liblapack.a(dlasq1.o):dlasq1.f:(.text+0x228): more undefined references to `dlam
ch_' follow
collect2: ld devolvió el estado de salida 1

The instalation was done wrong?
 
Well, I don't use LAPACK, but I do compile nowadays and use my own libraries, I am using g95.

To compile my program that uses functions/subroutines that belong to a library, I first pass the directory (via "-I" flag) to the compiler where I may have some include or module related files. Then, during the linking process, I pass the directory (via "-L" flag) where the actual libraries are (libapack.a, libblas.a in your case); when doing this last thing, though, you do not include the "lib" prefix or *.a extension when linking the library.

Things should look something like this:

g95 -I/path/to/include -c myprogram.f90 -o myprogram.o
g95 -L/path/to/lib -o myprogram.exe -lapack -lblas -lm

I added the math library for good measure.

 
oh, sorry...even in Windows, I work within cygwin...so, I did not know that in DOS, you have to spell the library's entire name.
 
Thank you very much you both, now I have running Lapack in windows.
Regards.
 
I have another need, now I would like to install the SLATEC library in Windows.
Any leads? Any advise?
 
I don't know what SLATEC is nor have I looked into it...but please, for the sake of clarity and future reference and search abilities, start another thread when you switch topics like that. Keeps things separate, cleaner, shorter and benefits everybody.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top