hughperkins / cltorch

An OpenCL backend for torch.
Other
289 stars 26 forks source link

You need to run this command from the toplevel of the working tree. #20

Closed manjunaths closed 8 years ago

manjunaths commented 8 years ago

When I try to do luarocks install cltorch I get the below error

[  1%] Built target easycl_delete_stamp
You need to run this command from the toplevel of the working tree.
make[2]: *** [CMakeFiles/git_cltorch_rec] Error 1
make[1]: *** [CMakeFiles/git_cltorch_rec.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

The full error message

git version 1.8.3.1
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/build
[  1%] Scanning dependencies of target easycl_delete_stamp
Scanning dependencies of target git_cltorch_rec
Generating TensorMath.c
default
default
default
default
default
default
default
default
default
default
[  1%] Built target easycl_delete_stamp
You need to run this command from the toplevel of the working tree.
make[2]: *** [CMakeFiles/git_cltorch_rec] Error 1
make[1]: *** [CMakeFiles/git_cltorch_rec.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Scanning dependencies of target cltorch_static
[  3%] [  5%] [  6%] [  8%] [ 10%] [ 12%] [ 13%] Building CXX object CMakeFiles/cltorch_static.dir/src/UserKernel.cpp.o
Building CXX object CMakeFiles/cltorch_static.dir/src/Tensor.cpp.o
Building CXX object CMakeFiles/cltorch_static.dir/src/Storage.cpp.o
Building CXX object CMakeFiles/cltorch_static.dir/src/init.cpp.o
Building C object CMakeFiles/cltorch_static.dir/src/torch/utils.c.o
Building C object CMakeFiles/cltorch_static.dir/TensorMath.c.o
Building C object CMakeFiles/cltorch_static.dir/src/TensorOperator.c.o
In file included from /tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/src/Storage.cpp:38:0:
/tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/src/torch/generic/Storage.cpp: In function ‘int torch_ClStorage_new(lua_State*)’:
/tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/src/torch/generic/Storage.cpp:103:44: warning: ‘storage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   luaT_pushudata(L, storage, torch_Storage);
                                            ^
In file included from /tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/src/Tensor.cpp:28:0:
/tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/src/torch/generic/Tensor.cpp: In function ‘int torch_ClTensor_indexSelect(lua_State*)’:
/tmp/luarocks_cltorch-scm-1-5337/cltorch/cltorch/src/torch/generic/Tensor.cpp:596:42: warning: ‘tensor’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     luaT_pushudata(L,tensor,torch_Tensor);
                                          ^
Linking CXX static library libcltorch.a
[ 13%] Built target cltorch_static
make: *** [all] Error 2

Error: Build error: Failed building.

Is there a way to fix this ?

hughperkins commented 8 years ago

I'm not sure. Can you try installing in a different way, as follows, and see what happens please? :

git clone --recursive https://github.com/hughperkins/cltorch.git
cd cltorch
luarocks make rocks/cltorch-scm-1.rockspec
manjunaths commented 8 years ago

I get the same error with the above command too.

hughperkins commented 8 years ago

Please paste the full output here. I reckon it should look quite different from the output of the earlier command. (Edit: and plus, I'm kind of out of ideas at the moment, so searching for any clues I can find... :-( )

manjunaths commented 8 years ago

In the CMakeLists.txt file on line 84 there is an add_custom_target call. I changed the call from

        add_custom_target(
            git_cltorch_rec
            git submodule update --init --force --recursive
        )

to

        add_custom_target(
            git_cltorch_rec
            git submodule update --init --force --recursive
            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        )

and it seems to be working now.

hughperkins commented 8 years ago

Interesting. Thanks! :-) Will try this :-)

hughperkins commented 8 years ago

Merged, https://github.com/hughperkins/cltorch/commit/62a673bab5a8d5cba1087e7af10b70fa411b171c Thanks!