Open zoe218 opened 7 years ago
Your compiler is complaining about a modern feature. Is your compiler up to date? More information about your build environment would be useful.
I don't know what you exactly mean, I copy the more info, can you help me? @Endofunctor
echo 'Installing TH++' Installing TH++
echo
cd /tmp/fblualib-build.QRGz7W/thpp/thpp
./build.sh
If you don't have folly or thrift installed, try doing
THPP_NOFB=1 ./build.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 129 0 129 0 0 95 0 --:--:-- 0:00:01 --:--:-- 95
100 618k 100 618k 0 0 43431 0 0:00:14 0:00:14 --:--:-- 101k
curl: Saved to filename 'googletest-release-1.7.0.zip'
Archive: googletest-release-1.7.0.zip
c99458533a9b4c743ed51537e25989ea55944908
creating: googletest-release-1.7.0/
inflating: googletest-release-1.7.0/CHANGES
inflating: googletest-release-1.7.0/CMakeLists.txt
inflating: googletest-release-1.7.0/CONTRIBUTORS
inflating: googletest-release-1.7.0/LICENSE
inflating: googletest-release-1.7.0/Makefile.am
inflating: googletest-release-1.7.0/README
creating: googletest-release-1.7.0/build-aux/
extracting: googletest-release-1.7.0/build-aux/.keep
creating: googletest-release-1.7.0/cmake/
inflating: googletest-release-1.7.0/cmake/internal_utils.cmake
creating: googletest-release-1.7.0/codegear/
inflating: googletest-release-1.7.0/codegear/gtest.cbproj
inflating: googletest-release-1.7.0/codegear/gtest.groupproj
inflating: googletest-release-1.7.0/codegear/gtest_all.cc
inflating: googletest-release-1.7.0/codegear/gtest_link.cc
inflating: googletest-release-1.7.0/codegear/gtest_main.cbproj
inflating: googletest-release-1.7.0/codegear/gtest_unittest.cbproj
inflating: googletest-release-1.7.0/configure.ac
creating: googletest-release-1.7.0/include/
creating: googletest-release-1.7.0/include/gtest/
inflating: googletest-release-1.7.0/include/gtest/gtest-death-test.h
inflating: googletest-release-1.7.0/include/gtest/gtest-message.h
inflating: googletest-release-1.7.0/include/gtest/gtest-param-test.h
inflating: googletest-release-1.7.0/include/gtest/gtest-param-test.h.pump
inflating: googletest-release-1.7.0/include/gtest/gtest-printers.h
inflating: googletest-release-1.7.0/include/gtest/gtest-spi.h
inflating: googletest-release-1.7.0/include/gtest/gtest-test-part.h
inflating: googletest-release-1.7.0/include/gtest/gtest-typed-test.h
inflating: googletest-release-1.7.0/include/gtest/gtest.h
inflating: googletest-release-1.7.0/include/gtest/gtest_pred_impl.h
inflating: googletest-release-1.7.0/include/gtest/gtest_prod.h
creating: googletest-release-1.7.0/include/gtest/internal/
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-death-test-internal.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-filepath.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-internal.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-linked_ptr.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-param-util-generated.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-param-util-generated.h.pump
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-param-util.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-port.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-string.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-tuple.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-tuple.h.pump
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-type-util.h
inflating: googletest-release-1.7.0/include/gtest/internal/gtest-type-util.h.pump
creating: googletest-release-1.7.0/m4/
inflating: googletest-release-1.7.0/m4/acx_pthread.m4
inflating: googletest-release-1.7.0/m4/gtest.m4
creating: googletest-release-1.7.0/make/
inflating: googletest-release-1.7.0/make/Makefile
creating: googletest-release-1.7.0/msvc/
inflating: googletest-release-1.7.0/msvc/gtest-md.sln
inflating: googletest-release-1.7.0/msvc/gtest-md.vcproj
inflating: googletest-release-1.7.0/msvc/gtest.sln
inflating: googletest-release-1.7.0/msvc/gtest.vcproj
inflating: googletest-release-1.7.0/msvc/gtest_main-md.vcproj
inflating: googletest-release-1.7.0/msvc/gtest_main.vcproj
inflating: googletest-release-1.7.0/msvc/gtest_prod_test-md.vcproj
inflating: googletest-release-1.7.0/msvc/gtest_prod_test.vcproj
inflating: googletest-release-1.7.0/msvc/gtest_unittest-md.vcproj
inflating: googletest-release-1.7.0/msvc/gtest_unittest.vcproj
creating: googletest-release-1.7.0/samples/
inflating: googletest-release-1.7.0/samples/prime_tables.h
inflating: googletest-release-1.7.0/samples/sample1.cc
inflating: googletest-release-1.7.0/samples/sample1.h
inflating: googletest-release-1.7.0/samples/sample10_unittest.cc
inflating: googletest-release-1.7.0/samples/sample1_unittest.cc
inflating: googletest-release-1.7.0/samples/sample2.cc
inflating: googletest-release-1.7.0/samples/sample2.h
inflating: googletest-release-1.7.0/samples/sample2_unittest.cc
inflating: googletest-release-1.7.0/samples/sample3-inl.h
inflating: googletest-release-1.7.0/samples/sample3_unittest.cc
inflating: googletest-release-1.7.0/samples/sample4.cc
inflating: googletest-release-1.7.0/samples/sample4.h
inflating: googletest-release-1.7.0/samples/sample4_unittest.cc
inflating: googletest-release-1.7.0/samples/sample5_unittest.cc
inflating: googletest-release-1.7.0/samples/sample6_unittest.cc
inflating: googletest-release-1.7.0/samples/sample7_unittest.cc
inflating: googletest-release-1.7.0/samples/sample8_unittest.cc
inflating: googletest-release-1.7.0/samples/sample9_unittest.cc
creating: googletest-release-1.7.0/scripts/
inflating: googletest-release-1.7.0/scripts/fuse_gtest_files.py
inflating: googletest-release-1.7.0/scripts/gen_gtest_pred_impl.py
inflating: googletest-release-1.7.0/scripts/gtest-config.in
inflating: googletest-release-1.7.0/scripts/pump.py
creating: googletest-release-1.7.0/scripts/test/
inflating: googletest-release-1.7.0/scripts/test/Makefile
inflating: googletest-release-1.7.0/scripts/upload.py
inflating: googletest-release-1.7.0/scripts/upload_gtest.py
creating: googletest-release-1.7.0/src/
inflating: googletest-release-1.7.0/src/gtest-all.cc
inflating: googletest-release-1.7.0/src/gtest-death-test.cc
inflating: googletest-release-1.7.0/src/gtest-filepath.cc
inflating: googletest-release-1.7.0/src/gtest-internal-inl.h
inflating: googletest-release-1.7.0/src/gtest-port.cc
inflating: googletest-release-1.7.0/src/gtest-printers.cc
inflating: googletest-release-1.7.0/src/gtest-test-part.cc
inflating: googletest-release-1.7.0/src/gtest-typed-test.cc
inflating: googletest-release-1.7.0/src/gtest.cc
inflating: googletest-release-1.7.0/src/gtest_main.cc
creating: googletest-release-1.7.0/test/
inflating: googletest-release-1.7.0/test/gtest-death-test_ex_test.cc
inflating: googletest-release-1.7.0/test/gtest-death-test_test.cc
inflating: googletest-release-1.7.0/test/gtest-filepath_test.cc
inflating: googletest-release-1.7.0/test/gtest-linked_ptr_test.cc
inflating: googletest-release-1.7.0/test/gtest-listener_test.cc
inflating: googletest-release-1.7.0/test/gtest-message_test.cc
inflating: googletest-release-1.7.0/test/gtest-options_test.cc
inflating: googletest-release-1.7.0/test/gtest-param-test2_test.cc
inflating: googletest-release-1.7.0/test/gtest-param-test_test.cc
inflating: googletest-release-1.7.0/test/gtest-param-test_test.h
inflating: googletest-release-1.7.0/test/gtest-port_test.cc
inflating: googletest-release-1.7.0/test/gtest-printers_test.cc
inflating: googletest-release-1.7.0/test/gtest-test-part_test.cc
inflating: googletest-release-1.7.0/test/gtest-tuple_test.cc
inflating: googletest-release-1.7.0/test/gtest-typed-test2_test.cc
inflating: googletest-release-1.7.0/test/gtest-typed-test_test.cc
inflating: googletest-release-1.7.0/test/gtest-typed-test_test.h
inflating: googletest-release-1.7.0/test/gtest-unittest-api_test.cc
inflating: googletest-release-1.7.0/test/gtest_all_test.cc
inflating: googletest-release-1.7.0/test/gtest_break_on_failure_unittest.py
inflating: googletest-release-1.7.0/test/gtest_break_on_failureunittest.cc
inflating: googletest-release-1.7.0/test/gtest_catch_exceptions_test.py
inflating: googletest-release-1.7.0/test/gtest_catch_exceptionstest.cc
inflating: googletest-release-1.7.0/test/gtest_color_test.py
inflating: googletest-release-1.7.0/test/gtest_colortest.cc
inflating: googletest-release-1.7.0/test/gtest_env_var_test.py
inflating: googletest-release-1.7.0/test/gtest_env_vartest.cc
inflating: googletest-release-1.7.0/test/gtest_environment_test.cc
inflating: googletest-release-1.7.0/test/gtest_filter_unittest.py
inflating: googletest-release-1.7.0/test/gtest_filterunittest.cc
inflating: googletest-release-1.7.0/test/gtest_help_test.py
inflating: googletest-release-1.7.0/test/gtest_helptest.cc
inflating: googletest-release-1.7.0/test/gtest_list_tests_unittest.py
inflating: googletest-release-1.7.0/test/gtest_list_testsunittest.cc
inflating: googletest-release-1.7.0/test/gtest_main_unittest.cc
inflating: googletest-release-1.7.0/test/gtest_no_test_unittest.cc
inflating: googletest-release-1.7.0/test/gtest_output_test.py
inflating: googletest-release-1.7.0/test/gtest_outputtest.cc
inflating: googletest-release-1.7.0/test/gtest_output_test_golden_lin.txt
inflating: googletest-release-1.7.0/test/gtest_pred_impl_unittest.cc
inflating: googletest-release-1.7.0/test/gtest_premature_exit_test.cc
inflating: googletest-release-1.7.0/test/gtest_prod_test.cc
inflating: googletest-release-1.7.0/test/gtest_repeat_test.cc
inflating: googletest-release-1.7.0/test/gtest_shuffle_test.py
inflating: googletest-release-1.7.0/test/gtest_shuffletest.cc
inflating: googletest-release-1.7.0/test/gtest_sole_header_test.cc
inflating: googletest-release-1.7.0/test/gtest_stress_test.cc
inflating: googletest-release-1.7.0/test/gtest_test_utils.py
inflating: googletest-release-1.7.0/test/gtest_throw_on_failure_ex_test.cc
inflating: googletest-release-1.7.0/test/gtest_throw_on_failure_test.py
inflating: googletest-release-1.7.0/test/gtest_throw_on_failuretest.cc
inflating: googletest-release-1.7.0/test/gtest_uninitialized_test.py
inflating: googletest-release-1.7.0/test/gtest_uninitializedtest.cc
inflating: googletest-release-1.7.0/test/gtest_unittest.cc
inflating: googletest-release-1.7.0/test/gtest_xml_outfile1test.cc
inflating: googletest-release-1.7.0/test/gtest_xml_outfile2test.cc
inflating: googletest-release-1.7.0/test/gtest_xml_outfiles_test.py
inflating: googletest-release-1.7.0/test/gtest_xml_output_unittest.py
inflating: googletest-release-1.7.0/test/gtest_xml_outputunittest.cc
inflating: googletest-release-1.7.0/test/gtest_xml_test_utils.py
inflating: googletest-release-1.7.0/test/production.cc
inflating: googletest-release-1.7.0/test/production.h
creating: googletest-release-1.7.0/xcode/
creating: googletest-release-1.7.0/xcode/Config/
inflating: googletest-release-1.7.0/xcode/Config/DebugProject.xcconfig
inflating: googletest-release-1.7.0/xcode/Config/FrameworkTarget.xcconfig
inflating: googletest-release-1.7.0/xcode/Config/General.xcconfig
inflating: googletest-release-1.7.0/xcode/Config/ReleaseProject.xcconfig
inflating: googletest-release-1.7.0/xcode/Config/StaticLibraryTarget.xcconfig
inflating: googletest-release-1.7.0/xcode/Config/TestTarget.xcconfig
creating: googletest-release-1.7.0/xcode/Resources/
inflating: googletest-release-1.7.0/xcode/Resources/Info.plist
creating: googletest-release-1.7.0/xcode/Samples/
creating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/
inflating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/Info.plist
creating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/
inflating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj
inflating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/runtests.sh
inflating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/widget.cc
inflating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/widget.h
inflating: googletest-release-1.7.0/xcode/Samples/FrameworkSample/widget_test.cc
creating: googletest-release-1.7.0/xcode/Scripts/
inflating: googletest-release-1.7.0/xcode/Scripts/runtests.sh
inflating: googletest-release-1.7.0/xcode/Scripts/versiongenerate.py
creating: googletest-release-1.7.0/xcode/gtest.xcodeproj/
inflating: googletest-release-1.7.0/xcode/gtest.xcodeproj/project.pbxproj
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /home/zoe/torch/install
-- Found Folly: /usr/local/include
-- Found Thrift: /usr/local/include
-- Performing Test HAS_NO_AS_NEEDED
-- Performing Test HAS_NO_AS_NEEDED - Success
-- Found Glog: /usr/include
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/fblualib-build.QRGz7W/thpp/thpp/build
[ 5%] Generating thpp/if/gen-cpp2/Tensor_data.h, 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_data.cpp, thpp/if/gen-cpp2/Tensor_types.cpp, thpp/if/gen-cpp2/Tensor_constants.cpp
Scanning dependencies of target thpp
I see your compiler is GNU GCC 5.4.0. In your local repo can you edit this file:
https://github.com/facebook/thpp/blob/master/thpp/CMakeLists.txt#L45
from SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
to SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
and remove the build folder before running the build script again.
Pull request https://github.com/facebook/thpp/pull/32 is exactly this change.
I solved the error with your help, but I meet a new error: [ 20%] Building CXX object CMakeFiles/thpp.dir/thpp/if/gen-cpp2/Tensortypes.cpp.o In file included from /usr/local/include/thrift/lib/cpp2/GeneratedCodeHelper.h:20:0, from /home/zoe/fblualib/thpp/thpp/build/thpp/if/gen-cpp2/Tensortypes.tcc:15, from /home/zoe/fblualib/thpp/thpp/build/thpp/if/gen-cpp2/Tensor_types.cpp:9: /usr/local/include/thrift/lib/cpp2/FrozenTApplicationException.h:19:43: fatal error: thrift/lib/cpp2/frozen/Frozen.h: No such file or directory compilation terminated. CMakeFiles/thpp.dir/build.make:228: recipe for target 'CMakeFiles/thpp.dir/thpp/if/gen-cpp2/Tensor_types.cpp.o' failed make[2]: [CMakeFiles/thpp.dir/thpp/if/gen-cpp2/Tensor_types.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/thpp.dir/all' failed make[1]: [CMakeFiles/thpp.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2
I had installed the thrift... I'm so sorry to bother you, but I really have no idea..thank you so much~@Endofunctor
I am encountering error at this same step, where after changing the CXXFLAG
to gnu++14
the build process errors out at the following command. It seems to be an error caused due to bad interaction between existing TH
headers and the new THpp
but I could be wrong. I also tried THPP_NOFB=1 ./build.sh
and that also gives the same error.
# /usr/bin/c++ -Dthpp_EXPORTS -I/tmp/fblualib-build.XXXXXX/thpp/thpp/.. -I/tmp/fblualib-build.XXXXXX/thpp/thpp/build -I/root/torch/install/include -I/root/torch/install/include/TH -I/usr/local/includ\
e -I/tmp/fblualib-build.XXXXXX/thpp/thpp/googletest-release-1.7.0/include -std=gnu++14 -fPIC -o CMakeFiles/thpp.dir/TensorSerialization.cpp.o -c /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerializat\
ion.cpp
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.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<float> >::_max(THFloatTensor*, THLongTensor*, THFloatTen\
sor*, int)':
/tmp/fblualib-build.XXXXXX/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);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:73:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(max)(THTensor *values_, THLongTensor *indices_, THTensor *t, int dimension, i
^
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.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:191:50: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(max)(values, indices, t, dim);
^
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<float> >::_min(THFloatTensor*, THLongTensor*, THFloatTen\
sor*, int)':
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:195:50: error: too few arguments to function 'void THFloatTensor_min(THFloatTensor*, THLongTensor*, THFloatTensor*, int, int)'
return THTensor_(min)(values, indices, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:74:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(min)(THTensor *values_, THLongTensor *indices_, THTensor *t, int dimension, i
^
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.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:195:50: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(min)(values, indices, t, dim);
^
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<float> >::_sum(THFloatTensor*, THFloatTensor*, int)':
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:198:36: error: too few arguments to function 'void THFloatTensor_sum(THFloatTensor*, THFloatTensor*, int, int)'
return THTensor_(sum)(r, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:78:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(sum)(THTensor *r_, THTensor *t, int dimension, int keepdim);
^
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.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:198:36: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(sum)(r, t, dim);
^
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<float> >::_prod(THFloatTensor*, THFloatTensor*, int)':
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:201:37: error: too few arguments to function 'void THFloatTensor_prod(THFloatTensor*, THFloatTensor*, int, int)'
return THTensor_(prod)(r, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:79:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(prod)(THTensor *r_, THTensor *t, int dimension, int keepdim);
^
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.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:201:37: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(prod)(r, t, dim);
^
In file included from thpp/detail/TensorGeneric.h:1:0,
from /root/torch/install/include/TH/THGenerateFloatTypes.h:11,
from /root/torch/install/include/TH/THGenerateAllTypes.h:10,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<double> >::_max(THDoubleTensor*, THLongTensor*, THDouble\
Tensor*, int)':
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:191:50: error: too few arguments to function 'void THDoubleTensor_max(THDoubleTensor*, THLongTensor*, THDoubleTensor*, int, int)'
return THTensor_(max)(values, indices, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:73:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(max)(THTensor *values_, THLongTensor *indices_, THTensor *t, int dimension, i
/root/torch/install/include/TH/generic/THTensorMath.h:73:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(max)(THTensor *values_, THLongTensor *indices_, THTensor *t, int dimension, i
^
In file included from thpp/detail/TensorGeneric.h:1:0,
from /root/torch/install/include/TH/THGenerateFloatTypes.h:11,
from /root/torch/install/include/TH/THGenerateAllTypes.h:10,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:191:50: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(max)(values, indices, t, dim);
^
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<double> >::_min(THDoubleTensor*, THLongTensor*, THDouble\
Tensor*, int)':
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:195:50: error: too few arguments to function 'void THDoubleTensor_min(THDoubleTensor*, THLongTensor*, THDoubleTensor*, int, int)'
return THTensor_(min)(values, indices, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:74:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(min)(THTensor *values_, THLongTensor *indices_, THTensor *t, int dimension, i
^
In file included from thpp/detail/TensorGeneric.h:1:0,
from /root/torch/install/include/TH/THGenerateFloatTypes.h:11,
from /root/torch/install/include/TH/THGenerateAllTypes.h:10,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:195:50: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(min)(values, indices, t, dim);
^
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<double> >::_sum(THDoubleTensor*, THDoubleTensor*, int)':
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:198:36: error: too few arguments to function 'void THDoubleTensor_sum(THDoubleTensor*, THDoubleTensor*, int, int)'
return THTensor_(sum)(r, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:78:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(sum)(THTensor *r_, THTensor *t, int dimension, int keepdim);
^
In file included from thpp/detail/TensorGeneric.h:1:0,
from /root/torch/install/include/TH/THGenerateFloatTypes.h:11,
from /root/torch/install/include/TH/THGenerateAllTypes.h:10,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:198:36: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(sum)(r, t, dim);
^
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h: In static member function 'static void thpp::detail::TensorOps<thpp::Tensor<double> >::_prod(THDoubleTensor*, THDoubleTensor*, int)'\
:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:201:37: error: too few arguments to function 'void THDoubleTensor_prod(THDoubleTensor*, THDoubleTensor*, int, int)'
return THTensor_(prod)(r, t, dim);
^
In file included from /root/torch/install/include/TH/THStorage.h:4:0,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Storage.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Storage.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:14,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/root/torch/install/include/TH/THTensor.h:8:39: note: declared here
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/THGeneral.h:115:37: note: in definition of macro 'TH_CONCAT_4_EXPAND'
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
^
/root/torch/install/include/TH/THTensor.h:8:27: note: in expansion of macro 'TH_CONCAT_4'
#define THTensor_(NAME) TH_CONCAT_4(TH,Real,Tensor_,NAME)
^
/root/torch/install/include/TH/generic/THTensorMath.h:79:13: note: in expansion of macro 'THTensor_'
TH_API void THTensor_(prod)(THTensor *r_, THTensor *t, int dimension, int keepdim);
^
In file included from thpp/detail/TensorGeneric.h:1:0,
from /root/torch/install/include/TH/THGenerateFloatTypes.h:11,
from /root/torch/install/include/TH/THGenerateAllTypes.h:10,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/Tensor.h:30,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/Tensor.h:16,
from /tmp/fblualib-build.XXXXXX/thpp/thpp/TensorSerialization.cpp:11:
/tmp/fblualib-build.XXXXXX/thpp/thpp/../thpp/detail/TensorGeneric.h:201:37: error: return-statement with a value, in function returning 'void' [-fpermissive]
return THTensor_(prod)(r, t, dim);
^
In file included from thpp/detail/TensorGeneric.h:1:0,
from /root/torch/install/include/TH/THGenerateIntTypes.h:10,
...
...
Figured out the problems, basically use pull request number 32 and 42 are needed to compile thpp.
I also used older versions of folly and other libraries that were the latest versions that were compatible with gnu++11
but I think that these were not really necessary, still just in case I am posting the recipe here.
7 rm -rf folly
8 git clone -b v2017.05.15.00 --depth 1 https://github.com/facebook/folly
9 cd folly/folly
10 autoreconf -ivf
11 ./configure
12 make -j 8
13 make check
14 sudo make install
15 sudo ldconfig # reload the lib paths after freshly installed folly. fbthrift needs it.
16
17 rm -rf wangle
18 git clone -b v2017.05.15.00 --depth 1 https://github.com/facebook/wangle
19 cd wangle/wangle
20 cmake .
21 make -j 8
22 sudo make install
23
24
25 rm -rf fbthrift
26 git clone -b v2017.05.15.00 --depth 1 https://github.com/facebook/fbthrift
27 cd fbthrift/thrift/
28 # ./build/deps_ubuntu_14.04.sh
29 autoreconf -ivf
30 ./configure
31 pushd lib/cpp2/fatal/internal
32 ln -s folly_dynamic-inl-pre.h folly_dynamic-inl.h
33 popd
34 make -j 8
35 sudo make install
36
37
38 rm -rf thpp
39 git clone https://github.com/facebook/thpp
40 cd thpp/thpp
41 git checkout 899817dd54592
42 rm -rf build
43 ./build.sh
44
45 git clone https://github.com/facebook/fblualib
46 cd $dir/fblualib/fblualib/python
47 luarocks make rockspec/fbpython-0.1-1.rockspec
You had install all of these successfully? I want to run crnn project, but I cant install thpp... @se4u
@zoe218 Hi, yes I installed all of these successfully. Basically what's going on is that the api in these open source libraries has changed subtly with C++14. For example, you said that you got the following error:
the source in the file /detail/TensorGeneric.h error: return-statement with a value, in function returning 'void' [-fpermissive] return THTensor_(prod)(r, t, dim);
This error is probably because of some error in the macro, or because the THTensor_prod function was meant to be doing inplace operation and returning void and it was changed to return the handle of the new tensor. Since all these libraries are not compatible at this point of time, and the repo maintainers have not yet merged the pull requests for fixing this, you could just merge these pull requests directly in your own fork yourself and also you could use older versions of the libraries that are known to work.
我也是想运行crnn的时候,安装thpp出错,请问你解决了么 @zoe218
@mengya22 没有啊,你是什么错?
@zoe218 和你差不多,是因为torch版本和thpp不兼容么?
@zoe218 I tried @se4u 's recipe but still got errors on thpp compilation. Later I figured out the solution: use the patched version by CodeVerySlow: https://github.com/codeVerySlow/thpp/tree/patch-1
You can clone the code by
git clone -b patch-1 https://github.com/codeVerySlow/thpp/
After that you need to change CMakeLists.txt:45: "... -std=gnu++11" to "... -std=gnu++14" Then you can run 'build.sh'.
If the compiler complains about undefined 'FOLLY_MAYBE_UNUSED', you need to add an include file in the beginning of 'build/thpp/if/gen-cpp2/Tensor_types.h':
#include <folly/CppAttributes.h>
你现在安装好了么 @mengya22
I did this change via pull requests 10 months ago, but is not accepted... https://github.com/facebook/thpp/pull/32
@zoe218 你们的文件夹有thpp/cmake里面FindTorch.cmake这个文件么,我cmake 一直报错,说没有这个文件无法find torch
[ 10%] Building CXX object CMakeFiles/thpp.dir/Storage.cpp.o In file included from /tmp/fblualib-build.uR4GKO/thpp/thpp/build/thpp/if/gen-cpp2/Tensor_types.h:13:0, from /tmp/fblualib-build.uR4GKO/thpp/thpp/../thpp/Storage.h:22, from /tmp/fblualib-build.uR4GKO/thpp/thpp/Storage.cpp:11: /usr/local/include/folly/io/Cursor.h: In member function ‘size_t folly::io::detail::CursorBase<Derived, BufType>::cloneAtMost(std::unique_ptr&, size_t)’:
/usr/local/include/folly/io/Cursor.h:443:13: error: ‘make_unique’ is not a member of ‘std’
buf = std::make_unique();
^
/usr/local/include/folly/io/Cursor.h:443:13: note: suggested alternative:
In file included from /usr/local/include/thrift/lib/cpp/Thrift.h:23:0,
from /usr/local/include/thrift/lib/cpp2/Thrift.h:20,
from /tmp/fblualib-build.uR4GKO/thpp/thpp/build/thpp/if/gen-cpp2/Tensor_types.h:9,
from /tmp/fblualib-build.uR4GKO/thpp/thpp/../thpp/Storage.h:22,
from /tmp/fblualib-build.uR4GKO/thpp/thpp/Storage.cpp:11:
/usr/local/include/folly/Memory.h:63:1: note: ‘folly::make_unique’
make_unique(Args&&...) = delete;
^
In file included from /tmp/fblualib-build.uR4GKO/thpp/thpp/build/thpp/if/gen-cpp2/Tensor_types.h:13:0,
from /tmp/fblualib-build.uR4GKO/thpp/thpp/../thpp/Storage.h:22,
from /tmp/fblualib-build.uR4GKO/thpp/thpp/Storage.cpp:11:
/usr/local/include/folly/io/Cursor.h:443:42: error: expected primary-expression before ‘>’ token
buf = std::make_unique();
^
/usr/local/include/folly/io/Cursor.h:443:44: error: expected primary-expression before ‘)’ token
buf = std::make_unique();
^
CMakeFiles/thpp.dir/build.make:84: recipe for target 'CMakeFiles/thpp.dir/Storage.cpp.o' failed
make[2]: [CMakeFiles/thpp.dir/Storage.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/thpp.dir/all' failed
make[1]: [CMakeFiles/thpp.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2