From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada with C Date: Sat, 24 Jul 2010 17:38:42 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sat, 24 Jul 2010 16:38:43 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="12457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18o40JnyrKnyzesDATxHMNH00CAqJ1j4eo=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:tUJUq+8zj5d2GPUU7u69TKoNDrk= sha1:Sd4OSepzagaFii+pqXVULSOGBRA= Xref: g2news1.google.com comp.lang.ada:12527 Date: 2010-07-24T17:38:42+01:00 List-Id: Ada novice writes: > Having some background in C and in Ada, I would like to have some > examples on how to interface codes between these two languages. I > loved Ada but scientific computing libraries are not available. So I > was thinking to use an available numeric library in C to do some > mathematical operations such as calculations of eigenvalues and > eigenvectors from data in an Ada program. Ada does provide some > routines for eigenvalues and eigenvectors computations but they aren't > suitable for a non-symmetric matrix. > > Information on interfacing Ada with C is scarce on the web and it > would help much if I can get some simple examples here from which I > can build up. I think you have GNAT? Assuming that, you'll find their implementation of Ada.Numerics.Generic_Real_Arrays in their Ada standard library; you'll find this under the installation directory. On my Mac it's /opt/gnat-gpl-2010-x86_64/lib/gcc/x86_64-apple-darwin9.6.0/4.3.6/adainclude/a-ngrear.ad[sb] but on a Windows machine it'll be something li \\lib\gcc\\\adainclude\a-ngrear.ad[sb] This will lead you to System.Generic_Real_BLAS (s-gerebl.ad[sb]) and System.Generic_Real_LAPACK (s-gerela.ad[sb]), which are interfaces to the corresponding external libraries. Not sure that these will fit your 'simple' criterion, though! --S