mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

building error with torch

Open shuaitang opened this issue 10 years ago • 9 comments

There is no problem when I compile mxnet with USE_TORCH=0.

But when I set USE_TORCH=1, the problem turns out like this

~/torch/install/lib/libTH.so: undefined reference to sgeqrf_' ~/torch/install/lib/libTH.so: undefined reference tossyev_' ~/torch/install/lib/libTH.so: undefined reference to sgesvd_' ~/torch/install/lib/libTH.so: undefined reference todsyev_' ~/torch/install/lib/libTH.so: undefined reference to dorgqr_' ~/torch/install/lib/libTH.so: undefined reference todpotri_' ~/torch/install/lib/libTH.so: undefined reference to dgesv_' ~/torch/install/lib/libTH.so: undefined reference tosgels_' ~/torch/install/lib/libTH.so: undefined reference to dgels_' ~/torch/install/lib/libTH.so: undefined reference todtrtrs_' ~/torch/install/lib/libTH.so: undefined reference to sorgqr_' ~/torch/install/lib/libTH.so: undefined reference tospotrs_' ~/torch/install/lib/libTH.so: undefined reference to dpstrf_' ~/torch/install/lib/libTH.so: undefined reference tosgetri_' ~/torch/install/lib/libTH.so: undefined reference to dpotrf_' ~/torch/install/lib/libTH.so: undefined reference todgetri_' ~/torch/install/lib/libTH.so: undefined reference to sormqr_' ~/torch/install/lib/libTH.so: undefined reference todgeqrf_' ~/torch/install/lib/libTH.so: undefined reference to strtrs_' ~/torch/install/lib/libTH.so: undefined reference todormqr_' ~/torch/install/lib/libTH.so: undefined reference to dpotrs_' ~/torch/install/lib/libTH.so: undefined reference tosgesv_' ~/torch/install/lib/libTH.so: undefined reference to dgetrf_' ~/torch/install/lib/libTH.so: undefined reference todgeev_' ~/torch/install/lib/libTH.so: undefined reference to sgetrf_' ~/torch/install/lib/libTH.so: undefined reference todgesvd_' ~/torch/install/lib/libTH.so: undefined reference to spotrf_' ~/torch/install/lib/libTH.so: undefined reference tospstrf_' ~torch/install/lib/libTH.so: undefined reference to sgeev_' ~/torch/install/lib/libTH.so: undefined reference tospotri_' collect2: error: ld returned 1 exit status make: *** [bin/im2rec] Error 1

Is it caused by torch or mxnet?

Thank you

shuaitang avatar Jan 13 '16 04:01 shuaitang

It seems like torch link problem (with altas or lapack). Check your torch building.

antinucleon avatar Jan 13 '16 05:01 antinucleon

does your torch installation work?

piiswrong avatar Jan 13 '16 06:01 piiswrong

yes, torch works well, and openblas is ok...

but the problem is here...

shuaitang avatar Jan 13 '16 06:01 shuaitang

try adding -L/path/to/lapack -llapack to LDFLAGS?

piiswrong avatar Jan 13 '16 08:01 piiswrong

the additional link flags you want to add

ADD_LDFLAGS =-L/usr/lib/lapack -llapack

i add it like this, but it still doesnt work

shuaitang avatar Jan 13 '16 17:01 shuaitang

@shuaitang Have you fixed the problem? I've also find the exactly same problem and can not figure out the solution.

sodabeta7 avatar Mar 08 '16 15:03 sodabeta7

Same compilation error with a clean torch install on ubuntu 14.04, gcc 4.8 . Did someone solve the issue ? Which version of altas and lapack are required ?

Conchylicultor avatar Sep 09 '16 14:09 Conchylicultor

I experienced the same kind of error yesterday and the problem ended up being that I'd compiled lapack with gcc 4.x but had compiled torch with 5.x. The "undefined reference to..." is a huge hint that's what's going on as I've been slowly upgrading my (Gentoo) system and I've hit that error countless times. That may not be your problem but I figured I'd post a potential solution in case it helps someone.

TheOncomingStorm avatar Oct 25 '16 16:10 TheOncomingStorm

Another possible cause can be the fact that torch install a custom version of openBlas in /opt/OpenBLAS/, which may conflict with another version installed with apt-get (used by Caffe for instance).

Conchylicultor avatar Oct 25 '16 21:10 Conchylicultor