<command-line>:0:1: error: macro names must be identifiers
duanyongli opened this issue · comments
Can you copy and paste the full verbose output from catkin build
? Offhand I believe the command for this is catkin build --verbose
.
Some more info about the build environment will be helpful:
- What version of PCL is installed?
- What version of CUDA are you using?
Thanks for your reply.
More info about the build environment:
- What version of PCL is installed? PCL1.8
- What version of CUDA are you using? cuda 10.2
verbose output follows:
[ 63%] Building CXX object CMakeFiles/yak_frontend.dir/src/yak_server.cpp.o
[ 68%] Building CXX object CMakeFiles/yak_frontend.dir/src/kfusion/tsdf_container.cpp.o
/usr/bin/c++ -D-ffloat-store -DDISABLE_DAVIDSDK -DDISABLE_DSSDK -DDISABLE_ENSENSO -DDISABLE_LIBUSB_1_0 -DDISABLE_PCAP -DDISABLE_PNG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DvtkFiltersFlowPaths_AUTOINIT="1(vtkFiltersParallelFlowPaths)" -DvtkIOExodus_AUTOINIT="1(vtkIOParallelExodus)" -DvtkIOGeometry_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOImage_AUTOINIT="1(vtkIOMPIImage)" -DvtkIOParallel_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOSQL_AUTOINIT="2(vtkIOMySQL,vtkIOPostgreSQL)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)" -DvtkRenderingFreeType_AUTOINIT="2(vtkRenderingFreeTypeFontConfig,vtkRenderingMatplotlib)" -DvtkRenderingLIC_AUTOINIT="1(vtkRenderingParallelLIC)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" -Dyak_frontend_EXPORTS -isystem /usr/include/vtk-6.3 -isystem /usr/include/freetype2 -isystem /usr/lib/aarch64-linux-gnu/openmpi/include/openmpi -isystem /usr/lib/aarch64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -isystem /usr/lib/aarch64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -isystem /usr/lib/aarch64-linux-gnu/openmpi/include -isystem /usr/include/python2.7 -isystem /usr/include/aarch64-linux-gnu -isystem /usr/include/hdf5/openmpi -isystem /usr/include/libxml2 -isystem /usr/include/jsoncpp -isystem /usr/include/tcl -I/usr/local/cuda/include -I/home/research/catkin_ws_test/src/yak/yak/include -isystem /usr/include/pcl-1.8 -isystem /usr/include/eigen3 -isystem /usr/include/ni -isystem /usr/include/openni2 -isystem /usr/include/opencv -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -fPIC -fPIC -std=gnu++14 -o CMakeFiles/yak_frontend.dir/src/yak_server.cpp.o -c /home/research/catkin_ws_test/src/yak/yak/src/yak_server.cpp
/usr/bin/c++ -D-ffloat-store -DDISABLE_DAVIDSDK -DDISABLE_DSSDK -DDISABLE_ENSENSO -DDISABLE_LIBUSB_1_0 -DDISABLE_PCAP -DDISABLE_PNG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DvtkFiltersFlowPaths_AUTOINIT="1(vtkFiltersParallelFlowPaths)" -DvtkIOExodus_AUTOINIT="1(vtkIOParallelExodus)" -DvtkIOGeometry_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOImage_AUTOINIT="1(vtkIOMPIImage)" -DvtkIOParallel_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOSQL_AUTOINIT="2(vtkIOMySQL,vtkIOPostgreSQL)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)" -DvtkRenderingFreeType_AUTOINIT="2(vtkRenderingFreeTypeFontConfig,vtkRenderingMatplotlib)" -DvtkRenderingLIC_AUTOINIT="1(vtkRenderingParallelLIC)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" -Dyak_frontend_EXPORTS -isystem /usr/include/vtk-6.3 -isystem /usr/include/freetype2 -isystem /usr/lib/aarch64-linux-gnu/openmpi/include/openmpi -isystem /usr/lib/aarch64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -isystem /usr/lib/aarch64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -isystem /usr/lib/aarch64-linux-gnu/openmpi/include -isystem /usr/include/python2.7 -isystem /usr/include/aarch64-linux-gnu -isystem /usr/include/hdf5/openmpi -isystem /usr/include/libxml2 -isystem /usr/include/jsoncpp -isystem /usr/include/tcl -I/usr/local/cuda/include -I/home/research/catkin_ws_test/src/yak/yak/include -isystem /usr/include/pcl-1.8 -isystem /usr/include/eigen3 -isystem /usr/include/ni -isystem /usr/include/openni2 -isystem /usr/include/opencv -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -fPIC -fPIC -std=gnu++14 -o CMakeFiles/yak_frontend.dir/src/kfusion/tsdf_container.cpp.o -c /home/research/catkin_ws_test/src/yak/yak/src/kfusion/tsdf_container.cpp
[ 84%] Built target yak_marching_cubes
/usr/bin/make -f CMakeFiles/marching_cubes_tests.dir/build.make CMakeFiles/marching_cubes_tests.dir/depend
make[2]: Entering directory '/home/research/catkin_ws_test/build/yak'
cd /home/research/catkin_ws_test/build/yak && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/research/catkin_ws_test/src/yak/yak /home/research/catkin_ws_test/src/yak/yak /home/research/catkin_ws_test/build/yak /home/research/catkin_ws_test/build/yak /home/research/catkin_ws_test/build/yak/CMakeFiles/marching_cubes_tests.dir/DependInfo.cmake --color=
:0:1: error: macro names must be identifiers
:0:1: error: macro names must be identifiers
make[2]: Leaving directory '/home/research/catkin_ws_test/build/yak'
/usr/bin/make -f CMakeFiles/marching_cubes_tests.dir/build.make CMakeFiles/marching_cubes_tests.dir/build
make[2]: Entering directory '/home/research/catkin_ws_test/build/yak'
make[2]: Nothing to be done for 'CMakeFiles/marching_cubes_tests.dir/build'.
make[2]: Leaving directory '/home/research/catkin_ws_test/build/yak'
[ 94%] Built target marching_cubes_tests
CMakeFiles/yak_frontend.dir/build.make:86: recipe for target 'CMakeFiles/yak_frontend.dir/src/kfusion/tsdf_container.cpp.o' failed
make[2]: *** [CMakeFiles/yak_frontend.dir/src/kfusion/tsdf_container.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/yak_frontend.dir/build.make:62: recipe for target 'CMakeFiles/yak_frontend.dir/src/yak_server.cpp.o' failed
make[2]: Leaving directory '/home/research/catkin_ws_test/build/yak'
make[2]: *** [CMakeFiles/yak_frontend.dir/src/yak_server.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/yak_frontend.dir/all' failed
make[1]: Leaving directory '/home/research/catkin_ws_test/build/yak'
make[1]: *** [CMakeFiles/yak_frontend.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
cd /home/research/catkin_ws_test/build/yak; catkin build --get-env yak | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
@duanyongli Could you select the text in your console and paste it as a comment instead of posting it as a screenshot? It's easier to read that way, and we can search it for keywords too.
In any case, I'm suspicious of that -D-ffloat-store
argument at the beginning of the list of compiler arguments. -ffloat-store
is a predefined GCC flag, and prepending -D
to something tells GCC to treat whatever comes after -D
as a macro name, which isn't the right thing to do in this case. I think the error you see is because macro names can't have hyphens in them, so the compiler gives an error when it encounters the invalid name.
I don't think that this is a problem with the Yak library or its dependencies, since we have CI jobs that build with CUDA 10.2 on Ubuntu 18.04. If you can find what is adding -D-ffloat-store
to the compiler options and figure out how to remove it I think you'll be able to solve this problem.
In any case, I'm suspicious of that
-D-ffloat-store
argument at the beginning of the list of compiler arguments.-ffloat-store
is a predefined GCC flag, and prepending-D
to something tells GCC to treat whatever comes after-D
as a macro name, which isn't the right thing to do in this case. I think the error you see is because macro names can't have hyphens in them, so the compiler gives an error when it encounters the invalid name.I don't think that this is a problem with the Yak library or its dependencies, since we have CI jobs that build with CUDA 10.2 on Ubuntu 18.04. If you can find what is adding
-D-ffloat-store
to the compiler options and figure out how to remove it I think you'll be able to solve this problem.
I think -D-ffloat-store comes from PCL.
find_package(PCL 1.8 REQUIRED COMPONENTS common io geometry)
message(WARNING ${PCL_DEFINITIONS})
message says:
CMake Warning at CMakeLists.txt:17 (message):
-ffloat-store
-DDISABLE_ENSENSO-DDISABLE_DAVIDSDK-DDISABLE_DSSDK-DDISABLE_PCAP-DDISABLE_PNG-DDISABLE_LIBUSB_1_0
Based on some quick research it seems likely that -ffloat-store
is automatically added by PCL based on the detected capabilities of the ARM CPU in the Jetson Xavier NX.
message says:
CMake Warning at CMakeLists.txt:17 (message):
-ffloat-store
-DDISABLE_ENSENSO-DDISABLE_DAVIDSDK-DDISABLE_DSSDK-DDISABLE_PCAP-DDISABLE_PNG-DDISABLE_LIBUSB_1_0
It's significant that the -ffloat-store
flag is written correctly here. That means that some later step is incorrectly adding the -D
prefix.
I don't think we've seen a -f
flag in PCL_DEFINITIONS
before, so this might be a case that Yak's CMakeLists.txt doesn't handle correctly. For PCL 1.9 the contents of PCL_DEFINITIONS
get passed into target_compile_definitions
for the yak_frontend
library at this line, and that might not be the correct way to handle flags like -ffloat-store
. We have a macro to parse mixed options and definitions, so we might need to create something similar to separate mixed flags and definitions.
@duanyongli I was able to replicate this by manually-prepending -ffloat-store
to PCL_DEFINITIONS
. Our target_add_options_and_definitions
macro doesn't check to see if the prefix is -f
, so -ffloat-store
was incorrectly being added through target_compile_definitions
instead of target_compile_options
. There were also some issues with PCL_DEFINITIONS
being inconsistently-delimited so that multiple flags and definitions would be incorrectly concatenated. As discussed in #9 and #10 this is specifically a problem with PCL 1.8.X and it's been fixed in PCL 1.9.X and later.
I modified the macro to correctly handle -f
-prefixed options and inconsistent delimiters, and I'll have a PR with the fix submitted shortly.
@duanyongli Sorry this took a long time to get fixed and merged in. Let us know if you still encounter this problem on the newest version.