* cc and f77 linking : libraries required ?
@ 1996-08-26 4:00 Dr Francesco Mencaraglia
1996-08-27 4:00 ` Steve Lionel
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dr Francesco Mencaraglia @ 1996-08-26 4:00 UTC (permalink / raw)
sorry if this question has been already posed N times ( N >> 1), but I could
not find the answer in the osf FAQ. I am trying to compile a C programs which
calls fortran-77 routines. what I do is:
f77 -c routine.f
cc -c programc
cc program.o routine.o -lUfor -lfor -lm
but I get a few unresolved symbols (something like _Ots....); inspecting
/usr/lib I found some libraries libots.a libots2.a but this was not enough.
has anybody out of there a good suggestion?
thanks
Francesco Mencaraglia - IROE - Via Panciatichi 64 - 50127 Firenze - Italy
menca@iroe.iroe.fi.cnr.it
menca@moloch.iroe.fi.cnr.it
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cc and f77 linking : libraries required ?
1996-08-26 4:00 cc and f77 linking : libraries required ? Dr Francesco Mencaraglia
1996-08-27 4:00 ` Steve Lionel
@ 1996-08-27 4:00 ` Ian Mortimer
1996-08-28 4:00 ` John Reinitz
2 siblings, 0 replies; 5+ messages in thread
From: Ian Mortimer @ 1996-08-27 4:00 UTC (permalink / raw)
Dr Francesco Mencaraglia (menca@iroe.iroe.fi.cnr.it) wrote:
> I am trying to compile a C programs which
> calls fortran-77 routines. what I do is:
> f77 -c routine.f
> cc -c programc
> cc program.o routine.o -lUfor -lfor -lm
> but I get a few unresolved symbols (something like _Ots....); inspecting
> /usr/lib I found some libraries libots.a libots2.a but this was not enough.
It is better to compile with f77 even if your main routine is in C.
You will need to use something like the following:
f77 -nofor_main program.o routine.o -lm
Hope this helps.
Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cc and f77 linking : libraries required ?
1996-08-26 4:00 cc and f77 linking : libraries required ? Dr Francesco Mencaraglia
@ 1996-08-27 4:00 ` Steve Lionel
1996-08-27 4:00 ` Ian Mortimer
1996-08-28 4:00 ` John Reinitz
2 siblings, 0 replies; 5+ messages in thread
From: Steve Lionel @ 1996-08-27 4:00 UTC (permalink / raw)
In article <4vsbeb$d3g_001@iroe.fi.cnr.it>, menca@iroe.iroe.fi.cnr.it
(Dr Francesco Mencaraglia) writes:
|>sorry if this question has been already posed N times ( N >> 1), but I could
|>not find the answer in the osf FAQ. I am trying to compile a C programs which
|>calls fortran-77 routines. what I do is:
|>f77 -c routine.f
|>cc -c programc
|>cc program.o routine.o -lUfor -lfor -lm
|>but I get a few unresolved symbols (something like _Ots....); inspecting
|>/usr/lib I found some libraries libots.a libots2.a but this was not enough.
Use the f77 driver to do the linking. It will add the proper libraries.
You must also add -nofor_main if the main program is not Fortran. You can
use the f77 driver to compile the C code as well. For example:
f77 -nofor_main routine.f program.c
For further information, please see the Digital Fortran User Manual.
--
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, see http://www.digital.com/info/hpc/fortran/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cc and f77 linking : libraries required ?
1996-08-26 4:00 cc and f77 linking : libraries required ? Dr Francesco Mencaraglia
1996-08-27 4:00 ` Steve Lionel
1996-08-27 4:00 ` Ian Mortimer
@ 1996-08-28 4:00 ` John Reinitz
1996-08-29 4:00 ` Steve Lionel
2 siblings, 1 reply; 5+ messages in thread
From: John Reinitz @ 1996-08-28 4:00 UTC (permalink / raw)
In article <4vsbeb$d3g_001@iroe.fi.cnr.it>,
Dr Francesco Mencaraglia <menca@iroe.iroe.fi.cnr.it> wrote:
>sorry if this question has been already posed N times ( N >> 1), but I could
>not find the answer in the osf FAQ. I am trying to compile a C programs which
>calls fortran-77 routines. what I do is:
>f77 -c routine.f
>cc -c programc
>cc program.o routine.o -lUfor -lfor -lm
>but I get a few unresolved symbols (something like _Ots....); inspecting
>/usr/lib I found some libraries libots.a libots2.a but this was not enough.
>
If the linking against the libraries doesn't work, I don't
have a suggestion, but I *am* curious what libots.a and
friends are for.
I have C code that at linktime complains about
Unresolved:
_OtsRemainder64
_OtsDivide64
and I can fix this behavior by adding -lots to
the command line. But what *are* these libraries,
and where are they discussed in the manuals?
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cc and f77 linking : libraries required ?
1996-08-28 4:00 ` John Reinitz
@ 1996-08-29 4:00 ` Steve Lionel
0 siblings, 0 replies; 5+ messages in thread
From: Steve Lionel @ 1996-08-29 4:00 UTC (permalink / raw)
In article <502alk$koe@panix2.panix.com>, reinitz@panix.com (John Reinitz)
writes:
|>I have C code that at linktime complains about
|>Unresolved:
|>_OtsRemainder64
|>_OtsDivide64
|>
|>and I can fix this behavior by adding -lots to
|>the command line. But what *are* these libraries,
|>and where are they discussed in the manuals?
These are language-independent compiled code support routines. The language
drivers will add -lots automatically. The Digital Fortran User Manual
lists the libraries that Fortran uses in the "Compiling and Linking" chapter,
though it does not describe each one.
--
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, see http://www.digital.com/info/hpc/fortran/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1996-08-29 4:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-08-26 4:00 cc and f77 linking : libraries required ? Dr Francesco Mencaraglia
1996-08-27 4:00 ` Steve Lionel
1996-08-27 4:00 ` Ian Mortimer
1996-08-28 4:00 ` John Reinitz
1996-08-29 4:00 ` Steve Lionel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox