unable to solve "nvcc fatal: A single input file is required for a non-link phase when an outputfile is specified" error
I am unable to find if there is any problem with the below build command generated by catkin_make. Similar questions on forums say that there must be some problem with the syntax of the command generated by cmake. Could some one help me find it ?
My system arch is aarch64 (Nvidia TX1) and OS is ubuntu 16.04. The same code builds perfectly on my ubuntu PC.
-- Generating dependency file: /home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/build/ros_kinfu/kinfu/pcl_kinfu_large_scale/CMakeFiles/KinfuLargeScaleCUDA.dir/kinfu_large_scale/src/cuda/KinfuLargeScaleCUDA_generated_colors.cu.o.NVCC-depend
Scanning dependencies of target KinfuLargeScaleCPP
/usr/local/cuda-8.0/bin/nvcc -M -D__CUDACC__ /home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/kinfu_large_scale/src/cuda/colors.cu -o /home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/build/ros_kinfu/kinfu/pcl_kinfu_large_scale/CMakeFiles/KinfuLargeScaleCUDA.dir/kinfu_large_scale/src/cuda/KinfuLargeScaleCUDA_generated_colors.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"kinfu\" -DROSCONSOLE_BACKEND_LOG4CXX -DDISABLE_OPENNI2 -DDISABLE_PCAP -DDISABLE_PNG -DvtkFiltersFlowPaths_AUTOINIT=1 ( vtkFiltersParallelFlowPaths ) -DvtkIOExodus_AUTOINIT=1 ( vtkIOParallelExodus ) -DvtkIOGeometry_AUTOINIT=1 ( vtkIOMPIParallel ) -DvtkIOImage_AUTOINIT=1 ( vtkIOMPIImage ) -DvtkIOSQL_AUTOINIT=2 ( vtkIOMySQL,vtkIOPostgreSQL ) -DvtkRenderingContext2D_AUTOINIT=1 ( vtkRenderingContextOpenGL ) -DvtkRenderingCore_AUTOINIT=4 ( vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL ) -DvtkRenderingFreeType_AUTOINIT=2 ( vtkRenderingFreeTypeFontConfig,vtkRenderingMatplotlib ) -DvtkRenderingLIC_AUTOINIT=1 ( vtkRenderingParallelLIC ) -DvtkRenderingVolume_AUTOINIT=1 ( vtkRenderingVolumeOpenGL ) -DDISABLE_OPENNI2 -DKinfuLargeScaleCUDA_EXPORTS -Xcompiler ,\"-fPIC\",\"-g\" -D_FORCE_INLINES -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 --ftz=true --prec-div=false --prec-sqrt=false -DNVCC -I/usr/local/cuda-8.0/include -I/usr/include/vtk-6.2 -I/usr/include -I/usr/include/jsoncpp -I/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent -I/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -I/usr/include/freetype2 -I/usr/include/aarch64-linux-gnu/freetype2 -I/usr/include/aarch64-linux-gnu -I/usr/include/hdf5/openmpi -I/usr/include/libxml2 -I/usr/include/python2.7 -I/usr/include/tcl -I/home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/containers/include -I/home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/utils/include -I/home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/kinfu_large_scale/include -I/home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/kinfu_large_scale/src -I/usr/include/pcl-1.7 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/local/cuda-8.0/include
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified
CMake Error at KinfuLargeScaleCUDA_generated_colors.cu.o.cmake:207 (message):
Error generating
/home/ubuntu/workspace/Jetson/ROS_Workspace/branches/tx1/iruVizhi_v1/build/ros_kinfu/kinfu/pcl_kinfu_large_scale/CMakeFiles/KinfuLargeScaleCUDA.dir/kinfu_large_scale/src/cuda/./KinfuLargeScaleCUDA_generated_colors.cu.o
The difference I can make out when comparing the build output from my PC is that the tx1 compile options have some lines with round brackets. Is that a problem?
-DvtkFiltersFlowPaths_AUTOINIT=1 ( vtkFiltersParallelFlowPaths )
May be insignificant, but I also get the below warning on tx1 and not on my pc
Argument not separated from preceding token by whitespace.
This warning is for project ...
The parentheses and the whitespace around many of the options looks suspicious. You can try copying the whole line into a shell script and running it to verify that it produces the same error (you may need to add quotes around some things)
Once you have a shell script that reproduces the issue, you can try to modify it in various ways until it works. Once you know how to make this one line work, the challenge is simplified to figuring out how to make cmake do the same thing (which is still not that simple :P )
Thank you. I removed the parentheses from the command and then it executes without any error. So how do I ensure cmake generates a command without these brackets? I see that only the vtk command options seems to have this problem.
I don't know. Perhaps you can read the cmake files for finding Cuda and VTK and see where it gets those options, or do a recursive grep of your filesystem to see which file those options are coming from.