2017-09-26 79 views
1

我試圖在我的筆記本電腦上運行this項目。我已經安裝了以下的東西。使用CUDA和C++運行現有項目

CUDA:

nvcc: NVIDIA (R) Cuda compiler driver 
Copyright (c) 2005-2015 NVIDIA Corporation 
Built on Tue_Aug_11_14:27:32_CDT_2015 
Cuda compilation tools, release 7.5, V7.5.17 

GCC:

gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904 
Copyright (C) 2015 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

的CMake:

cmake version 3.5.1 

make。該項目出現以下錯誤。

/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. 

如果我爲了支持C++標準11.添加set (CMAKE_CXX_STANDARD 11)CMakesLists.txt我碰到下面的錯誤。

In file included from /usr/include/mrpt/base/include/mrpt/utils.h:25:0, 
       from /home/muazzam/mywork/python/thesis/PD-Flow/scene_flow_visualization.h:24, 
       from /home/muazzam/mywork/python/thesis/PD-Flow/main_scene_flow_visualization.cpp:24: 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:253:8: error: ‘std::enable_if_t’ has not been declared 
    std::enable_if_t<is_shared_ptr<T>::value>* = nullptr) 
     ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:253:19: error: expected ‘,’ or ‘...’ before ‘<’ token 
    std::enable_if_t<is_shared_ptr<T>::value>* = nullptr) 
       ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:263:8: error: ‘std::enable_if_t’ has not been declared 
    std::enable_if_t<!is_shared_ptr<T>::value>* = nullptr) 
     ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:263:19: error: expected ‘,’ or ‘...’ before ‘<’ token 
    std::enable_if_t<!is_shared_ptr<T>::value>* = nullptr) 
       ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:261:6: error: ‘template<class RET, class T, class ... R> RET mrpt::utils::CStream::ReadVariant_helper(mrpt::utils::CSerializable::Ptr&, int)’ cannot be overloaded 
    RET ReadVariant_helper(
    ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:251:6: error: with ‘template<class RET, class T, class ... R> RET mrpt::utils::CStream::ReadVariant_helper(mrpt::utils::CSerializable::Ptr&, int)’ 
    RET ReadVariant_helper(
    ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In member function ‘void mrpt::utils::CStream::WriteVariant(T)’: 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:314:15: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14 
    t.match([&](auto& o) { this->WriteObject(o); }); 
      ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In lambda function: 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:314:45: error: no matching function for call to ‘mrpt::utils::CStream::WriteObject(int&)’ 
    t.match([&](auto& o) { this->WriteObject(o); }); 
              ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:197:7: note: candidate: void mrpt::utils::CStream::WriteObject(const mrpt::utils::CSerializable*) <near match> 
    void WriteObject(const CSerializable* o); 
    ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:197:7: note: conversion of argument 1 would be ill-formed: 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:198:7: note: candidate: void mrpt::utils::CStream::WriteObject(const mrpt::utils::CSerializable&) 
    void WriteObject(const CSerializable& o) { WriteObject(&o); } 
    ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:198:7: note: no known conversion for argument 1 from ‘int’ to ‘const mrpt::utils::CSerializable&’ 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: At global scope: 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:524:28: error: ‘std::enable_if_t’ has not been declared 
template <typename T, std::enable_if_t<std::is_base_of< 
          ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:524:39: error: expected ‘>’ before ‘<’ token 
template <typename T, std::enable_if_t<std::is_base_of< 
            ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In function ‘mrpt::utils::CStream& mrpt::utils::operator<<(mrpt::utils::CStream&, const mapbox::util::variant<Types ...>&)’: 
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:545:17: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14 
    pObj.match([&](auto& t) { out << t; }); 
       ^
In file included from /usr/include/mrpt/base/include/mrpt/utils/TCamera.h:15:0, 
       from /usr/include/mrpt/base/include/mrpt/utils/CImage.h:16, 
       from /usr/include/mrpt/base/include/mrpt/utils.h:38, 
       from /home/muazzam/mywork/python/thesis/PD-Flow/scene_flow_visualization.h:24, 
       from /home/muazzam/mywork/python/thesis/PD-Flow/main_scene_flow_visualization.cpp:24: 
/usr/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h: At global scope: 
/usr/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:80:22: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type 
     typename = std::enable_if_t<std::is_enum<enum_t>::value>> 
        ^
/usr/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:80:33: error: expected ‘>’ before ‘<’ token 
     typename = std::enable_if_t<std::is_enum<enum_t>::value>> 
           ^
/usr/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:96:22: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type 
     typename = std::enable_if_t<!std::is_enum<data_t>::value>> 
        ^
/usr/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:96:33: error: expected ‘>’ before ‘<’ token 
     typename = std::enable_if_t<!std::is_enum<data_t>::value>> 
           ^
In file included from /home/muazzam/mywork/python/thesis/PD-Flow/main_scene_flow_visualization.cpp:24:0: 
/home/muazzam/mywork/python/thesis/PD-Flow/scene_flow_visualization.h:93:13: error: ‘COpenGLScenePtr’ in namespace ‘mrpt::opengl’ does not name a type 
    opengl::COpenGLScenePtr scene; 
      ^
CMakeFiles/Scene-Flow-Visualization.dir/build.make:62: recipe for target 'CMakeFiles/Scene-Flow-Visualization.dir/main_scene_flow_visualization.o' failed 
make[2]: *** [CMakeFiles/Scene-Flow-Visualization.dir/main_scene_flow_visualization.o] Error 1 
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Scene-Flow-Visualization.dir/all' failed 
make[1]: *** [CMakeFiles/Scene-Flow-Visualization.dir/all] Error 2 
Makefile:83: recipe for target 'all' failed 
make: *** [all] Error 2 

現在我不知道如何使這項工作。從一天起我就陷入這種困境。任何人都可以幫我建立這個項目嗎?請。

+0

你嘗試到'-std = C++ 11'添加到您的CMake標誌? – Chiel

+0

嗨Chiel,我對Cmake頗爲陌生。你能告訴我我應該在cmake文件中添加這行嗎? – Mj1992

+0

我試過'SET(CMAKE_CXX_FLAGS -std = C++ 11)'但給了我同樣的'std :: enable_if_t'錯誤。 – Mj1992

回答

2

std::enable_if_t在C++ 14只推出,所以你應該設定所要求的標準,以C++ 14:

set(CMAKE_CXX_STANDARD 14) 
+0

嗨,謝謝。這解決了大部分問題。但我仍然收到這個錯誤。它有某種相關性嗎? '錯誤:命名空間mrpt :: opengl中的COpenGLScenePtr沒有命名類型opengl :: COpenGLScenePtr場景' – Mj1992

+0

@ Mj1992似乎沒有關係。 – Angew