Closed adrien806 closed 8 years ago
It builds ok for me. Can you do the following and check the problem does/doesnt still occur:
luarocks install torch
luarocks install nn
luarocks install cltorch
luarocks install clnn
Ah, seems travis, on Mac OS X, has the same issue, https://travis-ci.org/hughperkins/clnn/builds/107116666 Hmmm.
Can you confirm what platform you are on please?
EDIT: post-typo
I am on Mac OS 10.11.3
To confirm, all the master branches are now in sync - so we can disregard the "bleeding edge" instructions?
I ran
luarocks install torch luarocks install nn luarocks install cltorch luarocks install clnn
And clnn did not build.
sorry, I meant luarocks install torch
, corrected this above.
Corrected as well.
I am on Mac OS 10.11.3
yes, I think it's a problem specific to Mac OS X. Luckily, I do have Mac OS X build on travis, so I can try .. stuff... see if I can fix it. If you happen to have any ideas in the meantime please let me know. It problably involves a combination of one or both of the following mac-specific things:
Seems the symbols really are needed, so it's probably to do with the first issue.
I've moved common.cpp/.h into lib/THCLNN directory/dylib. That hopefully eliminates the build errors with GET_BLOCKS and GET_CL_NUM_THREADS. Then, (if those are fixed), "just" need to fix the issues with the TemplatedKernel symbols (which are in libEasylCL, I think)
Indeed, the missing symbols are now from the classes TemplatedKernel and EasyCL.
So, basically, on linux, by doing objdump somelib.so | grep NEEDED
, starting with build/lib/THCLNN/lib/libTHCLNN.so
, we have the following chain of dependencies:
Unfortunately, libTHCLNN.so needs a couple of symbols from libEasyCL.so, and, on Mac, these are not available to libTHCLNN.so by default. Needs some magic linking options I think.
Edit: Update: the GET_BLOCKS and GET_CL_NUM_THREADS errors have now disappeared https://travis-ci.org/hughperkins/clnn/builds/107120893 Editedit: ah you saw that too :-)
Ah, the easiest way to try it I think is something like:
git clone https://github.com/hughperkins/clnn.git
cd clnn
luarocks make rocks/clnn-scm-1.rockspec
Once you've done this once, then you can run cmake directly:
cd build
# if you want, you can run ccmake from here, like: ccmake ..
# otherwise, directly:
make
Thanks, as far as I know the directory where shared libraries are looked up is different on Mac.
But it could just be that the install/lib/ torch folder does not have a libEasyCL.so, but a libEasyCL.dylib (http://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx)
Yeah, when I say .so
on mac, that will sometimes be .dylib
, sometimes .so
, depending on the linker options supplied.
I've added EasyCL as a direct dependency of THCLNN, maybe that will help. But I should go to bed now-ish really, so I will check in the morning. https://github.com/hughperkins/clnn/commit/19ab3b5f8d7229cefe73e88f92782f97827ecb05
Built ok too, thanks for the help.
Cool :-)
Hi Hugh, I believe there is a link error in the current thnn4 / master branch. The function GET_BLOCKS is in common.h, which has been compiled correctly
Thanks in advance for the help.