This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgfortran array descriptor interface


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]