comp.lang.ada
 help / color / mirror / Atom feed
From: Nasser Abbasi <nma@12000.org>
Subject: gnatmake, gnat2007. Linking to lapack and blas using with Ada.Numerics.Generic_Real_Arrays;
Date: Fri, 10 Aug 2007 16:34:23 -0700
Date: 2007-08-10T16:34:23-07:00	[thread overview]
Message-ID: <1186788863.427210.175620@g12g2000prg.googlegroups.com> (raw)

These are the steps I did to link a small ada program with lapack and
blas libraries which are needed if one uses some of the  the new
packages such as  Ada.Numerics.Generic_Real_Arrays and its linear
algebra functions.

Here is the gnatmake command:

$ gnatmake solve.adb -largs -L/usr/lib  -lgnala -llapack -lblas
gcc -c solve.adb
gnatbind -x solve.ali
gnatlink solve.ali -L/usr/lib -lgnala -llapack -lblas

On linux Ubuntu, I used adept_manger to install blas and lapack, then
after that, added the following symbolic links (which the link above
would fail otherwise):

su -
cd /usr/lib
ln -s liblapack.so.3 liblapack.so
ln -s libblas.so libblas.so.3

This is the ada program (just to test with, no data in matric to do an
actual solve)

--------------- solve.adb--------------
$ cat solve.adb
 with Ada.Numerics.Generic_Real_Arrays;

procedure solve is

   package myReals is new Ada.Numerics.Generic_Real_Arrays(Float);
   use myReals;

   nElements: constant integer:=6;
   A: Real_Matrix(1..nElements,1..nElements):=(others => (others =>
0.0));
   b: Real_Vector(1..nElements):=(Others=>0.0);

   begin
       b:=solve(A,b);

end solve;
------------- solve--------------------

Nasser




             reply	other threads:[~2007-08-10 23:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 23:34 Nasser Abbasi [this message]
2007-08-12  1:01 ` gnatmake, gnat2007. Linking to lapack and blas using with Ada.Numerics.Generic_Real_Arrays; Jerry
2007-08-12  9:53   ` Marc Enzmann
replies disabled

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