[zeromq-dev] zeromq & fortran,

Giraudon Cyril cyril.giraudon at free.fr
Wed Mar 24 18:41:49 CET 2010


Thank you for your response.

I think a good way is to use the new fortran 2003 module ISO_C_BINDING
which permits to binding C types and fortran types.
gfortran 4.4 and ifort 11 implement this module.
Finally  from
http://github.com/sustrik/zeromq2/blob/master/include/zmq.h it would be
possible to write fortran interfaces.


Examples :

- C
short func (int i, double * j, int * k, int l[10], void * m) ;

- Fortran
INTERFACE
  FUNCTION FUNC(I, J, K, L, M), BIND(C)
    USE, INTRINSIC :: ISO_C_BINDING
    INTEGER(C_SHORT) :: FUNC
    INTEGER(C_INT), VALUE :: I
    REAL(C_DOUBLE) :: J
    INTEGER(C_INT) :: K, L(10)
    TYPE(C_PTR), VALUE :: M
    END FUNCTION FUNC
END INTERFACE

However, i have no time at the moment.

Best regards,

Cyril.



Le 23/03/2010 18:26, Apps, John a écrit :

> > We shall be more than happy to help out with this, should the need be required. Modifying the existing C wrapper to be less OpenVMS specific is something we have had in mind for some time, just not had the time or perceived demand.
> >
> > -- John Apps | HP  | John.Apps at HP.com | +491718691813 | http://bit.ly/8DFOYp --
> >
> > -----Original Message-----
> > From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Martin Sustrik
> > Sent: Tuesday, March 23, 2010 16:16
> > To: Giraudon Cyril
> > Cc: zeromq-dev at lists.zeromq.org
> > Subject: Re: [zeromq-dev] zeromq & fortran,
> >
> > Hi Cyril,
> >
> >   
>   
>> >> I 'm planning to use zeromq from a fortran program because I thought
>> >> zeromq provided a binding for fortran (as we can read in
>> >> http://www.zeromq.org/area:docs)  but I can't found out any pointer
>> >> about that.
>> >>
>> >> Is there any problem with the fortran binding ?
>> >>     
>>     
> > There have been a FORTRAN binding in 0MQ/1.0. IIRC it was OpenVMS 
> > specific. You can have a look here:
> >
> > http://github.com/sustrik/zeromq1/tree/master/libvmszmq/
> >
> > Anyway, it's pretty easy to write a 0MQ binding. It means wrapping ~10 
> > functions and ~20 constants. You can give it a try.
> >
> > Martin
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >   
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100324/e95bf8e6/attachment.htm>


More information about the zeromq-dev mailing list