Hi, I'm new to g95 and Fortran. I'm having a few problems linking. I
wrote a small test program to test linking to precompiled lapack blas
libraries I downloaded from the SciPy website:
I followed instructions from this thread:
Some compilers append a _ to subroutines, some append two __. Maybe this is the cause for linking problems. If so, either recompile lapack and blas with g95 or
look for some way to tell g95 to understand that.
> Hi, I'm new to g95 and Fortran. I'm having a few problems linking. I
> wrote a small test program to test linking to precompiled lapack blas
> libraries I downloaded from the SciPy website:
> I followed instructions from this thread:
> I then compile and link with the following commands:
> D:\Fortran\testblas>g95 -o testblas.exe testblas.f95 -llapack -
> lf77blas -lcblas -latlas -lg2c
C:\DOKUME~1\FI~1\LOKALE~1\Temp/ccuhPmhO.o:testblas.f95:(.text+0x1ee):
undefi
ned reference to `_dgemm'
if I leave out the -fno-underscoring then the error message becomes:
undefined reference to _dgemm_
so why doesn't -fno-leading-underscore suppress the leading
underscore?
Any ideas?
regards Albert
On Jun 29, 4:29 pm, John McFarland <john.mcfarl...@swri.org> wrote:
I am almost certain that your problem is not an underscore issue, but
a library/linking issue. The library g2c provides compatibility for
BLAS and LAPACK when linking with a C compiler. However, you are
linking with g95, which is not a C compiler, so you should not need to
link against g2c. I'm not too sure what the cblas library is, but it
sounds like it might be a C-interface to BLAS, in which case you
probably don't need to link it.
Then since your example only uses a BLAS routine, you should be able
to link with "-lblas". If you later add lapack routines to your code,
you could link with "-llapack -lblas".
John
On Jul 1, 11:55 pm, albert <acp...@freenet.de> wrote:
Thanks John for looking at this. I particularly wanted an optimised
Blas/Lapack library, I think the problem lies in the fact that I was
trying to use binaries that probably weren't compiled with g95.
Following the build instructions on the Atlas site to build the
libraries from scratch using g95 doesn't seem that straight forward
either.
Regards
Albert
On Jul 8, 6:03 pm, John McFarland <john.mcfarl...@swri.org> wrote:
> I am almost certain that your problem is not an underscore issue, but
> a library/linking issue. The library g2c provides compatibility for
> BLAS and LAPACK when linking with a C compiler. However, you are
> linking with g95, which is not a C compiler, so you should not need to
> link against g2c. I'm not too sure what the cblas library is, but it
> sounds like it might be a C-interface to BLAS, in which case you
> probably don't need to link it.
> Also are you doing this under cygwin? If so, the easiest thing would
> be to just install cygwin's own lapack library. When you install
> that, it will also give you a BLAS library. The installed files are
> listed here:http://cygwin.com/cgi-bin2/package-cat.cgi?file=lapack%2Flapack-3.0-5...
> Then since your example only uses a BLAS routine, you should be able
> to link with "-lblas". If you later add lapack routines to your code,
> you could link with "-llapack -lblas".
> John
> On Jul 1, 11:55 pm, albert <acp...@freenet.de> wrote:
> > Thank you, I tried reordering the libraries in the manner you suggest
> > but I still get the same error message: