hughperkins / cltorch

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

Error in git submodule while building cltorch #22

Closed manjunaths closed 8 years ago

manjunaths commented 8 years ago
[blah@blah01]$ luarocks make rocks/cltorch-scm-1.rockspec
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH="/usr2/manju/Moonshot/DeepLearning/mic/distro/install/bin/.." -DCMAKE_INSTALL_PREFIX="/usr2/manju/Moonshot/DeepLearning/mic/distro/install/lib/luarocks/rocks/cltorch/scm-1" && make -j$(getconf _NPROCESSORS_ONLN) install

-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Torch7 in /usr2/manju/Moonshot/DeepLearning/mic/distro/install
/usr2/manju/Moonshot/DeepLearning/mic/cltorch/build
/usr2/manju/Moonshot/DeepLearning/mic/cltorch
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   CMakeLists.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
CMAKE_INSTALL_PREFIX /usr2/manju/Moonshot/DeepLearning/mic/distro/install
CMAKE_INSTALL_PREFIX /usr2/manju/Moonshot/DeepLearning/mic/distro/install
CLBLAS_INCLUDE_DIRS /usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/clMathLibraries/clBLAS/src;/usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/EasyCL/thirdparty/clew/include/proxy-opencl
DEEPCL_LIBRARIES /usr2/manju/Moonshot/DeepLearning/mic/distro/install/lib/libEasyCL.so;/usr2/manju/Moonshot/DeepLearning/mic/distro/install/lib/libclew.so
git version 1.7.1
-- Configuring done
-- Generating done
-- Build files have been written to: /usr2/manju/Moonshot/DeepLearning/mic/cltorch/build
[  1%] Scanning dependencies of target git_cltorch_rec
Scanning dependencies of target easycl_delete_stamp
Generating TensorMath.c
default
default
default
default
default
default
default
default
default
default
[  1%] Built target easycl_delete_stamp
Usage: git submodule [--quiet] add [-b branch] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--] [<path>...]
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%] [  6%] [  6%] [ 10%] [ 10%] [ 13%] [ 13%] Building CXX object CMakeFiles/cltorch_static.dir/src/UserKernel.cpp.o
Building CXX object CMakeFiles/cltorch_static.dir/src/init.cpp.o
Building CXX object CMakeFiles/cltorch_static.dir/src/Storage.cpp.o
Building CXX object CMakeFiles/cltorch_static.dir/src/Tensor.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 /usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/Storage.cpp:38:
/usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/torch/generic/Storage.cpp: In function ‘int torch_ClStorage_new(lua_State*)’:
/usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/torch/generic/Storage.cpp:23: warning: ‘storage’ may be used uninitialized in this function
In file included from /usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/Tensor.cpp:28:
/usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/torch/generic/Tensor.cpp: In function ‘int torch_ClTensor_indexSelect(lua_State*)’:
/usr2/manju/Moonshot/DeepLearning/mic/cltorch/src/torch/generic/Tensor.cpp:585: warning: ‘tensor’ may be used uninitialized in this function
Linking CXX static library libcltorch.a
[ 13%] Built target cltorch_static
make: *** [all] Error 2

Error: Build error: Failed building.

I made this change

[blah@blah cltorch]$ git diff CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb0c87c..8d351a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,11 +78,11 @@ endif(DEV_RUN_COG)
         set( GIT_FOUND 1 )
     endif()
     if( GIT_FOUND )
-        add_custom_target(
-            git_cltorch_rec
-            git submodule update --init --force --recursive
-            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        )
+        # add_custom_target(
+        #     git_cltorch_rec
+        #     git submodule update --init --force --recursive
+        #     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        # )
         add_dependencies( cltorch git_cltorch_rec )
         add_dependencies( clBLAS-external git_cltorch_rec )
         add_dependencies( EasyCL-external git_cltorch_rec )

and the build seems to go through. What is git submodule doing ? Running it manually also in the ${TOPDIR} gives the same error.

hughperkins commented 8 years ago

Ok, interesting.

What is git submodule doing ?

It's making sure your submodules are up-to-date. It runs git --init --force --recursive, as you see. It looks like we have two different versions of git: I'm using 1.9.1, and you're using 1.7.1. I'm guessing that git --init --force --recursive doesnt work on 1.7.1? Maybe can replace with something like:

git submodule init
cd src/EasyCL
git submodule init
cd ../..
git submodule update --recursive

?

(I think that there are two test-cases/use-cases:

  1. If someone does git clone, without recursive, followed by luarocks make rocks/cltorch-scm-1.rockspec, does cltorch build and instlal correctly?)
  2. if one of the submodules is updated, and someone does git pull, and rebuilds, will the rebuild pull in the latest submodule modifications? )
hughperkins commented 8 years ago

This is really old. Close it?