problem with f77 and symbol names

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with f77 and symbol names

Dave Alden
Hi,
  I'm trying to compile Octave on Solaris 2.4 (using gcc/g++ 2.6.3,
libg++-2.6.2 and Sun's f77 3.0.1).  The problem I'm running into is
an old one, so I'm sure I'm doing something stupid.  :-)  The problem
is that "f77" adds an "_" to subroutine names (i.e., "ddot" becomes
"ddot_") -- needless to say, the linker doesn't find "ddot" then.  I
can create an include file redefining all of the routines, but I'm
hoping there's an easier way.
  To make up for this stupid question, I'd be willing to provide
binaries for Solaris 2.4 if there's any interest.
...thnx,
...dave alden

Reply | Threaded
Open this post in threaded view
|

Re: problem with f77 and symbol names

Vinayak Dutt
#Hi,
#  I'm trying to compile Octave on Solaris 2.4 (using gcc/g++ 2.6.3,
#libg++-2.6.2 and Sun's f77 3.0.1).  The problem I'm running into is
#an old one, so I'm sure I'm doing something stupid.  :-)  The problem
#is that "f77" adds an "_" to subroutine names (i.e., "ddot" becomes
#"ddot_") -- needless to say, the linker doesn't find "ddot" then.  I
#can create an include file redefining all of the routines, but I'm
#hoping there's an easier way.
#  To make up for this stupid question, I'd be willing to provide
#binaries for Solaris 2.4 if there's any interest.
#...thnx,
#...dave alden
#

If your configuration goes ok, then it should define F77_UNDERSCORE_APPEND=1 which
would take care of _ prefix. For some reasons f2c-compat.sh did not emit that define
statement while your were configuring your setup ? Try configuring (run configure) again
and check if -DF77_UNDERSCORE_APPEND=1 is added to your Makeconf before you
compile Octave again.


--vinayak-
/*
 * vinayak dutt
 * graduate student, ultrasound research
 * mayo graduate school, rochester mn
 *
 * e-mail: [hidden email]
 *         [hidden email]
 *
 */
#include "disclaimer.h"

Reply | Threaded
Open this post in threaded view
|

Re: problem with f77 and symbol names

Dave Alden
Hi,

> If your configuration goes ok, then it should define F77_UNDERSCORE_APPEND=1 which
> would take care of _ prefix. For some reasons f2c-compat.sh did not emit that define
> statement while your were configuring your setup ? Try configuring (run configure) again
> and check if -DF77_UNDERSCORE_APPEND=1 is added to your Makeconf before you
> compile Octave again.

Ahh -- no, -DF77_APPEND_UNDERSCORE=1 was not defined.  After a little bit
of poking around, the problem seems to be in f2c-compat.sh.  Here's what
happens if I run it by hand:

# echo $FLIBS
-Xlinker -R -Xlinker /opt/SUNWspro/lib /opt/SUNWspro/SC3.0.1/lib/values-xi.o -L /opt/SUNWspro/lib -L /opt/SUNWspro/SC3.0.1/lib -L /usr/ccs/lib -L /usr/lib /opt/SUNWspro/SC3.0.1/lib/libM77.a -lF77 -lsunmath
# gcc -o ctest ctest.o ftest.o $FLIBS -lm
ld: fatal: symbol `_lib_version' is multiply defined:
        (file /usr/ccs/lib/values-Xa.o and file /opt/SUNWspro/SC3.0.1/lib/values-xi.o);
ld: fatal: File processing errors.  No output written to ctest

...dave