comp.lang.ada
 help / color / mirror / Atom feed
* anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup"
@ 2010-10-16  5:46 Nasser M. Abbasi
  2010-10-16  6:25 ` Nasser M. Abbasi
  0 siblings, 1 reply; 5+ messages in thread
From: Nasser M. Abbasi @ 2010-10-16  5:46 UTC (permalink / raw)




Hello;

I've send this email to the cygwin mailing list.

I thought I check here also.

I am trying to build an Ada file which has to be linked to blas and 
lapack as it uses the new Ada 2005 Solve() of linear system function.

The link problem is on cygwin. I think it is a gcc installation issue 
may be.

"It seems there is a library missing in the system. Did a search on 
this, but not able to find anything.

$ uname -a
CYGWIN_NT-6.1-WOW64 me-PC 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin

$ gcc --version
gcc (GCC) 4.3.4 20090804 (release) 1

$ gnatmake main.adb -largs -L/usr/lib  -lgnala -llapack -lblas
gnatbind -x main.ali
gnatlink main.ali -L/usr/lib -lgnala -llapack -lblas
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld:
cannot find -lgnalasup
collect2: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc.exe
gnatmake: *** link failed.

When I copy the source file (the Ada file) to a linux system, with 
ubuntu 10.10 (linux 2.6.35-22) running gcc 4.4.5, the same command above 
works with no problem. no link error.
"

The blas and lapack libraries should come with the system normally, but 
sometime they do not.  On cygwin, they are there. On Ubuntu I had to 
install them afterwords (easy with the package manager).

The Ada source file is just one file. If someone wants to try the above 
gnatmake command on my file, here it is:

http://12000.org/tmp/AAA/main.adb

Need to use the above command to build it, which is:

gnatmake main.adb -largs -L/usr/lib  -lgnala -llapack -lblas

It does nothing now, just wanted first to see if it builds oK.

thanks
--Nasser






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup"
  2010-10-16  5:46 anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup" Nasser M. Abbasi
@ 2010-10-16  6:25 ` Nasser M. Abbasi
  2010-10-16  7:30   ` Nasser M. Abbasi
  0 siblings, 1 reply; 5+ messages in thread
From: Nasser M. Abbasi @ 2010-10-16  6:25 UTC (permalink / raw)


On 10/15/2010 10:46 PM, Nasser M. Abbasi wrote:
>
>
> Hello;
>
> I've send this email to the cygwin mailing list.
>
> I thought I check here also.
>
> I am trying to build an Ada file which has to be linked to blas and
> lapack as it uses the new Ada 2005 Solve() of linear system function.
>
> The link problem is on cygwin. I think it is a gcc installation issue
> may be.
>
> "It seems there is a library missing in the system. Did a search on
> this, but not able to find anything.
>
> $ uname -a
> CYGWIN_NT-6.1-WOW64 me-PC 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin
>
> $ gcc --version
> gcc (GCC) 4.3.4 20090804 (release) 1
>
> $ gnatmake main.adb -largs -L/usr/lib  -lgnala -llapack -lblas
> gnatbind -x main.ali
> gnatlink main.ali -L/usr/lib -lgnala -llapack -lblas
> /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld:
> cannot find -lgnalasup
> collect2: ld returned 1 exit status
> gnatlink: error when calling /usr/bin/gcc.exe
> gnatmake: *** link failed.
>
> When I copy the source file (the Ada file) to a linux system, with
> ubuntu 10.10 (linux 2.6.35-22) running gcc 4.4.5, the same command above
> works with no problem. no link error.
> "
>
> The blas and lapack libraries should come with the system normally, but
> sometime they do not.  On cygwin, they are there. On Ubuntu I had to
> install them afterwords (easy with the package manager).
>
> The Ada source file is just one file. If someone wants to try the above
> gnatmake command on my file, here it is:
>
> http://12000.org/tmp/AAA/main.adb
>
> Need to use the above command to build it, which is:
>
> gnatmake main.adb -largs -L/usr/lib  -lgnala -llapack -lblas
>
> It does nothing now, just wanted first to see if it builds oK.
>
> thanks
> --Nasser


I found one reference on this library, here it is

http://objectmix.com/ada/382814-gnatmake-ada-numerics-real_arrays-not-predefined-library-unit.html

"Anyway, I've started investigating the "libgnalasup" issue. This
library is referenced by i-forbla.adb, but doesn't seem to be
distributed. Replacing it with "liblapack" and "libblas" may be
enough."

But the suggestion given does not work for my on cygwin (gcc 4.3.3). I 
get the same error. Using  -lgnalasup or  -lgnala or not using or using 
gnatmake -static, nothing works.

I think now after reading the above, this is some gnat version being a 
bit old on cygwin (gcc 4.3).  The problem is that this is the latest 
version I have of gcc on cygwin.

I now downloaded from libre site gnat 2010 GPL, on windows, and 
installed it. Then did the same command above (had to add -gnat05, 
becuase it now complained).

But I do not get the above error, but I do not have blas and lapack on 
windows. I need to figure now where to get them for windows and where to 
put them to make gnatmake happy (I think that will be

      C:\GNAT\2010\LIB

(wonder why blas and lapack do not come with GNAT GPL distribution since 
there are needed to link against for building the new numeric stuff?

 >gnatmake main.adb -gnat05 -largs -L/usr/lib  -lgnala -llapack -lblas

gnatbind -x main.ali
gnatlink main.ali -L/usr/lib -lgnala -llapack -lblas
c:/gnat/2010/bin/../libexec/gcc/i686-pc-mingw32/4.3.6/ld.exe: cannot 
find -llapack
collect2: ld returned 1 exit status
gnatlink: error when calling C:\GNAT\2010\bin\gcc.exe
gnatmake: *** link failed.


--Nasser



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup"
  2010-10-16  6:25 ` Nasser M. Abbasi
@ 2010-10-16  7:30   ` Nasser M. Abbasi
  2010-10-16 14:49     ` Simon Wright
  0 siblings, 1 reply; 5+ messages in thread
From: Nasser M. Abbasi @ 2010-10-16  7:30 UTC (permalink / raw)


On 10/15/2010 11:25 PM, Nasser M. Abbasi wrote:

> But I do not get the above error, but I do not have blas and lapack on
> windows. I need to figure now where to get them for windows and where to
> put them to make gnatmake happy (I think that will be
>
>        C:\GNAT\2010\LIB
>
> (wonder why blas and lapack do not come with GNAT GPL distribution since
> there are needed to link against for building the new numeric stuff?
>
>   >gnatmake main.adb -gnat05 -largs -L/usr/lib  -lgnala -llapack -lblas
>
> gnatbind -x main.ali
> gnatlink main.ali -L/usr/lib -lgnala -llapack -lblas
> c:/gnat/2010/bin/../libexec/gcc/i686-pc-mingw32/4.3.6/ld.exe: cannot
> find -llapack
> collect2: ld returned 1 exit status
> gnatlink: error when calling C:\GNAT\2010\bin\gcc.exe
> gnatmake: *** link failed.
>

DONE !

Got it working, using gnat GPL 2010 with blas and lapack:

---------------
gnatmake main.adb -gnat05 -largs -L/usr/lib  -lgnala -L/usr/lib/lapack.a 
-L/usr/lib/blas.a

gnatbind -x main.ali
gnatlink main.ali -L/usr/lib -lgnala -L/usr/lib/lapack.a -L/usr/lib/blas.a
----------------------


This is what I did: I downloaded lapack 3.2.2. from
http://www.netlib.org/lapack/

and then build the tree from source under cygwin gcc, this generated 2 
static libraries: blas.a and lapack.a, then copied these 2 files to 
C:\GNAT\2010\LIB, then did the above gnatmake command.  it worked!

I have no idea what the -lgnalasup is, but I think it is just an 
internal packaging issue with the old gcc on cygwin with the Ada part.

The gcc that comes with GPL GNAT 2010 is

gcc --version
gcc (GCC) 4.3.6 20100603 for GNAT GPL 2010 (20100603)

while on cygwin, gcc is 4.3.4.

anyway, this whole thing with Ada 2005 and lapack and blas needs to be 
sorted out. Since the new Ada 2005 numeric link to lapack, I think then 
lapack libraries should be part of the installation of the ada compiler. 
May be ask the user an option if they need to have these installed 
during the compiler installation?

--Nasser






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup"
  2010-10-16  7:30   ` Nasser M. Abbasi
@ 2010-10-16 14:49     ` Simon Wright
  2010-10-16 15:45       ` Nasser M. Abbasi
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Wright @ 2010-10-16 14:49 UTC (permalink / raw)


Nasser,

Could you try just "gnatmake -gnat05 main.adb"? it works fine here.

AdaCore have supplied BLAS & LAPACK functionality but not in the
libraries you would expect!





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup"
  2010-10-16 14:49     ` Simon Wright
@ 2010-10-16 15:45       ` Nasser M. Abbasi
  0 siblings, 0 replies; 5+ messages in thread
From: Nasser M. Abbasi @ 2010-10-16 15:45 UTC (permalink / raw)


On 10/16/2010 7:49 AM, Simon Wright wrote:
> Nasser,
>
> Could you try just "gnatmake -gnat05 main.adb"? it works fine here.
>
> AdaCore have supplied BLAS&  LAPACK functionality but not in the
> libraries you would expect!
>
>

Under cygwin, gcc 4.3.4:
---------------------------
$ gnatmake -gnat05 main.adb
gcc -c -gnat05 main.adb
gnatbind -x main.ali
gnatlink main.ali
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: 
cannot find -lgnalasup
collect2: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc.exe
gnatmake: *** link failed.

under GPL 2010 gnat:
--------------------
gnatmake -gnat05 main.adb
gcc -c -gnat05 main.adb
gnatbind -x main.ali
gnatlink main.ali
-----------------------

So, you'r right, it does not look like I needed to build the lapack and 
blas libraries if using gnat gpl 2010.  That is good. I assume then 
these libraries come in with gnat.

thanks

--Nasser



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-16 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-16  5:46 anyone seen this link error trying to link Ada program with blas and lapack? "cannot find -lgnalasup" Nasser M. Abbasi
2010-10-16  6:25 ` Nasser M. Abbasi
2010-10-16  7:30   ` Nasser M. Abbasi
2010-10-16 14:49     ` Simon Wright
2010-10-16 15:45       ` Nasser M. Abbasi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox