1

I am trying to compile object detection program from http://people.cs.uchicago.edu/~rbg/latent/, without any luck, however.

I installed 64-bit Ubuntu 12.10, 32-bit MATLAB 2012a. I also have gcc compiler

ivan@ubuntu:~$ gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

Here is the error I get

EDU>> demo
compiling the code...
Warning: You are using gcc version "4.7.2-2ubuntu1)".  The version
     currently supported with MEX is "4.4.6".
     For a list of currently supported compilers see: 
     http://www.mathworks.com/support/compilers/current_release/

/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when       searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when   searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.so when  searching for -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a when searching for -lgomp
/usr/bin/ld: cannot find -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

    mex: link of ' "bin/fv_cache.mexglx"' failed.

Warning: Maybe you need to call fv_cache('unlock') first? 
> In fv_compile at 50
  In compile at 48
  In demo at 5 

Warning: You are using gcc version "4.7.2-2ubuntu1)".  The version
     currently supported with MEX is "4.4.6".
     For a list of currently supported compilers see: 
     http://www.mathworks.com/support/compilers/current_release/

/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

    mex: link of ' "bin/cascade.mexglx"' failed.

Error using mex (line 206)
Unable to complete successfully.

Error in cascade_compile (line 43)
eval(mexcmd);

Error in compile (line 50)
  cascade_compile(opt, verb);

Error in demo (line 5)
compile;

I suspect it has something to do with missing 32-bit libraries. I am new to unix systems so I might not have included all the information you need to know.

Update:

New errors look like

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.so when searching for -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a when searching for -lgomp
/usr/bin/ld: cannot find -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status

  mex: link of ' "bin/fv_cache.mexglx"' failed.

I tried to create a symbolic link

sudo ln -s /usr/lib/i386-linux-gnu/libc.so.6 /usr/lib/libc.so.6

However it didn't solve the problem

Gnattuha
  • 211
  • 3
  • 11

1 Answers1

0

Try looking for crti in your system first:

~$ sudo find /usr/ -name crti*
/usr/lib/x86_64-linux-gnu/crti.o
/usr/lib32/crti.o

If it's not there, or the lib32 version, install libc6-dev:

~$ sudo apt-get install libc6-dev

If it is there, try adding the library location:

LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH 
export LIBRARY_PATH

See also these posts in Ask Ubuntu and SO for relevant questions and help.

Community
  • 1
  • 1
gevang
  • 4,994
  • 25
  • 33
  • Thank you for your reply. I have libc6-dev installed. ivan@ubuntu:~$ sudo find /usr/ -name crti* returns only /usr/lib/x86_64-linux-gnu/crti.o . I also added the library location, however I am still unable to perform compilation. I saw the links from your post earlier and tried to follow them before posting the question here, unfortunately I could achieve the result. – Gnattuha Feb 18 '13 at 19:54
  • Not sure if your 32-bit MATLAB is looking for 32-bit libs. Do you have basic 32-bit library versions, i.e. `ia32-libs` or the newer, multiarch version `ia32-libs-multiarch`? – gevang Feb 18 '13 at 20:35
  • 1
    ivan@ubuntu:~$ sudo apt-get install ia32-libs [sudo] password for ivan: Reading package lists... Done Building dependency tree Reading state information... Done ia32-libs is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ivan@ubuntu:~$ sudo apt-get install ia32-libs-multiarch Reading package lists... Done Building dependency tree Reading state information... Done ia32-libs-multiarch:i386 is already the newest version. ia32-libs-multiarch:i386 set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – Gnattuha Feb 18 '13 at 20:39
  • Thank you a lot! Problem with crti.o is solved, although I am getting new errors. – Gnattuha Feb 18 '13 at 20:43
  • /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when searching for -lstdc++ /usr/bin/ld: cannot find -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.a when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm – Gnattuha Feb 18 '13 at 20:44
  • probably your 64-bit versions are masking the 32-bit required by MATLAB. If you cannot explicitly specify the path to those libraries while compiling, a workaround may be to either give precedence to the 32-bit location in `LD_LIBRARY` or create symbolic links. – gevang Feb 18 '13 at 21:00
  • If you have a license to the 64-bit version of Matlab and you can acquire or build the 64-bit mex functions, you might consider using it instead. In many cases, numeric 64-bit apps are faster than 32-bit ones (they have access to more general purpose registers, offsetting the cost of using 64-bit pointers instead of 32-bit ones). – Mr Fooz Feb 18 '13 at 23:59
  • I have a student license, the only version I am able to download for linux is 32-bit. – Gnattuha Feb 19 '13 at 00:20
  • Can somebody elaborate on how to create a symbolic link to solve this problem? – Gnattuha Feb 19 '13 at 00:21