cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.37k stars 911 forks source link

ISO C++ 2011 standard for PatchMatchCUDA #832

Open jianweike opened 2 years ago

jianweike commented 2 years ago

Describe the bug Cmake error when compiling the latest OpenVMS version with CUDA. The error message is " In file included from /usr/include/c++/5/cstdint:35:0, from /home/jianwei/Documents/OpenMVS_dynamic/openMVS/libs/MVS/PatchMatchCUDA.inl:40, from /home/jianwei/Documents/OpenMVS_dynamic/openMVS/libs/MVS/PatchMatchCUDA.cu:32: /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 \

"

To Reproduce Steps to reproduce the behavior: cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT="/home/jianwei/Documents/OpenMVS_dynamic/vcglib" -- The C compiler identification is GNU 5.5.0 -- The CXX compiler identification is GNU 5.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detected version of GNU GCC: 55 (505) Compiling with C++17 -- Performing Test HAVE_CXX_W -- Performing Test HAVE_CXX_W - Success -- Performing Test HAVE_C_W -- Performing Test HAVE_C_W - Success -- Performing Test HAVE_CXX_WALL -- Performing Test HAVE_CXX_WALL - Success -- Performing Test HAVE_C_WALL -- Performing Test HAVE_C_WALL - Success -- Performing Test HAVE_CXX_WERROR_ADDRESS -- Performing Test HAVE_CXX_WERROR_ADDRESS - Success -- Performing Test HAVE_C_WERROR_ADDRESS -- Performing Test HAVE_C_WERROR_ADDRESS - Success -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success -- Performing Test HAVE_CXX_WFORMAT -- Performing Test HAVE_CXX_WFORMAT - Success -- Performing Test HAVE_C_WFORMAT -- Performing Test HAVE_C_WFORMAT - Success -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed -- Performing Test HAVE_C_WSTRICT_PROTOTYPES -- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success -- Performing Test HAVE_CXX_WINIT_SELF -- Performing Test HAVE_CXX_WINIT_SELF - Success -- Performing Test HAVE_C_WINIT_SELF -- Performing Test HAVE_C_WINIT_SELF - Success -- Performing Test HAVE_CXX_WSIGN_PROMO -- Performing Test HAVE_CXX_WSIGN_PROMO - Success -- Performing Test HAVE_C_WSIGN_PROMO -- Performing Test HAVE_C_WSIGN_PROMO - Failed -- Performing Test HAVE_CXX_WREORDER -- Performing Test HAVE_CXX_WREORDER - Success -- Performing Test HAVE_C_WREORDER -- Performing Test HAVE_C_WREORDER - Failed -- Performing Test HAVE_CXX_WNO_UNDEF -- Performing Test HAVE_CXX_WNO_UNDEF - Success -- Performing Test HAVE_C_WNO_UNDEF -- Performing Test HAVE_C_WNO_UNDEF - Success -- Performing Test HAVE_CXX_WNO_SWITCH -- Performing Test HAVE_CXX_WNO_SWITCH - Success -- Performing Test HAVE_C_WNO_SWITCH -- Performing Test HAVE_C_WNO_SWITCH - Success -- Performing Test HAVE_CXX_WNO_SWITCH_ENUM -- Performing Test HAVE_CXX_WNO_SWITCH_ENUM - Success -- Performing Test HAVE_C_WNO_SWITCH_ENUM -- Performing Test HAVE_C_WNO_SWITCH_ENUM - Success -- Performing Test HAVE_CXX_WNO_SWITCH_DEFAULT -- Performing Test HAVE_CXX_WNO_SWITCH_DEFAULT - Success -- Performing Test HAVE_C_WNO_SWITCH_DEFAULT -- Performing Test HAVE_C_WNO_SWITCH_DEFAULT - Success -- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH -- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Failed -- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH -- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Failed -- Performing Test HAVE_CXX_WNO_COMMENT -- Performing Test HAVE_CXX_WNO_COMMENT - Success -- Performing Test HAVE_C_WNO_COMMENT -- Performing Test HAVE_C_WNO_COMMENT - Success -- Performing Test HAVE_CXX_WNO_NARROWING -- Performing Test HAVE_CXX_WNO_NARROWING - Success -- Performing Test HAVE_C_WNO_NARROWING -- Performing Test HAVE_C_WNO_NARROWING - Success -- Performing Test HAVE_CXX_WNO_ATTRIBUTES -- Performing Test HAVE_CXX_WNO_ATTRIBUTES - Success -- Performing Test HAVE_C_WNO_ATTRIBUTES -- Performing Test HAVE_C_WNO_ATTRIBUTES - Success -- Performing Test HAVE_CXX_WNO_IGNORED_ATTRIBUTES -- Performing Test HAVE_CXX_WNO_IGNORED_ATTRIBUTES - Failed -- Performing Test HAVE_C_WNO_IGNORED_ATTRIBUTES -- Performing Test HAVE_C_WNO_IGNORED_ATTRIBUTES - Failed -- Performing Test HAVE_CXX_WNO_MAYBE_UNINITIALIZED -- Performing Test HAVE_CXX_WNO_MAYBE_UNINITIALIZED - Success -- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED -- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Success -- Performing Test HAVE_CXX_WNO_ENUM_COMPARE -- Performing Test HAVE_CXX_WNO_ENUM_COMPARE - Success -- Performing Test HAVE_C_WNO_ENUM_COMPARE -- Performing Test HAVE_C_WNO_ENUM_COMPARE - Success -- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION -- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION - Failed -- Performing Test HAVE_C_WNO_MISLEADING_INDENTATION -- Performing Test HAVE_C_WNO_MISLEADING_INDENTATION - Failed -- Performing Test HAVE_CXX_WNO_MISSING_FIELD_INITIALIZERS -- Performing Test HAVE_CXX_WNO_MISSING_FIELD_INITIALIZERS - Success -- Performing Test HAVE_C_WNO_MISSING_FIELD_INITIALIZERS -- Performing Test HAVE_C_WNO_MISSING_FIELD_INITIALIZERS - Success -- Performing Test HAVE_CXX_WNO_UNUSED_RESULT -- Performing Test HAVE_CXX_WNO_UNUSED_RESULT - Success -- Performing Test HAVE_C_WNO_UNUSED_RESULT -- Performing Test HAVE_C_WNO_UNUSED_RESULT - Success -- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION -- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION - Success -- Performing Test HAVE_C_WNO_UNUSED_FUNCTION -- Performing Test HAVE_C_WNO_UNUSED_FUNCTION - Success -- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER -- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success -- Performing Test HAVE_C_WNO_UNUSED_PARAMETER -- Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success -- Performing Test HAVE_CXX_WNO_DELETE_INCOMPLETE -- Performing Test HAVE_CXX_WNO_DELETE_INCOMPLETE - Success -- Performing Test HAVE_C_WNO_DELETE_INCOMPLETE -- Performing Test HAVE_C_WNO_DELETE_INCOMPLETE - Failed -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed -- Performing Test HAVE_CXX_WNO_INT_IN_BOOL_CONTEXT -- Performing Test HAVE_CXX_WNO_INT_IN_BOOL_CONTEXT - Failed -- Performing Test HAVE_C_WNO_INT_IN_BOOL_CONTEXT -- Performing Test HAVE_C_WNO_INT_IN_BOOL_CONTEXT - Failed -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success -- Performing Test HAVE_CXX_FTEMPLATE_BACKTRACE_LIMIT_0 -- Performing Test HAVE_CXX_FTEMPLATE_BACKTRACE_LIMIT_0 - Success -- Performing Test HAVE_C_FTEMPLATE_BACKTRACE_LIMIT_0 -- Performing Test HAVE_C_FTEMPLATE_BACKTRACE_LIMIT_0 - Failed -- Performing Test HAVE_CXX_WNO_LONG_LONG -- Performing Test HAVE_CXX_WNO_LONG_LONG - Success -- Performing Test HAVE_C_WNO_LONG_LONG -- Performing Test HAVE_C_WNO_LONG_LONG - Success -- Performing Test HAVE_CXX_PTHREAD -- Performing Test HAVE_CXX_PTHREAD - Success -- Performing Test HAVE_C_PTHREAD -- Performing Test HAVE_C_PTHREAD - Success -- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER -- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success -- Performing Test HAVE_C_FOMIT_FRAME_POINTER -- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success -- Performing Test HAVE_CXX_FROUNDING_MATH -- Performing Test HAVE_CXX_FROUNDING_MATH - Success -- Performing Test HAVE_C_FROUNDING_MATH -- Performing Test HAVE_C_FROUNDING_MATH - Success -- Performing Test HAVE_CXX_MSSE -- Performing Test HAVE_CXX_MSSE - Success -- Performing Test HAVE_C_MSSE -- Performing Test HAVE_C_MSSE - Success -- Performing Test HAVE_CXX_MSSE2 -- Performing Test HAVE_CXX_MSSE2 - Success -- Performing Test HAVE_C_MSSE2 -- Performing Test HAVE_C_MSSE2 - Success -- Performing Test HAVE_CXX_MSSE3 -- Performing Test HAVE_CXX_MSSE3 - Success -- Performing Test HAVE_C_MSSE3 -- Performing Test HAVE_C_MSSE3 - Success -- Performing Test HAVE_CXX_MSSSE3 -- Performing Test HAVE_CXX_MSSSE3 - Success -- Performing Test HAVE_C_MSSSE3 -- Performing Test HAVE_C_MSSSE3 - Success -- Performing Test HAVE_CXX_MSSE4_1 -- Performing Test HAVE_CXX_MSSE4_1 - Success -- Performing Test HAVE_C_MSSE4_1 -- Performing Test HAVE_C_MSSE4_1 - Success -- Performing Test HAVE_CXX_MSSE4_2 -- Performing Test HAVE_CXX_MSSE4_2 - Success -- Performing Test HAVE_C_MSSE4_2 -- Performing Test HAVE_C_MSSE4_2 - Success -- Performing Test HAVE_CXX_FFUNCTION_SECTIONS -- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success -- Performing Test HAVE_C_FFUNCTION_SECTIONS -- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success -- Looking for inttypes.h -- Looking for inttypes.h - found -- Found OpenMP_C: -fopenmp (found version "4.0") -- Found OpenMP_CXX: -fopenmp (found version "4.0") -- Found OpenMP: TRUE (found version "4.0")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-9.0 (found version "9.0") -- The CUDA compiler identification is NVIDIA 9.0.176 -- Check for working CUDA compiler: /usr/local/cuda-9.0/bin/nvcc -- Check for working CUDA compiler: /usr/local/cuda-9.0/bin/nvcc -- works -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- WARNING: BREAKPAD was not found: Please specify BREAKPAD directory using BREAKPAD_ROOT env. variable -- Can't find BreakPad. Continuing without it. -- Found Boost: /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: iostreams program_options system serialization -- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "2.91.0") -- Eigen 3.2.10 found (include: /usr/local/include/eigen3) -- Found OpenCV: /usr/local (found version "3.4.1") -- OpenCV 3.4.1 found (include: /usr/local/include;/usr/local/include/opencv) -- __cplusplus is 201500 -- --> Do not link with Boost.Thread -- Found Boost: /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.48")
-- Boost include dirs: /usr/local/include -- Boost libraries:
-- VCG found (include: /home/jianwei/Documents/OpenMVS_dynamic/vcglib) -- GLEW 1.13.0 found (include: /usr/include) -- GLFW3 3.4.0 found (include: ) -- Configuring done -- Generating done -- Build files have been written to: /home/jianwei/Documents/OpenMVS_dynamic/openMVS_build

Scanning dependencies of target Common [ 1%] Building CXX object libs/Common/CMakeFiles/Common.dir/cmake_pch.hxx.gch [ 2%] Building CXX object libs/Common/CMakeFiles/Common.dir/ConfigTable.cpp.o [ 4%] Building CXX object libs/Common/CMakeFiles/Common.dir/Common.cpp.o [ 5%] Building CXX object libs/Common/CMakeFiles/Common.dir/EventQueue.cpp.o [ 7%] Building CXX object libs/Common/CMakeFiles/Common.dir/Log.cpp.o [ 8%] Building CXX object libs/Common/CMakeFiles/Common.dir/Timer.cpp.o [ 11%] Building CXX object libs/Common/CMakeFiles/Common.dir/SML.cpp.o [ 11%] Building CXX object libs/Common/CMakeFiles/Common.dir/Types.cpp.o [ 13%] Building CXX object libs/Common/CMakeFiles/Common.dir/Util.cpp.o /home/jianwei/Documents/OpenMVS_dynamic/openMVS/libs/Common/Util.cpp: In function ‘CPUINFO GetCPUInfo()’: /home/jianwei/Documents/OpenMVS_dynamic/openMVS/libs/Common/Util.cpp:533:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ((int)info.vendor) = CPUInfo[1]; ^ [ 14%] Building CXX object libs/Common/CMakeFiles/Common.dir/UtilCUDA.cpp.o [ 15%] Linking CXX static library ../../lib/libCommon.a [ 15%] Built target Common Scanning dependencies of target Math Scanning dependencies of target IO [ 17%] Building CXX object libs/Math/CMakeFiles/Math.dir/cmake_pch.hxx.gch [ 18%] Building CXX object libs/IO/CMakeFiles/IO.dir/cmake_pch.hxx.gch [ 20%] Building CXX object libs/IO/CMakeFiles/IO.dir/Common.cpp.o [ 21%] Building CXX object libs/IO/CMakeFiles/IO.dir/Image.cpp.o [ 23%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImageDDS.cpp.o [ 24%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImageJPG.cpp.o [ 28%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImageBMP.cpp.o [ 28%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImagePNG.cpp.o [ 28%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImageSCI.cpp.o [ 30%] Building CXX object libs/Math/CMakeFiles/Math.dir/Common.cpp.o [ 31%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImageTGA.cpp.o [ 33%] Building CXX object libs/Math/CMakeFiles/Math.dir/IBFS/IBFS.cpp.o [ 34%] Building CXX object libs/IO/CMakeFiles/IO.dir/ImageTIFF.cpp.o [ 36%] Building CXX object libs/IO/CMakeFiles/IO.dir/OBJ.cpp.o [ 37%] Building CXX object libs/IO/CMakeFiles/IO.dir/PLY.cpp.o [ 39%] Building CXX object libs/Math/CMakeFiles/Math.dir/LMFit/lmmin.cpp.o [ 40%] Building CXX object libs/IO/CMakeFiles/IO.dir/TinyXML2.cpp.o [ 42%] Linking CXX static library ../../lib/libMath.a [ 42%] Built target Math [ 43%] Linking CXX static library ../../lib/libIO.a [ 43%] Built target IO Scanning dependencies of target MVS [ 44%] Building CXX object libs/MVS/CMakeFiles/MVS.dir/cmake_pch.hxx.gch [ 46%] Building CUDA object libs/MVS/CMakeFiles/MVS.dir/PatchMatchCUDA.cu.o In file included from /usr/include/c++/5/cstdint:35:0, from /home/jianwei/Documents/OpenMVS_dynamic/openMVS/libs/MVS/PatchMatchCUDA.inl:40, from /home/jianwei/Documents/OpenMVS_dynamic/openMVS/libs/MVS/PatchMatchCUDA.cu:32: /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 \

^ libs/MVS/CMakeFiles/MVS.dir/build.make:316: recipe for target 'libs/MVS/CMakeFiles/MVS.dir/PatchMatchCUDA.cu.o' failed make[2]: [libs/MVS/CMakeFiles/MVS.dir/PatchMatchCUDA.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... CMakeFiles/Makefile2:471: recipe for target 'libs/MVS/CMakeFiles/MVS.dir/all' failed make[1]: [libs/MVS/CMakeFiles/MVS.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: [all] Error 2

cdcseacave commented 2 years ago

CUDA code is using C++17, pls make sure your compilers combo supports it

IridescentJiang commented 2 years ago

Hi! I encouter the same problem, have you solve this?

IridescentJiang commented 2 years ago

you may check your gcc&g++ version, i solved this problem by updating gcc&g++ version from 5.4 to 7.5 ! (with eigen 3.4, opencv 4.5)

zwl995 commented 8 months ago

Hello, I have encountered the same problem, I have checked the gcc version, it is 7.5, in addition, my cuda is 11.3, what other reasons are wrong?