From owner-bug-octave at bevo dot che dot wisc dot edu Sat Dec 9 15:14:36 1995 Subject: [50 character or so descriptive subject here (for reference)] From: Tholom Kiely To: bug-octave at che dot utexas dot edu Date: Sat, 9 Dec 95 20:44:05 GMT Bug report for Octave 1.1.1 configured for sparc-sun-sunos4.1.3_U1 Description: ----------- Hi!y+B Octave is an excellent piece of work. I'd like to use the dynamic linking capability, and installed Octave with the --enable-dld option, but I can't compile the example program given on P. 61 of the Postscript manual (section 5.8). The linking stage falls over, with the following report: ld: Undefined symbol _eval__18tree_multi_val_reti _eval__22tree_binary_expressioni ___Q213tree_constant17tree_constant_repRC6Matrix ___Q213tree_constant17tree_constant_repRCQ213tree_constant17tree_constant_rep _print__Q213tree_constant17tree_constant_rep _maybe_mutate__Q213tree_constant17tree_constant_rep _eval__12tree_builtiniiRC13Octave_object _do_index__Q213tree_constant17tree_constant_repRC13Octave_object ___as__13tree_constantRC13tree_constant _eval__15tree_identifieriiRC13Octave_object _eval__17tree_indirect_refiiRC13Octave_object _print_code__13tree_constantR7ostream _eval__12tree_builtini _atexit _print_code__21tree_colon_expressionR7ostream _eval__13tree_functioniiRC13Octave_object _MAIN__ _name__C15tree_identifier _eval__21tree_index_expressioniiRC13Octave_object _eval__22tree_prefix_expressioni _eval__32tree_multi_assignment_expressioniiRC13Octave_object _lookup_map_element__13tree_constantRt6SLList1ZPc __ _eval__21tree_unary_expressioni _print_code__17tree_indirect_refR7ostream _print_code__21tree_unary_expressionR7ostream ___t5Array1Z13tree_constantRCt5Array1Z13tree_constant ___Q213tree_constant17tree_constant_repd _lookup_map_element__8tree_fvcRt6SLList1ZPc _bump_value__Q213tree_constant17tree_constant_repQ215tree_expression4type _assign__15tree_identifierR13tree_constantRC13Octave_object _assign__17tree_indirect_refR13tree_constantRC13Octave_object _assign__8tree_fvcR13tree_constantRC13Octave_object _assign__Q213tree_constant17tree_constant_repR13tree_constantRC13Octave_object __ _print_code__22tree_prefix_expressionR7ostream ___cl__13Octave_objecti _panic__FPCce _eval__21tree_index_expressioni _max_expected_args__13tree_function _print_code__15tree_identifierR7ostream _print_code__23tree_postfix_expressionR7ostream _print_code__33tree_simple_assignment_expressionR7ostream _print_code__32tree_multi_assignment_expressionR7ostream __ _eval__23tree_postfix_expressioni _print_code__22tree_binary_expressionR7ostream _eval__21tree_colon_expressioni _print_code__21tree_index_expressionR7ostream _eval__15tree_identifieri _eval__13tree_functioni __ __ _print_code__11tree_matrixR7ostream _print_code__13tree_functionR7ostream _eval__17tree_indirect_refi _max_expected_args__12tree_builtin ___t5Array1Z13tree_constant _eval__11tree_matrixi _eval__33tree_simple_assignment_expressioni _eval__32tree_multi_assignment_expressioni __ _length__Ct5Array1Z13tree_constant _bump_value__15tree_identifierQ215tree_expression4type __ collect2: ld returned 2 exit status Repeat-By: --------- Attempting to compile the example program (which I pasted from the manual into a file "hello.cc", with the following script: c++ -Wall -fno-implicit-templates -I/home/tholom/sgnu/include/octave -I/home/tholom/octave-1.1.1/src -o hello hello.cc -L/home/tholom/sgnu/lib -lg++ -loctave -loctdld -liberty -ldld -liostream -lstdc++ -lcruft -lf2c where I've installed octave in the directory /home/tholom/sgnu, using gcc 2.6.3., with the following commands: configure --prefix=/home/tholom/sgnu --with-f2c --enable-dld make CFLAGS=-O2 CXXFLAGS=-O2 LDFLAGS= make install Just for completeness, hello.cc runs: #include "defun-dld.h" #include "iostream.h" #include "tree-const.h" DEFUN_DLD ("hello", Fhello, Shello,FShello, -1, -1, "hello (...)\n \n Print greeting followed by the values of all the arguments passed.\n Returns all the arguments passed.") { Octave_object retval; cerr << "Hello, world!\n"; int nargin = args.length (); for (int i = 1; i < nargin; i++) retval (nargin-i-1) = args(i).eval (1); return retval; } Note that the 'FSxxx' parameter wasn't documented in the manual, so a wild guess was taken as to the correct value. Fix: --- Sorry, I'm an engineer, not a programmer... Should I do something with the LDFLAGS option? P.S.: If this is sorted out, where can I get more info on the C++ classes? The liboctave.texi file is a little terse. Configuration (please do not edit this section): ----------------------------------------------- uname output: SunOS dublin26 4.1.3_U1 2 sun4m Fortran compiler: FFLAGS: -O F2C: f2c F2CFLAGS: FLIBS: -lf2c C compiler: gcc CFLAGS: -DHAVE_CONFIG_H -O2 C++ compiler: c++ CXXFLAGS: -DHAVE_CONFIG_H -fno-implicit-templates -O2 LDFLAGS: DEFS: -DOCTAVE_SOURCE=1 -DSEPCHAR=':' -DSEPCHAR_STR=: -DWITH_DLD=1 -DNPSOL_MISSING=1 -DQPSOL_MISSING=1 -DFSQP_MISSING=1 -DHAVE_STRFTIME=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DWORDS_BIGENDIAN=1 -DIEEE_BIG_ENDIAN=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DF77_APPEND_UNDERSCORE=1 -DHAVE_ASSERT_H=1 -DHAVE_FLOAT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PWD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FLOATINGPOINT_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_TTOLD_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_DIRENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TERMIOS_H=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_GETHOSTNAME=1 -DHAVE_BZERO=1 -DHAVE_BCOPY=1 -DHAVE_RINDEX=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRICMP=1 -DHAVE_STRNICMP=1 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -DHAVE_ON_EXIT=1 -DHAVE_TEMPNAM=1 -DHAVE_PUTENV=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_GETRUSAGE=1 -DHAVE_LIBM=1 -DHAVE_FINITE=1 -DHAVE_ISNAN=1 -DHAVE_ISINF=1 -DHAVE_INFINITY=1 -DHAVE_QU