Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
problem linking to lapack atlas
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
albert  
View profile  
 More options Jun 28 2009, 11:00 am
From: albert <acp...@hotmail.com>
Date: Sun, 28 Jun 2009 08:00:10 -0700 (PDT)
Local: Sun, Jun 28 2009 11:00 am
Subject: problem linking to lapack atlas
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:

http://groups.google.as/group/gg95/browse_thread/thread/62f346a53e9c3...

The libraries I found here:

http://www.scipy.org/Installing_SciPy/Windows#head-cd37d819e333227e32...

The following is my test code:

program testblas

external DGEMM

integer, parameter :: rd = SELECTED_REAL_KIND(15,307)
real(kind=rd),dimension(2,2)  ::  a,b,c
c=0.0
a(1,1)=1.1
a(1,2)=1.3
a(2,1)=1.7
a(2,2)=1.5

b(1,1)=1.6
b(1,2)=1.7
b(2,1)=1.8
b(2,2)=1.3

call DGEMM ( 'n','n', 2, 2, 2, 1.0_rd, a, 2, b, 2, 0.0_rd, c, 2 )

print*, c

end program testblas

I then compile and link with the following commands:
D:\Fortran\testblas>g95 -o testblas.exe testblas.f95 -llapack -
lf77blas -lcblas -latlas -lg2c

However I get the following error message:

D:\Fortran\testblas>g95 -o testblas.exe testblas.f95 -llapack -
lf77blas -lcblas
-latlas -lg2c
c:/programme/g95/bin/../lib/gcc-lib/i686-pc-mingw32/4.0.4//libg2c.a
(main.o):(.te
xt+0x38): undefined reference to `_MAIN__'

The libraries are in the lib directory of my g95 installation. the
paths are set.

I'm using i686-pc-mingw32 4.0.4

Any ideas anyone?

Best regards

Albert


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adelson Santos de Oliveira  
View profile  
 More options Jun 28 2009, 5:01 pm
From: Adelson Santos de Oliveira <adelson.olive...@gmail.com>
Date: Sun, 28 Jun 2009 18:01:32 -0300
Local: Sun, Jun 28 2009 5:01 pm
Subject: Re: problem linking to lapack atlas
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.

albert escreveu:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John McFarland  
View profile  
 More options Jun 29 2009, 10:29 am
From: John McFarland <john.mcfarl...@swri.org>
Date: Mon, 29 Jun 2009 07:29:14 -0700 (PDT)
Local: Mon, Jun 29 2009 10:29 am
Subject: Re: problem linking to lapack atlas
On Jun 28, 10:00 am, albert <acp...@hotmail.com> wrote:

> D:\Fortran\testblas>g95 -o testblas.exe testblas.f95 -llapack -
> lf77blas -lcblas
> -latlas -lg2c
> c:/programme/g95/bin/../lib/gcc-lib/i686-pc-mingw32/4.0.4//libg2c.a
> (main.o):(.te
> xt+0x38): undefined reference to `_MAIN__'
> Any ideas anyone?

> Best regards

> Albert

Try using different orderings of the libraries.  Also what happens if
you leave off -lg2c?  Do you need -lcblas?

John


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
albert  
View profile  
 More options Jun 30 2009, 2:21 am
From: albert <acp...@freenet.de>
Date: Mon, 29 Jun 2009 23:21:14 -0700 (PDT)
Local: Tues, Jun 30 2009 2:21 am
Subject: Re: problem linking to lapack atlas
Thanks John and Albert,

still no success in getting this to work.  I tried the following:

>g95 -fno-leading-underscore -fno-underscoring -o testblas testblas.f95  -lf77blas -latlas

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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
李波  
View profile  
 More options Jul 1 2009, 1:50 am
From: "李波" <libo...@sohu.com>
Date: Wed, 1 Jul 2009 13:50:59 +0800
Local: Wed, Jul 1 2009 1:50 am
Subject: Re: Re: problem linking to lapack atlas

Dear albert

  I think you can change the order of your link-libraries. Because f77blas is the basic
library, so it must be put the last position. Maybe you try:

g95 -fno-leading-underscore -fno-underscoring -o testblas testblas.f95  -latlas -lf77blas

2009-07-01

李波

发件人: albert
发送时间: 2009-06-30  14:21:22
收件人: gg95
抄送:
主题: Re: problem linking to lapack atlas

Thanks John and Albert,
still no success in getting this to work.  I tried the following:

>g95 -fno-leading-underscore -fno-underscoring -o testblas testblas.f95  -lf77blas -latlas

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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
albert  
View profile  
 More options Jul 2 2009, 12:55 am
From: albert <acp...@freenet.de>
Date: Wed, 1 Jul 2009 21:55:31 -0700 (PDT)
Local: Thurs, Jul 2 2009 12:55 am
Subject: Re: problem linking to lapack atlas
Thank you, I tried reordering the libraries in the manner you suggest
but I still get the same error message:

C:\DOKUME~1\FI~1\LOKALE~1\Temp/cc8Ln7JK.o:testblas2.f95:(.text+0x13d):
undef
ined reference to `_dgemm'

maybe these libraries aren't compatible with g95.

Regards  Albert

On Jul 1, 7:50 am, "李波" <libo...@sohu.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John McFarland  
View profile  
 More options Jul 8 2009, 12:03 pm
From: John McFarland <john.mcfarl...@swri.org>
Date: Wed, 8 Jul 2009 09:03:11 -0700 (PDT)
Local: Wed, Jul 8 2009 12:03 pm
Subject: Re: problem linking to lapack atlas
Albert,

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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
albert  
View profile  
 More options Jul 14 2009, 1:49 pm
From: albert <acp...@freenet.de>
Date: Tue, 14 Jul 2009 10:49:23 -0700 (PDT)
Local: Tues, Jul 14 2009 1:49 pm
Subject: Re: problem linking to lapack atlas
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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google