Open davidstutz opened 7 years ago
@davidstutz the last part is wrong, i.e. "build" and "make / make install".
You need to do:
luarocks make rocks/torch-scm-1.rockspec
The rest of what you described seems correct.
That didn't work either. Tried it before resorting to CMake and doing make
and make install
and inspecting the generated libraries. Actually, I started by following your post in the Google group.
Essentially the luarocks make
command only invokes CMake, make
and make install
, right?
Hi,
I am trying to add new operations to Torch tensors. I looked at several pull requests (.e.g here) to learn how to integrate new operations. So let's assume I want to add a
signtest
function which simply copiessign
. So I adapt the corresponding files, i.e. I addvoid THTensor_(signtest)(THTensor *r_, THTensor *t)
inTHTensorMath.h
and implement it inTHTensorMath.c
. Then I adaptTensorMath.lua
by copying theẁrap
entry forsign
:I go to
build/
and domake
andmake install
. I see that the corresponding libraries are correctly updated. Confirming usingnm
shows that the shared object files include the added operation:in both
libtorch.so
andlibTH.so
. Everything seems fine. To be sure I restart the console, runth
and see thattorch.signtest
isnil
.I installed Torch using torch/distro. The above can be reproduced when I completely reinstall Torch (using the distro) and making these changes before the new installation. It is the same when implementing new operations or renaming/copying/removing other operations.
I guess that I am missing a crucial step when building and installing Torch. But where is my error? Help is really appreciated! Thanks.