pqhieu / jsis3d

[CVPR'19] JSIS3D: Joint Semantic-Instance Segmentation of 3D Point Clouds
https://pqhieu.com/research/cvpr19/
MIT License
175 stars 36 forks source link

make failed #6

Closed iris0329 closed 5 years ago

iris0329 commented 5 years ago

Hi @pqhieu ,

When I compile CRF, all is good, but when I run make, it shows :


Scanning dependencies of target lbfgs
[  3%] Building C object external/CMakeFiles/lbfgs.dir/liblbfgs/lib/lbfgs.c.o
[  7%] Linking C static library liblbfgs.a
[  7%] Built target lbfgs
Scanning dependencies of target optimization
[ 11%] Building CXX object src/CMakeFiles/optimization.dir/optimization.cpp.o
[ 14%] Linking CXX static library liboptimization.a
[ 14%] Built target optimization
Scanning dependencies of target densecrf
[ 18%] Building CXX object src/CMakeFiles/densecrf.dir/util.cpp.o
[ 22%] Building CXX object src/CMakeFiles/densecrf.dir/permutohedral.cpp.o
[ 25%] Building CXX object src/CMakeFiles/densecrf.dir/unary.cpp.o
[ 29%] Building CXX object src/CMakeFiles/densecrf.dir/pairwise.cpp.o
[ 33%] Building CXX object src/CMakeFiles/densecrf.dir/objective.cpp.o
[ 37%] Building CXX object src/CMakeFiles/densecrf.dir/densecrf.cpp.o
[ 40%] Building CXX object src/CMakeFiles/densecrf.dir/labelcompatibility.cpp.o
[ 44%] Building CXX object src/CMakeFiles/densecrf.dir/higherorder.cpp.o
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp: In member function 'void HigherOrderPotential::apply(Eigen::MatrixXf&, const MatrixX
f&, const VectorXi&)':
/data/lirong/jsis3d/external/densecrf/src/higherorder.cpp:39:17: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
     for ( auto& s : indices_ ) {
                 ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:39:21: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++1
1
     for ( auto& s : indices_ ) {
                     ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:42:25: error: ISO C++ forbids declaration of 'v' with no type [-fpermissive]
             for ( auto& v : s.second ) {
                         ^
/data/lirong/jsis3d/external/densecrf/src/higherorder.cpp:42:29: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++1
1
             for ( auto& v : s.second ) {
                             ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:42:31: error: request for member 'second' in 's', which is of non-class type 'int'
             for ( auto& v : s.second ) {
                               ^
/data/lirong/jsis3d/external/densecrf/src/higherorder.cpp:52:17: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
     for ( auto& s : indices_ ) {
                 ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:52:21: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++1
1
     for ( auto& s : indices_ ) {
                     ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:54:21: error: ISO C++ forbids declaration of 'v' with no type [-fpermissive]
         for ( auto& v : s.second ) {
                     ^
/data/lirong/jsis3d/external/densecrf/src/higherorder.cpp:42:29: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++1
1
             for ( auto& v : s.second ) {
                             ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:42:31: error: request for member 'second' in 's', which is of non-class type 'int'
             for ( auto& v : s.second ) {
                               ^
/data/lirong/jsis3d/external/densecrf/src/higherorder.cpp:52:17: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
     for ( auto& s : indices_ ) {
                 ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:52:21: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++1
1
     for ( auto& s : indices_ ) {
                     ^
/data/lirong/jsis3d/external/densecrf/src/higherorder.cpp:54:21: error: ISO C++ forbids declaration of 'v' with no type [-fpermissive]
         for ( auto& v : s.second ) {
                     ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:54:25: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++1
1
         for ( auto& v : s.second ) {
                         ^
/data/lr/jsis3d/external/densecrf/src/higherorder.cpp:54:27: error: request for member 'second' in 's', which is of non-class type 'int'
         for ( auto& v : s.second ) {
                           ^
src/CMakeFiles/densecrf.dir/build.make:230: recipe for target 'src/CMakeFiles/densecrf.dir/higherorder.cpp.o' failed
make[2]: *** [src/CMakeFiles/densecrf.dir/higherorder.cpp.o] Error 1
CMakeFiles/Makefile2:124: recipe for target 'src/CMakeFiles/densecrf.dir/all' failed
make[1]: *** [src/CMakeFiles/densecrf.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Can you give me some advice? Without CRF, I could run the whole project successfully, but I am really interested in CRF part.

I am using python=3.7, torch=1.1.0

Thanks for your help !

pqhieu commented 5 years ago

Try adding this line to the external/densecrf/CMakeLists.txt, delete the build folder and try again.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
zhangguanghui1 commented 5 years ago

When I run make in root folder, make -j mkdir -p build/src/ mkdir -p build/src/ g++ -O2 -pedantic -Iexternal/densecrf/include -c -o build/src/cnpy.cpp.o src/cnpy.cpp g++ -O2 -pedantic -Iexternal/densecrf/include -c -o build/src/main.cpp.o src/main.cpp In file included from /usr/include/c++/5/regex:35:0, from src/cnpy.cpp:13: /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

error This file requires compiler and library support \

^ In file included from src/cnpy.cpp:5:0: src/cnpy.h:56:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type std::shared_ptr<std::vector> data_holder; ...... Can you help me? How to change the Makefile. Thank you very much!

iris0329 commented 5 years ago

@pqhieu Thanks for your help ! It works ! @zhangguanghui1 Sorry, I am not familiar with c++ (; ''༎ຶД༎ຶ'' ), but it shows This file requires compiler and library support, maybe you should activate c++11 compiler? set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") is used to activate c++11, maybe you could have a try. but why not follow the guide in the README, it works.

pqhieu commented 5 years ago

Hi @zhangguanghui1,

Try adding this to the CXXFLAGS line in the Makefile: -std=c++11.

I have updated the code accordingly.

zhangguanghui1 commented 5 years ago

@pqhieu Thank you very much.