orb-slam2_with_semantic_label icon indicating copy to clipboard operation
orb-slam2_with_semantic_label copied to clipboard

run build.sh failed

Open PIGzyj233 opened this issue 5 years ago • 50 comments

CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 Converting vocabulary to binary BoW load/save benchmark ./tools/bin_vocabulary: symbol lookup error: ./tools/bin_vocabulary: undefined symbol: _ZN5DBoW24FORB10fromStringERN2cv3MatERKSs

environment: ubuntu16.04 cuda10.1 opencv2.4.11 pcl1.8.0 CMakeError.log CMakeOutput.log

PIGzyj233 avatar May 19 '19 06:05 PIGzyj233

Fairly certain I've ran into the same exact issue...

CMakeFiles/ORB_SLAM2.dir/build.make:542: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/segmentation.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/segmentation.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Converting vocabulary to binary
BoW load/save benchmark
./tools/bin_vocabulary: symbol lookup error: ./tools/bin_vocabulary: undefined symbol: _ZN5DBoW24FORB10fromStringERN2cv3MatERKSs

Ubuntu 16.04, CUDA 10.1, pcl1.8.1, opencv2.4.9

Any luck in overcoming this yet?

IoannisAsmanis avatar May 21 '19 10:05 IoannisAsmanis

hi @PIGzyj233 @IoannisAsmanis The system was not tested on CUDA10, you can try it on CUDA8/9.

qixuxiang avatar May 27 '19 11:05 qixuxiang

hi @PIGzyj233 @IoannisAsmanis The system was not tested on CUDA10, you can try it on CUDA8/9. thank you for your reply I successfully compiled the program with cuda9.0, but there is no pcl viewer display, and soon the same as the previous user reported "segment error, the core has been dumped" after tracking, the display is libopencv.so.2.4.13 and libc.so .6 has an error Can you tell me what environment configuration you are running successfully? Such as cmake version, pcl version and opencv version

PIGzyj233 avatar May 30 '19 02:05 PIGzyj233

@PIGzyj233 PCL 1.8.1,CUDA 8 and opencv 2.3.13 On Ubuntu 16.04

qixuxiang avatar May 30 '19 13:05 qixuxiang

遇到了同样的问题,CUDA 10.1 Ubuntu 18.04 是cuda版本的问题吗

Vslamer avatar Jun 15 '19 08:06 Vslamer

暂未测试cuda10,建议回退到cuda8/cuda9 @Moonkisscy

qixuxiang avatar Jun 15 '19 08:06 qixuxiang

`make[2]: *** 没有规则可制作目标“../Thirdparty/darknet/build/libYOLOv3SE.so”,由“../lib/libORB_SLAM2.so” 需求。 停止。 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 Converting vocabulary to binar build.sh: 46: build.sh: ./tools/bin_vocabulary: not found

` 我的报错是这个,退为cuda9,挺麻烦的,想问下有其他办法或者是其他问题,修改代码之类。

Vslamer avatar Jun 15 '19 08:06 Vslamer

CMakeLists.txt里面最后注释全部去掉:

# Build tools
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools)
#add_executable(bin_vocabulary
#tools/bin_vocabulary.cc)
#target_link_libraries(bin_vocabulary ${PROJECT_NAME})

改为:

# Build tools
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools)
add_executable(bin_vocabulary
tools/bin_vocabulary.cc)
target_link_libraries(bin_vocabulary ${PROJECT_NAME})

qixuxiang avatar Jun 15 '19 09:06 qixuxiang

好的,谢谢。刚改了,但还是有问题,把所有报错贴在了下面,看上面说没找到库libOpenNI2,但是查看这个库是有的。

CMake Warning at CMakeLists.txt:350 (add_executable):
  Cannot generate a safe linker search path for target bin_vocabulary because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libOpenNI2.so] in /usr/lib may be hidden by files in:
      /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/OpenNI-Linux-x64-2.3/Redist

  Some of these libraries may not be found correctly.


CMake Warning at CMakeLists.txt:312 (add_executable):
  Cannot generate a safe linker search path for target rgbd_tum because files
  in some directories may conflict with libraries in implicit directories:

    link library [libOpenNI2.so] in /usr/lib may be hidden by files in:
      /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/OpenNI-Linux-x64-2.3/Redist

  Some of these libraries may not be found correctly.


CMake Warning at CMakeLists.txt:135 (add_library):
  Cannot generate a safe linker search path for target ORB_SLAM2 because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libOpenNI2.so] in /usr/lib may be hidden by files in:
      /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/OpenNI-Linux-x64-2.3/Redist

  Some of these libraries may not be found correctly.


-- Generating done
-- Build files have been written to: /home/cy/dlslam/orb-slam2_with_semantic_label/build
make[2]: *** 没有规则可制作目标“../Thirdparty/darknet/build/libYOLOv3SE.so”,由“../lib/libORB_SLAM2.so” 需求。 停止。
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Converting vocabulary to binary
build.sh: 46: build.sh: ./tools/bin_vocabulary: not found

Vslamer avatar Jun 15 '19 09:06 Vslamer

@Moonkisscy [libOpenNI2.so]这个可以注释掉,这个库可选,并非必须

qixuxiang avatar Jun 15 '19 09:06 qixuxiang

@Moonkisscy 在原始Cmakelist.txt 第280行

#${OPENNI_LIB_DIR}/libOpenNI2.so

qixuxiang avatar Jun 15 '19 09:06 qixuxiang

@Moonkisscy [libOpenNI2.so]这个可以注释掉,这个库可选,并非必须

嗯,刚注释了,库没报错了,现在还是之前这个问题。

make[2]: *** 没有规则可制作目标“../Thirdparty/darknet/build/libYOLOv3SE.so”,由“../lib/libORB_SLAM2.so” 需求。 停止。
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Converting vocabulary to binary
build.sh: 46: build.sh: ./tools/bin_vocabulary: not found

Vslamer avatar Jun 15 '19 09:06 Vslamer

@Moonkisscy 算了,饶了弯路,直接在build.sh删掉

echo "Converting vocabulary to binary"
./tools/bin_vocabulary`

这两行。 然后重新在CMakeLists.txt最后加上注释

# Build tools
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools)
#add_executable(bin_vocabulary
#tools/bin_vocabulary.cc)
#target_link_libraries(bin_vocabulary ${PROJECT_NAME})

最后进入Vocabulary执行:tar -xzvf ORBvoc.txt.tar.gz 直接进入Readme第三步run code

如果可以跑成功,记得回来回复下。

qixuxiang avatar Jun 15 '19 09:06 qixuxiang

试了下,还是有问题额,难道真是cuda版本问题吗。

-- Build files have been written to: /home/cy/dlslam/orb-slam2_with_semantic_label/build
make[2]: *** 没有规则可制作目标“../Thirdparty/darknet/build/libYOLOv3SE.so”,由“../lib/libORB_SLAM2.so” 需求。 停止。
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Vslamer avatar Jun 15 '19 09:06 Vslamer

@Moonkisscy 这里需要把libYOLOv3SE.so编译出来,手动执行

cd Thirdparty/darknet
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2

qixuxiang avatar Jun 15 '19 09:06 qixuxiang

@Moonkisscy 这里需要把libYOLOv3SE.so编译出来,手动执行

cd Thirdparty/darknet
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2

按照上说的编译又遇到下面错误,查了下说是是因为缺乏头文件cudnn.h,需要将其复制。 于是运行:```sudo cp cudnn.h /usr/include``复制。又遇到“cp: 无法获取'cudnn.h' 的文件状态(stat): 没有那个文件或目录”错误。 不知道是不是这样解决,因为刚接触这块不久,所以问题可能有点多,望见谅,哈哈。

In file included from /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/layer.h:1:0,
                 from /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/dropout_layer.h:4,
                 from /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/dropout_layer_kernels.cu:6:
/home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/darknet.h:46:23: fatal error: cudnn.h: 没有那个文件或目录
compilation terminated.
In file included from /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/layer.h:1:0,
                 from /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/dropout_layer.h:4,
                 from /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/dropout_layer_kernels.cu:6:
/home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/src/darknet.h:46:23: fatal error: cudnn.h: 没有那个文件或目录
compilation terminated.
CMake Error at YOLOv3SE_Train_generated_dropout_layer_kernels.cu.o.Release.cmake:219 (message):
  Error generating
  /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/build/CMakeFiles/YOLOv3SE_Train.dir/src/./YOLOv3SE_Train_generated_dropout_layer_kernels.cu.o

CMake Error at YOLOv3SE_generated_dropout_layer_kernels.cu.o.Release.cmake:219 (message):
  Error generating
  /home/cy/dlslam/orb-slam2_with_semantic_label/Thirdparty/darknet/build/CMakeFiles/YOLOv3SE.dir/src/./YOLOv3SE_generated_dropout_layer_kernels.cu.o



CMakeFiles/YOLOv3SE.dir/build.make:196: recipe for target 'CMakeFiles/YOLOv3SE.dir/src/YOLOv3SE_generated_dropout_layer_kernels.cu.o' failed
make[2]: *** [CMakeFiles/YOLOv3SE.dir/src/YOLOv3SE_generated_dropout_layer_kernels.cu.o] Error 1
CMakeFiles/YOLOv3SE_Train.dir/build.make:126: recipe for target 'CMakeFiles/YOLOv3SE_Train.dir/src/YOLOv3SE_Train_generated_dropout_layer_kernels.cu.o' failed
make[2]: *** [CMakeFiles/YOLOv3SE_Train.dir/src/YOLOv3SE_Train_generated_dropout_layer_kernels.cu.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/YOLOv3SE.dir/all' failed
make[1]: *** [CMakeFiles/YOLOv3SE.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/YOLOv3SE_Train.dir/all' failed
make[1]: *** [CMakeFiles/YOLOv3SE_Train.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Vslamer avatar Jun 15 '19 11:06 Vslamer

@Moonkisscy

fatal error: cudnn.h: 没有那个文件或目录

这个问题尝试自己解决下吧,解决完就可以跑起来了。

欢迎入坑SLAM

qixuxiang avatar Jun 15 '19 11:06 qixuxiang

@Moonkisscy

fatal error: cudnn.h: 没有那个文件或目录

这个问题尝试自己解决下吧,解决完就可以跑起来了。

欢迎入坑SLAM

已入坑,哈哈。 这个问题解决了,又遇到一个新问题,谷歌了挺久没找到合适方法解决,不知道你有没有遇到过。

make[2]: *** 没有规则可制作目标“/usr/local/cuda/lib64/libcudnn.so”,由“libYOLOv3SE.so” 需求。 停止。
make[2]: *** 正在等待未完成的任务....
[ 97%] Building C object CMakeFiles/YOLOv3SE.dir/src/yolo_v3.c.o
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/YOLOv3SE.dir/all' failed
make[1]: *** [CMakeFiles/YOLOv3SE.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Vslamer avatar Jun 15 '19 11:06 Vslamer

搜索下安装linux下安装cudnn

qixuxiang avatar Jun 15 '19 12:06 qixuxiang

搜索下安装linux下安装cudnn

恩,这个刚才解决了,又正在解决下面这个问题,感觉解决一个又来一个新的@_@。

/usr/bin/ld: 找不到 -lCUDA_cublas_device_LIBRARY-NOTFOUND
collect2: error: ld returned 1 exit status
CMakeFiles/YOLOv3SE_Train.dir/build.make:3001: recipe for target 'YOLOv3SE_Train' failed
make[2]: *** [YOLOv3SE_Train] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/YOLOv3SE_Train.dir/all' failed
make[1]: *** [CMakeFiles/YOLOv3SE_Train.dir/all] Error 2

Vslamer avatar Jun 15 '19 12:06 Vslamer

大哥,一个一个来。。。慢慢来,比较快

qixuxiang avatar Jun 15 '19 12:06 qixuxiang

大哥,一个一个来。。。慢慢来,比较快

恩,上面的问题解决了,libYOLOv3SE.so编译没问题了,最后编译ORBSLAM2还是出现下面pcl问题,安装的pcl1.8测试了也没问题。按照网上试了挺多方法,改了CMakeLists.txt等也都出现新问题没有解决,感谢大佬无私回复,哈哈。

[100%] Linking CXX executable ../bin/rgbd_tum
../lib/libORB_SLAM2.so:对‘pcl::search::Search<pcl::PointXYZ>::getName() const’未定义的引用
../lib/libORB_SLAM2.so:对‘pcl::search::Search<pcl::PointXYZRGBNormal>::getName() const’未定义的引用
../lib/libORB_SLAM2.so:对‘pcl::search::Search<pcl::PointXYZRGB>::getName() const’未定义的引用
../lib/libORB_SLAM2.so:对‘pcl::search::Search<pcl::PointXYZRGBA>::getName() const’未定义的引用
../lib/libORB_SLAM2.so:对‘pcl::search::Search<pcl::PointXYZI>::getName() const’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/rgbd_tum.dir/build.make:352: recipe for target '../bin/rgbd_tum' failed
make[2]: *** [../bin/rgbd_tum] Error 1
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/rgbd_tum.dir/all' failed
make[1]: *** [CMakeFiles/rgbd_tum.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Converting vocabulary to binary
BoW load/save benchmark
Loading fom text: 5.85s
Saving as binary: 0.09s

Vslamer avatar Jun 15 '19 15:06 Vslamer

[100%] Linking CXX executable ../bin/rgbd_tum ../lib/libORB_SLAM2.so:对‘pcl::SupervoxelClusteringpcl::PointXYZRGBA::SupervoxelClustering(float, float)’未定义的引用 ../lib/libORB_SLAM2.so:对‘pcl::SupervoxelClusteringpcl::PointXYZRGBA::setUseSingleCameraTransform(bool)’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/rgbd_tum.dir/build.make:403: recipe for target '../bin/rgbd_tum' failed make[2]: *** [../bin/rgbd_tum] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/rgbd_tum.dir/all' failed make[1]: *** [CMakeFiles/rgbd_tum.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 Converting vocabulary to binary build.sh: 46: build.sh: ./tools/bin_vocabulary: not found

非常欣赏你的工程,还望解答。

450932894 avatar Jun 29 '19 12:06 450932894

@450932894 请附加你的软硬件信息

qixuxiang avatar Jun 30 '19 02:06 qixuxiang

environment: CMakeLists.txt

ubuntu16.04 cuda9.0 opencv3.4.1 pcl1.8.1

450932894 avatar Jun 30 '19 02:06 450932894

这个问题解决了,但是碰到了新的问题 tang@tangdingxin:~/catkin_ws/src/orb-slam2_with_semantic_label/bin$ ./rgbd_tum ../Vocabulary/ORBvoc.txt ../Examples/RGB-D/TUM1.yaml ../data/rgbd_dataset_freiburg1_xyz ../data/rgbd_dataset_freiburg1_xyz/associations.txt 段错误 (核心已转储)

450932894 avatar Jun 30 '19 03:06 450932894

@qixuxiang

450932894 avatar Jun 30 '19 04:06 450932894

@450932894 换tum2或者tum3数据试试,另外保证associations.txt生成正确。

qixuxiang avatar Jun 30 '19 05:06 qixuxiang

1 2 3 都试了 associations.txt 文件我用原版的orbslam2跑过

450932894 avatar Jun 30 '19 05:06 450932894

加你微信了

qixuxiang avatar Jun 30 '19 05:06 qixuxiang