undefined gfortran references when compiling with g77
ello
Using openSUSE 10.1 32-bit on AMD 165 Opteron Dual Core. Have compat-g77 3.3.5-2, gcc 4.1.0-25 and gcc-fortran 4.1.0-25. I'm trying to compile a program that makes use of the lapack libraries (for linear algebraic operations). So when I compile, the command line looks like this: # g77 program.f -L/usr/lib -lgfortran -llapack -lblas However, I get these error messages: # /usr/lib/liblapack.so: undefined reference to `_gfortran_filename' # /usr/lib/liblapack.so: undefined reference to `_gfortran_ioparm' # /usr/lib/liblapack.so: undefined reference to `_gfortran_line' And I do not understand what is going on. Anyone happen to run into this problem as well? Thanks. |
I'm trying to do almost exactly the same thing, with the same result.
Only difference is that if I include the -lblas or -lgfortran flags I get the error "/usr/bin/ld: cannot find -lgfortran" (or -lblas). My command is g77 lptest.f -o lpout.exe -L/usr/lib -llapack The output is a bunch of these lines: /usr/lib/liblapack.a(ATL_sgetrs.o)(.text+0xcf): In function `ATL_sgetrs': : undefined reference to `cblas_strsm' Any ideas? I've only ever done some basic coding, never anything with libraries, so I don't know how to do this kind of thing. Thanks... -Mark |
Studmuffin, it looks like your LAPACK was compiled with gfortran and you're trying to compile with g77. Try compiling program.f with gfortran instead and see what happens. Another option is to use the ACML library for BLAS and LAPACK functions.
MALDATA, you answered your own question, the linker can't find the libraries -> /usr/bin/ld: cannot find -lgfortran" (or -lblas). |
I found someone who knows what he's doing and he got me all set up. I just didn't know that the LAPACK libraries also called BLAS and ATLAS... so to get it to work I need -llapack, -lf77blas, and -latlas flags. I assumed that calling -llapack would implicitly include whatever other libraries it needs.
So, next time this happens, is there any way to figure out ALL the libraries I need to specify, or should I just keep googling errors until I figure it out? Thanks for the help -Mark |
Quote:
|
All times are GMT -5. The time now is 07:13 AM. |