This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: libgfortran array descriptor interface
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: "Paul Keir" <pkeir at dcs dot gla dot ac dot uk>
- Cc: fortran at gcc dot gnu dot org
- Date: Wed, 19 Nov 2008 14:56:09 +0100
- Subject: Re: libgfortran array descriptor interface
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=i+OrZSM1nVW+f6xPNWYbvHx6ss1ibhyKbasS1EynxEU=; b=q5pvd+wY+cVegYxOJq4+s4n0EiZ0frXWb7Gr9oz036rblkZopcC5aJ1XLG7An+yBJZ fARXlNBQqeY/37Pgc7LexKIsKoYEMy7LnNK7w9Jp4cRiF5YS5jrZ6A+MhGZDChp8kExt b/99IbFq506pQCWPDR0tsHozSKl2jfz7bs/mE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=uOXd49POaGCy/96XYUm54CZiBf0axaWUXz7TxhzN5Ap7ulLuRnQ9ctdReiZrbNaBIW 8TuZnkTVI2ZoFtAwMgJkbgo3knijMd1lg71TfzkxqmXJaldM8YSk9Z8zv9KCp6cW8v2N uxcMGkQeoOnhidsr7e4fvD0n1v+fg2D/8fWBo=
- References: <3CDFB8AFEA98E34CB599475AB11589C81C6FA7@EX2.ad.dcs.gla.ac.uk>
Dear Paul,
> I'd like to create libgfortran array descriptors in my C++ code,
> then call libgfortran intrinsics on them. Is this a reasonable
> thing to aim for?
Yes, indeed. Or, you could migrate from C++ to fortran.... :-)
>
> I tried successfully using extern declarations of simple intrinsics such
> as
> random (extern "C" double _gfortran_random_r8(double *);)
> but when I sought to use arrays, I was soon looking for a
> well defined header to permit access to items such as
> index_type, descriptor_dimensions,
> GFC_ARRAY_DESCRIPTOR etc. I now have the source, but
> libgfortran/libgfortran.h includes config.h, so perhaps I have
> to build gcc. Am I on the right track?
I have build up include files to do this job - I am hard put to
remember where they are now. However, it was not too hard a job.
Everything that you need is in libgfortran.h - you will just have to
do the conversion between the calls for the fortran data variable
types to the standard C types, using the usual C++ish clever stuff. If
you are not using OOP then change to fortran..... in fact, change to
fortran anyway:-)
Cheers and trust that you got the message?
Paul