[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linking fortran subs
From: |
Phil Cummins |
Subject: |
Re: linking fortran subs |
Date: |
Mon, 28 May 2001 14:59:16 +0900 |
Thanks to everyone who offered advice on what to do about
my fortran linking problem. I took Dirk's advice and just
tried to make a stand-alone C++ program that called the
fortran routines, and this helped me work out the problem.
As several people pointed out, I needed to link with the
fortran run time library, which on my Redhat Linux system,
gcc version 2.95.2, is libg2c.a (I think the g77 lib was
changed from f2c to g2c at some point).
But I still didn't get anywhere, because I was foolish
enough to specify the g2c library *before* my fortan lib:
mkoctfile -v octtst.cc -lg2c -L. -ltau
( ^ this is my fortran lib)
which had no effect. Finally, I realized I needed to specify
the g2c library *after* my fortran lib:
mkoctfile -v octtst.cc -L. -ltau -lg2c
I feel a little silly for having wasted so much time (even
recompiled octave to make sure it used same g77!). But now it
works. Thanks everyone.
--
---------------------------------------------------------------------
Phil R Cummins address@hidden
Frontier Research for Subduction Dynamics tel(i/d):81/0-468-67-3393
JAMSTEC, 2-15 Natsushima-cho fax(i/d):81/0-468-67-3409
Yokosuka 237-0061, Japan
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------