torch / torch7

http://torch.ch
Other
9k stars 2.38k forks source link

"cannot load libtorch.so" due to compiling error using icc #1042

Closed MlWoo closed 5 years ago

MlWoo commented 7 years ago

It seems all things are OK when I use intel compiler to compile the project. However, it tells me that "cannot load libtorch.so" when I use commands "luajit -ltorch". @soumith You have mentioned that " install/bin/luajit -e 'ffi=require "ffi"; ffi.load("install/lib/lua/5.1/libtorch.so")' " is good way to debug. Here .I have tried it, and it tells the function symbols in "AVX.c" and "AVX2.c" are not defined. I checked the difference of C flags between using gcc and icc. eg. the C flags is "-mavx" when compiling AVX.c using gcc. But it is none when using icc. I have tried to add c flags such as if (USING_INTEL AND (NOT MSVC)) set(C_AVX_FLAGS_ "-mavx" ) set(C_AVX2_FLAGS_ "-march=core-avx2" ) endif () to lib/TH/CMakefile.txt And it is OK. you can refer to the link @soumith would you like tell me if it is OK to compile torch7 with icc now.