Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcnn_build() doesn't work in Matlab #2

Closed
alexgbelov opened this issue Oct 14, 2014 · 12 comments
Closed

rcnn_build() doesn't work in Matlab #2

alexgbelov opened this issue Oct 14, 2014 · 12 comments

Comments

@alexgbelov
Copy link

I tried running rcnn_build in the matlab terminal after following all directions in the readme. I got the following error:

Error using mex
/tmp/mex_17165510705607_10154/tron.o: In function TRON::trcg(double, double*, double*, double*)': tron.cpp:(.text+0x1d9): undefined reference todnrm2_'
tron.cpp:(.text+0x1fc): undefined reference to ddot_' tron.cpp:(.text+0x218): undefined reference todnrm2_'
tron.cpp:(.text+0x251): undefined reference to ddot_' tron.cpp:(.text+0x279): undefined reference todaxpy_'
tron.cpp:(.text+0x289): undefined reference to dnrm2_' tron.cpp:(.text+0x2d8): undefined reference todaxpy_'
tron.cpp:(.text+0x2ee): undefined reference to ddot_' tron.cpp:(.text+0x309): undefined reference toddot_'
tron.cpp:(.text+0x324): undefined reference to ddot_' tron.cpp:(.text+0x3c5): undefined reference todaxpy_'
tron.cpp:(.text+0x3f5): undefined reference to daxpy_' tron.cpp:(.text+0x426): undefined reference todaxpy_'
tron.cpp:(.text+0x43c): undefined reference to ddot_' tron.cpp:(.text+0x45f): undefined reference todscal_'
tron.cpp:(.text+0x479): undefined reference to daxpy_' /tmp/mex_17165510705607_10154/tron.o: In functionTRON::tron(double*)':
tron.cpp:(.text+0x585): undefined reference to dnrm2_' tron.cpp:(.text+0x799): undefined reference todnrm2_'
tron.cpp:(.text+0x924): undefined reference to daxpy_' tron.cpp:(.text+0x93a): undefined reference toddot_'
tron.cpp:(.text+0x959): undefined reference to ddot_' tron.cpp:(.text+0x9a6): undefined reference todnrm2_'
collect2: error: ld returned 1 exit status

@s-gupta
Copy link
Owner

s-gupta commented Oct 15, 2014

This looks like a compile error for liblinear-1.94 which is included in the rcnn/external directory. This is likely a setup dependent issue. I have tested this linux installations with Matlab 2012b (and with mex configured), and it works for me. You can refer to instructions at the liblinear webpage (http://www.csie.ntu.edu.tw/~cjlin/liblinear/) for known issues specific to your setup. There may also be pointers to other ways to compiling it, which may also be useful.

@varun-nagaraja
Copy link

I remember having this issue and I resolved it by compiling it outside of Matlab.

  1. Edit the Makefile in liblinear-1.94/matlab to set the MATLAB dir path.
  2. Run make in the liblinear-1.94 directory and then again in the liblinear-1.4/matlab directory.
  3. Don't run rcnn_build().

@s-gupta
Copy link
Owner

s-gupta commented Oct 15, 2014

Thanks for pitching in @varun-nagaraja. @alexgbelov: if you end up debugging this in your setup it will be great if you can reply back here with what worked for you.

@alexgbelov
Copy link
Author

Could you please explain how to download liblinear from your Github page? Also, I feel that this should be posted in the Readme.

@s-gupta
Copy link
Owner

s-gupta commented Oct 17, 2014

Hi @alexgbelov

Liblinear code is already available in the github code at: https://github.com/s-gupta/rcnn-depth/tree/master/rcnn/external/liblinear-1.94 . It is same as the code that is available on the liblinear website (http://www.csie.ntu.edu.tw/~cjlin/liblinear/#download) except that it does not have the pre-compiled binaries for windows (if you want those please go to the liblinear website).

For installation on linux an alternative to rcnn_build() is to follow the instructions at https://github.com/s-gupta/rcnn-depth/blob/master/rcnn/external/liblinear-1.94/README and https://github.com/s-gupta/rcnn-depth/blob/master/rcnn/external/liblinear-1.94/matlab/README

Thanks for your feedback, I will update the project readme to indicate these instructions.

@alexgbelov
Copy link
Author

@varun-nagaraja, thank you, that fixed the issue.

@jsong0516
Copy link

If somebody have same problem, try to build() with matlab 2012 version.

@ihsanafredi
Copy link

I tried to compile the liblinear but even than it doesnt work. Is there any solution to use it with Matlab2014b in linux. Will be thankful.

@alimurreza
Copy link

Issue with compiling lib-linear can be solved by doing the make from outside of the Matlab console as rightly pointed out by @varun-nagaraja. At least it worked for me. I am using R2014b and Ubuntu 12.04. More precisely do the following three changes in your 'MakeFile' inside the rcnn-depth/eccv14-code/rcnn/external/liblinear-1.94/matlab/

  1. MATLABDIR = /usr/local/MATLAB/R2014b
    show the correct directory where your 'mex' executable is. In my case it is in /usr/local/MATLAB/R2014b. (More accurately /usr/local/MATLAB/R2014b/bin/. The existing makefile automatically appends the /bin after the whatever value is in MATLABDIR)
  2. CXX = g++-4.7 #my g++ compiler version
    show the right gcc/g++ compiler. In my case I used g++-4.7.
  3. MEX_OPTION = CC=$(CXX) CXX=$(CXX) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)"
    some syntax changes allows the make file to get the correct FLAG values.

run the make from the console. It will build the train.mexa64 predit.mexa64 correctly for you.

In order to compile the desired liblinear_train.mexa64 (as rcnn_build.m is doing) you can do 'make' outside from the matlab similarly.

@Sanggeun-Ahn
Copy link

When I try to build 'rcnn_build();', I have an error like below

Error using mex
/home/user/asg/rcnn-depth_sgupta/rcnn-depth/eccv14-code/rcnn/external/liblinear-1.94/blas/.c
not found; check that you are in the correct current folder, and check the spelling of
'/home/user/asg/rcnn-depth_sgupta/rcnn-depth/eccv14-code/rcnn/external/liblinear-1.94/blas/
.c'.

Error in rcnn_build (line 8)
mex -outdir . ...

I want to know why this error was returned.

Please let me know. Thank you

@ihsanafredi
Copy link

@Sanggeun-Ahn As for as i remember, there is an issue with liblinear in the code. I dont remember the exact file where to change, but i think you have to change the name of liblinear-1.94 to exactly what is installed on your computer. or change the installed name to the one given in the code.
I hope this will help.

@ans-qureshi
Copy link

Hi @s-gupta @Sanggeun-Ahn did you manage to resolve this problem? I am getting a similar issue, but this time while building liblinear 1.5 dense

romi@romi-Z370-AORUS-Gaming-3:~/rgbd/external/liblinear-1.5-dense/matlab$ make
/home/romi/Matlab/bin/mex CC#g++ CXX#g++ CFLAGS#"-Wall -Wconversion -O3 -fPIC -I/home/romi/Matlab/extern/include -I.. -D _DENSE_REP" CXXFLAGS#"-Wall -Wconversion -O3 -fPIC -I/home/romi/Matlab/extern/include -I.. -D _DENSE_REP" -largeArrayDims train.c tron.o linear.o linear_model_matlab.o ../blas/blas.a
/home/romi/rgbd/external/liblinear-1.5-dense/matlab/CC#g++ not found; check that you are in the correct current folder, and check the spelling of '/home/romi/rgbd/external/liblinear-1.5-dense/matlab/CC#g++'.
Makefile:34: recipe for target 'train.mexa64' failed
make: *** [train.mexa64] Error 255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants