help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MEX compilation problem---error: `xyz' undefined


From: Steve C. Thompson
Subject: Re: MEX compilation problem---error: `xyz' undefined
Date: Thu, 29 Mar 2007 18:00:11 -0700

On Thu, 2007-03-29 at 20:26 -0400, Paul Kienzle wrote:
> At a guess I would say that you are not linking to the
> interleaver library.
> 
> You can use "ldd CreateUmtsInterleaver.oct" to see what
> libraries it depends on and "nm CreateUmtsInterleaver.oct"
> to see what symbols it is missing.

Here's what I get:

----------------------------

  $ ldd CreateUmtsInterleaver.oct

  linux-gate.so.1 =>  (0xffffe000)
  liboctinterp.so => not found
  liboctave.so => not found
  libcruft.so => not found
  liblapack.so.3 => /usr/lib/atlas/sse2/liblapack.so.3 (0xb795b000)
  libblas.so.3 => /usr/lib/atlas/sse2/libblas.so.3 (0xb738a000)
  libfftw3.so.3 => /usr/lib/libfftw3.so.3 (0xb72af000)
  libreadline.so.5 => /lib/libreadline.so.5 (0xb7281000)
  libncurses.so.5 => /lib/libncurses.so.5 (0xb7241000)
  libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb723c000)
  libhdf5-1.6.5.so.0 => /usr/lib/libhdf5-1.6.5.so.0 (0xb710a000)
  libz.so.1 => /usr/lib/libz.so.1 (0xb70f6000)
  libg2c.so.0 => /usr/lib/libg2c.so.0 (0xb70cf000)
  libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb70a9000)
  libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6fca000)
  libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6fbe000)
  libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb6e8a000)
  libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb6e77000)
  /lib/ld-linux.so.2 (0x80000000)

  $ nm CreateUmtsInterleaver.oct

  00002968 A __bss_start
  00001700 r C.20.3281
  00001620 r C.21.3282
  000015c0 r C.22.3283
  00001560 r C.23.3284
  00000680 t call_gmon_start
           U calloc@@GLIBC_2.0
  00002968 b completed.5761
  00000780 T CreateCcsdsInterleaver
  000008b0 T CreateUmtsInterleaver
  000027d8 d __CTOR_END__
  000027d4 d __CTOR_LIST__
           w __cxa_finalize@@GLIBC_2.1.3
  00001480 t __do_global_ctors_aux
  000006b0 t __do_global_dtors_aux
  00002960 d __dso_handle
  000027e0 d __DTOR_END__
  000027dc d __DTOR_LIST__
  000027e8 a _DYNAMIC
  00002968 A _edata
  0000296c A _end
  000014b4 T _fini
  00000710 t frame_dummy
  000017d0 r __FRAME_END__
           U free@@GLIBC_2.0
  00000750 T gcd
  00002934 a _GLOBAL_OFFSET_TABLE_
           w __gmon_start__
  00000747 t __i686.get_pc_thunk.bx
  000005d8 T _init
  000027e4 d __JCR_END__
  000027e4 d __JCR_LIST__
           w _Jv_RegisterClasses
           U memcpy@@GLIBC_2.0
           U mexErrMsgTxt
  00001320 T mexFunction
           U mxCreateDoubleMatrix
           U mxGetPr
  00002964 d p.5759

----------------------------

These lines look suspicious:

  liboctinterp.so => not found
  liboctave.so => not found
  libcruft.so => not found

I have those libraries on my computer, of course.  I tried the
following:

  1) Add /usr/local/octave/2.9.10/lib/octave-2.9.10/ to my path
  2) recompile with mkoctfile (see no compile errors)
  3) repeat ldd and nm commands (get the same thing, same problem
                                 in Octave too)

This didn't work.  I then tried

  $ mkoctfile-2.9.10 \
    -L/usr/local/octave/2.9.10/lib/octave-2.9.10/ \
    -v -o CreateUmtsInterleaver.oct --mex CreateUmtsInterleaver.c

  gcc -c -fPIC -I/usr/local/octave/2.9.10/include/octave-2.9.10
  -I/usr/local/octave/2.9.10/include/octave-2.9.10/octave
  -I/usr/local/octave/2.9.10/include -mieee-fp -g -O2 -I.
  CreateUmtsInterleaver.c -o CreateUmtsInterleaver.o
  g++ -shared -Wl,-Bsymbolic -o CreateUmtsInterleaver.oct
  CreateUmtsInterleaver.o
  -L/usr/local/octave/2.9.10/lib/octave-2.9.10/
  -L/usr/local/octave/2.9.10/lib/octave-2.9.10 -loctinterp -loctave
  -lcruft -llapack -lblas -lfftw3 -lreadline -lncurses -ldl -lhdf5
  -lz -lm -L/usr/lib/gcc/i486-linux-gnu/3.4.6
  -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../../../lib
  -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../.. -L/lib/../lib
  -L/usr/lib/../lib -lhdf5 -lz -lfrtbegin -lg2c -lm

Note, however, running

  $ mkoctfile-2.9.10 \
    -v -o CreateUmtsInterleaver.oct --mex CreateUmtsInterleaver.c

spits out

  gcc -c -fPIC -I/usr/local/octave/2.9.10/include/octave-2.9.10
  -I/usr/local/octave/2.9.10/include/octave-2.9.10/octave
  -I/usr/local/octave/2.9.10/include -mieee-fp -g -O2 -I.
  CreateUmtsInterleaver.c -o CreateUmtsInterleaver.o g++ -shared
  -Wl,-Bsymbolic -o CreateUmtsInterleaver.oct
  CreateUmtsInterleaver.o
  -L/usr/local/octave/2.9.10/lib/octave-2.9.10 -loctinterp
  -loctave -lcruft -llapack -lblas -lfftw3 -lreadline -lncurses
  -ldl -lhdf5 -lz -lm -L/usr/lib/gcc/i486-linux-gnu/3.4.6
  -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../../../lib
  -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../.. -L/lib/../lib
  -L/usr/lib/../lib -lhdf5 -lz -lfrtbegin -lg2c -lm

which seems to link to the proper directories.

Any ideas?

Steve



reply via email to

[Prev in Thread] Current Thread [Next in Thread]