Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: lionel@quark.zko.dec.com (Steve Lionel)
Subject: Re: C calling Fortran 77 shared library on OSF/1 (or DUnix ?)
Date: 1996/05/06	[thread overview]
Message-ID: <4ml47d$dnk@zk2nws.zko.dec.com> (raw)
In-Reply-To: 4m9s2v$f6u@newton.cc.rl.ac.uk



In article <4m9s2v$f6u@newton.cc.rl.ac.uk>, street@wdcc1.bnsc.rl.ac.uk 
(Rachel Kay Street) writes:

|>1) Does anyone know if DEC C manual set for OSF/1 exists as I cannot
|>   find any bookreader files yet ?  If they exist which CD are they on,
|>   for which OS versions and where ?

Because the DEC C compiler is physically included with the Digital UNIX
(OSF/1) operating system, and its use is licensed by the "Developers
Toolkit" option, the documentation is included on the same CD which holds
the operating system documentation.
|>
|>2) Also any one tried to mix character*(*) array(length) and char *array[]
|>   (or char **array) when making calls from C into Fortran 77 functions ?
|>   Do you have an example I could read as all I can do is create core ?
|>   I have managed to pass single character strings by blank filling and 
|>   null terminating single string in C, with Fortran index searching for 
|>   char(0).  Is there a better method as without explicit limits say a 
|>   Fortran print of the string just keeps on printing out memory until 
|>   it dumps core ?
|>
|>3) What do I do with the common blocks when I create the shared library
|>   from its object and 'normal' library parts?  Does ld know how to find
|>   the commons and deal with them automatically ?  What about block data
|>   units ones ?

Please refer to the "Mixed Language Programming" chapter of the DEC Fortran
User Manual (on the Layered Products Documentation Library CD) - it contains 
extensive information on mixing Fortran and C and should answer all of your 
questions.  In particular, it contains detailed examples of passing arrays and 
character arguments between Fortran and C.

ld does know how to find the COMMONs, but of course there should be only one 
instance of a BLOCK DATA program unit and this should be in the shared library.

If you have further questions, feel free to send them to me by mail.
-- 

Steve Lionel                      mailto:lionel@quark.zko.dec.com
Fortran Development               http://www.digital.com/info/slionel.html
Digital Equipment Corporation     
110 Spit Brook Road, ZKO2-3/N30    
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on Digital Fortran 90, see http://www.digital.com/info/hpc/f90/



      parent reply	other threads:[~1996-05-06  4:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-02  4:00 C calling Fortran 77 shared library on OSF/1 (or DUnix ?) Rachel Kay Street
1996-05-02  4:00 ` @#$%!?!
1996-05-04  4:00 ` Sergio Gelato
1996-05-07  4:00   ` William Deich
1996-05-08  4:00     ` Sergio Gelato
1996-05-06  4:00 ` Steve Lionel [this message]
read-only archive

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