Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvcc fatal : redefinition of argument 'std' #16

Open
arnabsinha opened this issue Jan 11, 2018 · 9 comments
Open

nvcc fatal : redefinition of argument 'std' #16

arnabsinha opened this issue Jan 11, 2018 · 9 comments

Comments

@arnabsinha
Copy link

/usr/local/cuda/bin/nvcc -M -D__CUDACC__ /home/arnab/codes/3D_with_drone/VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/calc_cost.cu -o /home/arnab/codes/3D_with_drone/VI_MEAN_ws/build/VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/stereo_mapper_generated_calc_cost.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 --std c++11 -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME="stereo_mapper" -DROSCONSOLE_BACKEND_LOG4CXX -Xcompiler ,"-DEIGEN_DONT_PARALLELIZE","-O3","-Wall","-g" -std=c++11 -O3 -gencode arch=compute_61,code=sm_61 -DNVCC -I/usr/local/cuda/include -I/home/arnab/codes/3D_with_drone/VI_MEAN_ws/devel/include -I/opt/ros/kinetic/include -I/opt/ros/kinetic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -I/opt/ros/kinetic/include/opencv-3.3.1 -I/opt/ros/kinetic/include/opencv-3.3.1/opencv -I/usr/include -I/usr/include/eigen3 -I/usr/local/cuda/include
nvcc fatal : redefinition of argument 'std'
CMake Error at stereo_mapper_generated_calc_cost.cu.o.cmake:207 (message):
Error generating
/home/arnab/codes/3D_with_drone/VI_MEAN_ws/build/VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/./stereo_mapper_generated_calc_cost.cu.o

VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/build.make:1265: recipe for target 'VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/stereo_mapper_generated_calc_cost.cu.o' failed
make[2]: *** [VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/stereo_mapper_generated_calc_cost.cu.o] Error 1

@arnabsinha
Copy link
Author

When I remove "-std=c++11" from CXX_FLAGS, I do not get the above error, but I am stuck with the following error:

VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/tic_toc.h:22:20: error: 'std::chrono' has not been declared
end = std::chrono::system_clock::now();
VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/tic_toc.h:23:14: error: 'std::chrono' has not been declared
std::chrono::duration elapsed_seconds = end - start;
VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/stereo_mapper_node.cpp:80:19: error: 'id' does not name a type
for (auto id : id_set_r)
etc.

Henceforth, it can be concluded that the code base depends heavily on c11 features. Therefore, I am back to the original problem.

@xiaobainixi
Copy link

I catch the problem the same as yours,how did you solve it?

@cumtchenchang
Copy link

@arnabsinha @tiantiandabaojian I catch the problem the same as yours,how did you solve it?

@xiaobainixi
Copy link

@cumtchenchang 没用这个,没调通,自己重写了一个

@cumtchenchang
Copy link

@重写的stereo_mapper吗?能方便加微信或者qq沟通吗?

@xiaobainixi
Copy link

@cumtchenchang 没重写这个,太复杂了 就重写了一个双目求视差并制作三维图的小程序

@cumtchenchang
Copy link

@tiantiandabaojian 抱歉这么晚还来打扰你,我根据你的思路调试一直出问题,请问能够分享下你的代码吗?或者私下沟通.

@xiaobainixi
Copy link

@cumtchenchang 代码写的很乱,就用的OPENCV的SGBM做的,代码的话去我GITHUB上吧

@brbzjl
Copy link

brbzjl commented Jan 8, 2019

just remove -std=c++11 in the CUDA_NVCC_FLAGS. it conflicts with the prior setting in CMAKE_CXX_FLAGS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants