facebookarchive/thpp

New build error

Opened this issue · 26 comments

It looks like a change in folly over the past few days has broken thpp builds:

[  7%] Generating thpp/if/gen-cpp2/Tensor_types.h, thpp/if/gen-cpp2/Tensor_types.tcc, thpp/if/gen-cpp2/Tensor_constants.h, thpp/if/gen-cpp2/Tensor_types.cpp, thpp/if/gen-cpp2/Tensor_constants.cpp
Scanning dependencies of target thpp
[ 15%] Building CXX object CMakeFiles/thpp.dir/Storage.cpp.o
/thpp/thpp/Storage.cpp: In function 'void thpp::detail::applySharingMode(folly::IOBuf&, thpp::SharingMode)':
/thpp/thpp/Storage.cpp:66:9: error: 'class folly::IOBuf' has no member named 'makeManagedOne'
     iob.makeManagedOne();
         ^
make[2]: *** [CMakeFiles/thpp.dir/Storage.cpp.o] Error 1
make[1]: *** [CMakeFiles/thpp.dir/all] Error 2
make: *** [all] Error 2

This is from trying to rebuild a Docker that built properly a week ago.

Can someone confirm and advise? Thanks.

Tagging this @soumith because this seems to break fbcunn building.

i've tagged the stable versions of fbtorch, fbcunn, fbnn, fblualib, thpp to v1.0
I'm in the process of updating all these packages. Can you use the tagged versions, that should fix it.

it's a bit of an effort that takes 2-3 days of pushing the packages, and fixing builds for another 2-3 days, sorry you were caught in the transition.

Thanks! If the end result is all of the packages now sync and build with current versions, then it's well worth the wait!

In the meantime my old docker image still works.

Is there any way I can help you?

On Mar 4, 2016, at 12:09 PM, Soumith Chintala notifications@github.com wrote:

it's a bit of an effort that takes 2-3 days of pushing the packages, and fixing builds for another 2-3 days, sorry you were caught in the transition.


Reply to this email directly or view it on GitHub.

@soumith Here's what I get with the v1.0 versions of those five packages and the current head from folly and fbthrift. I'm putting this here rather than fbcunn to try to keep it all in one place.

BTW - I'm able to work with my docker image from last week. I'm putting this here to try to be helpful to you.

[ 47%] Building CXX object CMakeFiles/fbcunnlayers_cuda.dir/src/fft/SpatialConvolutionCuFFT.cpp.o
/fbcunn/src/fft/SpatialConvolutionCuFFT.cpp: In member function 'facebook::deeplearning::torch::detail::cufftPlan* facebook::deeplearning::torch::detail::CuFFTBuffers<FFTDim>::plan(THCState*, THCudaTensor*, THCudaTensor*, facebook::deeplearning::torch::FFTParameters, uint32_t)':                                                                                                                         
/fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:250:63: error: no matching function for call to 'make_unique(int&)'                                                                                         
     auto h = folly::make_unique<cufftPlan, CuFFTPlanDeleter>(p);                                                                                                                                       
                                                               ^                                                                                                                                        
/fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:250:63: note: candidates are:                                                                                                                               
In file included from /usr/local/include/folly/io/Cursor.h:31:0,                                                                                                                                        
                 from /usr/local/include/thpp/if/gen-cpp2/Tensor_types.h:13,                                                                                                                            
                 from /usr/local/include/thpp/Storage.h:15,                                                                                                                                             
                 from /usr/local/include/thpp/Tensor.h:18,                                                                                                                                              
                 from /fbcunn/src/fft/Utils.h:5,                                                                                                                                                        
                 from /fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:11:                                                                                                                                   
/usr/local/include/folly/Memory.h:49:1: note: template<class T, class ... Args> typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type folly::make_unique(Args&& ...)                                                                                                                                                                                         
 make_unique(Args&&... args) {                                                                                                                                                                          
 ^                                                                                                                                                                                                      
/usr/local/include/folly/Memory.h:49:1: note:   template argument deduction/substitution failed:                                                                                                        
/fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:250:63: note:   cannot convert 'p' (type 'int') to type 'facebook::deeplearning::torch::detail::CuFFTPlanDeleter&&'                                         
     auto h = folly::make_unique<cufftPlan, CuFFTPlanDeleter>(p);                                                                                                                                       
                                                               ^                                                                                                                                        
In file included from /usr/local/include/folly/io/Cursor.h:31:0,                                                                                                                                        
                 from /usr/local/include/thpp/if/gen-cpp2/Tensor_types.h:13,                                                                                                                            
                 from /usr/local/include/thpp/Storage.h:15,                                                                                                                                             
                 from /usr/local/include/thpp/Tensor.h:18,                                                                                                                                              
                 from /fbcunn/src/fft/Utils.h:5,                                                                                                                                                        
                 from /fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:11:
/usr/local/include/folly/Memory.h:56:1: note: template<class T> typename std::enable_if<std::is_array< <template-parameter-1-1> >::value, std::unique_ptr<T> >::type folly::make_unique(size_t)
 make_unique(const size_t n) {
 ^
/usr/local/include/folly/Memory.h:56:1: note:   template argument deduction/substitution failed:
/fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:250:63: error: wrong number of template arguments (2, should be 1)
     auto h = folly::make_unique<cufftPlan, CuFFTPlanDeleter>(p);
                                                               ^
In file included from /usr/local/include/folly/io/Cursor.h:31:0,
                 from /usr/local/include/thpp/if/gen-cpp2/Tensor_types.h:13,
                 from /usr/local/include/thpp/Storage.h:15,
                 from /usr/local/include/thpp/Tensor.h:18,
                 from /fbcunn/src/fft/Utils.h:5,
                 from /fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:11:
/usr/local/include/folly/Memory.h:64:1: note: template<class T, class ... Args> typename std::enable_if<(std::extent<_Tp>::value != 0), std::unique_ptr<T> >::type folly::make_unique(Args&& ...) <deleted>
 make_unique(Args&&...) = delete;
 ^
/usr/local/include/folly/Memory.h:64:1: note:   template argument deduction/substitution failed:
/usr/local/include/folly/Memory.h: In substitution of 'template<class T, class ... Args> typename std::enable_if<(std::extent<_Tp>::value != 0), std::unique_ptr<T> >::type folly::make_unique(Args&& ...) [with T = int; Args = {facebook::deeplearning::torch::detail::CuFFTPlanDeleter}]':
/fbcunn/src/fft/SpatialConvolutionCuFFT.cpp:250:63:   required from here
/usr/local/include/folly/Memory.h:64:1: error: no type named 'type' in 'struct std::enable_if<false, std::unique_ptr<int, std::default_delete<int> > >'
make[2]: *** [CMakeFiles/fbcunnlayers_cuda.dir/src/fft/SpatialConvolutionCuFFT.cpp.o] Error 1
make[1]: *** [CMakeFiles/fbcunnlayers_cuda.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed installing.
Updating manifest for /distro/install/lib/luarocks/rocks
multikey 0.3-2 is now built and installed in /distro/install/ (license: MIT)

   git submodule init
   git submodule update
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/distro/install/bin/.." -DCMAKE_INSTALL_PREFIX="/distro/install/lib/luarocks/rocks/fbcunn/scm-1"

cd build && make install
The command '/bin/sh -c git clone -b v1.0 https://github.com/facebook/fbcunn.git &&     cd fbcunn &&    luarocks make rocks/fbcunn-scm-1.rockspec &&    cd ..' returned a non-zero code: 1

@elbamos thanks for the debug. The tagged v1.0 versions will not build with folly HEAD. They will build with these folly and thrift versions: https://github.com/facebook/fblualib/blob/v1.0/install_all.sh#L83-L84

anoe commented

Any progress on this? I'm getting the same bug on a brand new installation of Ubuntu 14.04

no, but i can fix the install_all.sh script to point to tagged versions, let me just do that in a sec.

@anoe I was able to make a working docker with the full fbcunn suite; would that be helpful?

On Mar 14, 2016, at 12:28 AM, anoe notifications@github.com wrote:

Any progress on this? I'm getting the same bug on a brand new installation of Ubuntu 14.04


Reply to this email directly or view it on GitHub.

@anoe i now pushed install_all.sh here: https://github.com/facebook/fblualib/blob/master/install_all.sh to checkout the tagged versions correctly.

anoe commented

Thanks for the swift response, guys! @soumith, the new install script got me further, but now it stalls when installing mattorch:

CMake Error at CMakeLists.txt:25 (FIND_PACKAGE):
By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Torch", but
CMake did not find one.

Could not find a package configuration file provided by "Torch" with any of
the following names:

TorchConfig.cmake
torch-config.cmake

Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set
"Torch_DIR" to a directory containing one of the above files. If "Torch"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!
See also "/tmp/fblualib-build.crQ8my/fblualib/fblualib/mattorch/build/CMakeFiles/CMakeOutput.log".

@soumith - I just want to thank you for all of this. These packages are an important contribution to the ML community. And you've been incredibly responsive and helpful for everybody, maintaining a large body of very sophisticated code it seems essentially on your own, even though you must be incredibly busy with your research. So, just letting you know it's appreciated!

On Mar 14, 2016, at 1:13 AM, Soumith Chintala notifications@github.com wrote:

@anoe i now pushed install_all.sh here: https://github.com/facebook/fblualib/blob/master/install_all.sh to checkout the tagged versions correctly.


Reply to this email directly or view it on GitHub.

@anoe Do you want my docker files?

anoe commented

@elbamos, that would be great - thanks! Maybe you can shoot me an email? anderso@cs.cmu.edu

I am using the latest install_all.sh and is still getting the error the same as the one posted at the beginning of this thread:

-- Build files have been written to: /tmp/fblualib-build.B9vMEB/thpp/thpp/build
[  7%] Generating thpp/if/gen-cpp2/Tensor_types.h, thpp/if/gen-cpp2/Tensor_types.tcc, thpp/if/gen-cpp2/Tensor_constants.h, thpp/if/gen-cpp2/Tensor_types.cpp, thpp/if/gen-cpp2/Tensor_constants.cpp
Scanning dependencies of target thpp
[ 15%] Building CXX object CMakeFiles/thpp.dir/Storage.cpp.o
/tmp/fblualib-build.B9vMEB/thpp/thpp/Storage.cpp: In function ‘void thpp::detail::applySharingMode(folly::IOBuf&, thpp::SharingMode)’:
/tmp/fblualib-build.B9vMEB/thpp/thpp/Storage.cpp:66:9: error: ‘class folly::IOBuf’ has no member named ‘makeManagedOne’
     iob.makeManagedOne();
         ^
make[2]: *** [CMakeFiles/thpp.dir/Storage.cpp.o] Error 1
make[1]: *** [CMakeFiles/thpp.dir/all] Error 2
make: *** [all] Error

I am not familiar with docker files. Any progress on this problem?

Although "come back and build another day" doesn't sound like a legit solution. But I tried again today and everything runs through!

The script that succeed on my computer is the correctly tagged version provided by @soumith above:
https://github.com/facebook/fblualib/blob/master/install_all.sh

This issue has not been solved yet. @soumith Can you please look into this?

in my case this commit still didn't work causing this problem
#11

so just with thpp from
git clone -b v1.0 https://github.com/facebook/thpp

i manually downloaded googletest-release-1.7.0.zip provided from here, unzip it
and renamed as gtest-1.7.0 and uncomment build.sh 30~37 lines.

Then proceed building fblualib and succefully installed fblualib.

I did the same. @soumith, can you update the fblualib script to call the correct version of thpp?

Same error here than @junhocho and @kvrd18 .

@junhocho I suppose that lines 30~37 are to be commented and that you downloaded gtest from https://github.com/google/googletest/releases/tag/release-1.7.0 ?

Yes

I was able to go through thpp installation thanks @junhocho :-)

Nonetheless, fblualib, the last software to be installed by install_all.sh, cannot be compiled.

My guess is that the thpp version tagged as v1.0 is not compatible with the current fblualib master (?)

The error lies in CMakeFiles/lua_module.dir/MatTorch.cpp (complete trace below).

That being said I didn't found anyone with the same error elsewhere using a search engine, and I suspect that you would have encountered the same issue few days ago in your build ? Is it a follow-up of this current issue ?

satin@satin-physexp1:/tmp/fblualib-build.2qe0YK/fblualib/fblualib# ./build.sh 
-- Found Torch7 in /home/satin/torch/install
-- Found Folly: /usr/local/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/fblualib-build.2qe0YK/fblualib/fblualib/build
Scanning dependencies of target fblualib
[100%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
Linking CXX shared library libfblualib.so
[100%] Built target fblualib
[100%] Built target fblualib
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libfblualib.so
-- Set runtime path of "/usr/local/lib/libfblualib.so" to "$ORIGIN/../lib:/home/satin/torch/install/lib:/usr/local/lib"
-- Installing: /usr/local/include/fblualib/LuaUtils.h
-- Installing: /usr/local/include/fblualib/LuaUtils-inl.h
        cmake -E make_directory build &&
        cd build &&
        cmake -DROCKS_PREFIX=/home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1 \
              -DROCKS_LUADIR=/home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua \
              -DROCKS_LIBDIR=/home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lib \
              .. &&
        make

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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 Folly: /usr/local/include  
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ROCKS_PREFIX


-- Build files have been written to: /tmp/fblualib-build.2qe0YK/fblualib/fblualib/util/build
Scanning dependencies of target fbutil
[100%] Building CXX object CMakeFiles/fbutil.dir/Util.cpp.o
Linking CXX shared module libfbutil.so
[100%] Built target fbutil
        cd build && make install

[100%] Built target fbutil
Install the project...
-- Install configuration: ""
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lib/libfbutil.so
-- Set runtime path of "/home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lib/libfbutil.so" to "/usr/local/lib"
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/trace.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/init.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/multi_level.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/timing.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/stats.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/reactor.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/dbg.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/digraph.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/file.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/error.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbutil/0.1-1/lua/fb/util/data.lua
Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for cudnn scm-1: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for cutorch scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for nnx 0.1-1: torch >= 7.0
fbutil 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for cudnn scm-1: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for nnx 0.1-1: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for cutorch scm-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
fbluaunit 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
Missing dependency for nnx 0.1-1: torch >= 7.0
Missing dependency for cutorch scm-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for cudnn scm-1: torch >= 7.0
fbcomplex 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

        cmake -E make_directory build &&
        cd build &&
        cmake -DROCKS_PREFIX=/home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1 \
              -DROCKS_LUADIR=/home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lua \
              -DROCKS_LIBDIR=/home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lib \
              .. &&
        make

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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 Folly: /usr/local/include  
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ROCKS_PREFIX


-- Build files have been written to: /tmp/fblualib-build.2qe0YK/fblualib/fblualib/ffivector/build
Scanning dependencies of target ffivector
[100%] Building CXX object CMakeFiles/ffivector.dir/FFIVector.cpp.o
Linking CXX shared module libffivector.so
[100%] Built target ffivector
        cd build && make install

[100%] Built target ffivector
Install the project...
-- Install configuration: ""
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lib/libffivector.so
-- Set runtime path of "/home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lib/libffivector.so" to "/usr/local/lib"
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lua/fb
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lua/fb/ffivector
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbffivector/0.1-1/lua/fb/ffivector/init.lua
Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for nnx 0.1-1: torch >= 7.0
Missing dependency for cudnn scm-1: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for cutorch scm-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
fbffivector 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

        cmake -E make_directory build &&
        cd build &&
        cmake -DROCKS_PREFIX=/home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1 \
              -DROCKS_LUADIR=/home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua \
              -DROCKS_LIBDIR=/home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lib \
              .. &&
        make

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ROCKS_LIBDIR
    ROCKS_PREFIX


-- Build files have been written to: /tmp/fblualib-build.2qe0YK/fblualib/fblualib/editline/build
        cd build && make install

Install the project...
-- Install configuration: ""
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb/editline
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb/editline/init.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb/editline/completer.lua
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb/editline
-- Installing: /home/satin/torch/install/lib/luarocks/rocks/fbeditline/0.1-1/lua/fb/editline/_config.lua
Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for cutorch scm-1: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for cudnn scm-1: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for nnx 0.1-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
fbeditline 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for nnx 0.1-1: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for cudnn scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
Missing dependency for cutorch scm-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
fbtrepl 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

Updating manifest for /home/satin/torch/install/lib/luarocks/rocks
Missing dependency for graph scm-1: torch >= 7.0
Missing dependency for cunn scm-1: torch >= 7.0
Missing dependency for qttorch scm-1: torch >= 7.0
Missing dependency for image 1.1.alpha-0: torch >= 7.0
Missing dependency for nnx 0.1-1: torch >= 7.0
Missing dependency for nn scm-1: torch >= 7.0
Missing dependency for gnuplot scm-1: torch >= 7.0
Missing dependency for xlua 1.0-0: torch >= 7.0
Missing dependency for trepl scm-1: torch >= 7.0
Missing dependency for threads scm-1: torch >= 7.0
Missing dependency for sys 1.1-0: torch >= 7.0
Missing dependency for cudnn scm-1: torch >= 7.0
Missing dependency for optim 1.0.5-0: torch >= 7.0
Missing dependency for nngraph scm-1: torch >= 7.0
Missing dependency for env scm-1: torch >= 7.0
Missing dependency for cutorch scm-1: torch >= 7.0
fbdebugger 0.1-1 is now built and installed in /home/satin/torch/install/ (license: BSD)

        cmake -E make_directory build &&
        cd build &&
        cmake -DROCKS_PREFIX=/home/satin/torch/install/lib/luarocks/rocks/fbmattorch/0.1-1 \
              -DROCKS_LUADIR=/home/satin/torch/install/lib/luarocks/rocks/fbmattorch/0.1-1/lua \
              -DROCKS_LIBDIR=/home/satin/torch/install/lib/luarocks/rocks/fbmattorch/0.1-1/lib \
              .. &&
        make

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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 Folly: /usr/local/include  
-- Found Glog: /usr/include  
-- Found Torch7 in /home/satin/torch/install
-- Found Folly: /usr/local/include  
-- Found Folly: /usr/local/include  
-- Found Folly: /usr/include  
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ROCKS_PREFIX


-- Build files have been written to: /tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/build
Scanning dependencies of target lua_module
[100%] Building CXX object CMakeFiles/lua_module.dir/MatTorch.cpp.o
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp:252:1: error: elements of array ‘const {anonymous}::luaL_reg {anonymous}::matlab []’ have incomplete type
 };
 ^
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp:252:1: error: storage size of ‘{anonymous}::matlab’ isn’t known
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp: In function ‘int luaopen_fb_mattorch_lib(lua_State*)’:
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp:258:35: error: ‘luaL_register’ was not declared in this scope
   luaL_register(L, nullptr, matlab);
                                   ^
make[2]: *** [CMakeFiles/lua_module.dir/MatTorch.cpp.o] Error 1
make[1]: *** [CMakeFiles/lua_module.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.
        cmake -E make_directory build &&
        cd build &&
        cmake -DROCKS_PREFIX=/usr/local/lib/luarocks/rocks/fbmattorch/0.1-1 \
              -DROCKS_LUADIR=/usr/local/lib/luarocks/rocks/fbmattorch/0.1-1/lua \
              -DROCKS_LIBDIR=/usr/local/lib/luarocks/rocks/fbmattorch/0.1-1/lib \
              .. &&
        make

-- Found Folly: /usr/local/include  
-- Found Torch7 in /home/satin/torch/install
-- Found Folly: /usr/local/include  
-- Found Folly: /usr/local/include  
-- Found Folly: /usr/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/build
[100%] Building CXX object CMakeFiles/lua_module.dir/MatTorch.cpp.o
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp:252:1: error: elements of array ‘const {anonymous}::luaL_reg {anonymous}::matlab []’ have incomplete type
 };
 ^
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp:252:1: error: storage size of ‘{anonymous}::matlab’ isn’t known
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp: In function ‘int luaopen_fb_mattorch_lib(lua_State*)’:
/tmp/fblualib-build.2qe0YK/fblualib/fblualib/mattorch/MatTorch.cpp:258:35: error: ‘luaL_register’ was not declared in this scope
   luaL_register(L, nullptr, matlab);
                                   ^
make[2]: *** [CMakeFiles/lua_module.dir/MatTorch.cpp.o] Error 1
make[1]: *** [CMakeFiles/lua_module.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.`
`

So, I've done everything you @cgravier and @junhocho did but I still encounter the following error:

In file included from thpp/detail/TensorGeneric.h:1:0,
                 from /root/torch/install/include/TH/THGenerateFloatTypes.h:10,
                 from /root/torch/install/include/TH/THGenerateAllTypes.h:10,
                 from /tmp/fblualib-build.dwadN8/thpp/thpp/../thpp/detail/Tensor.h:28,
                 from /tmp/fblualib-build.dwadN8/thpp/thpp/../thpp/Tensor.h:19,
                 from /tmp/fblualib-build.dwadN8/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.dwadN8/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<float>::_max(THFloatTensor*, THLongTensor*, THFloatTensor*, int)':
/tmp/fblualib-build.dwadN8/thpp/thpp/../thpp/detail/TensorGeneric.h:191:50: error: too few arguments to function 'void THFloatTensor_max(THFloatTensor*, THLongTensor*, THFloatTensor*, int, int)'
     return THTensor_(max)(values, indices, t, dim);

And much much more.

twmht commented

same errors here in ubuntu 14.04

@synchro-- This commit should solve that specific issue:

d9f982c#diff-22577c98d557ea9eca089e8e84d7f98d

You have to add ', 1' in those 4 lines.

thanks,@jgoenetxea , the right answer.