PGI编译器:macOSX上的编译时错误

时间:2017-04-19 07:24:01

标签: c++ macos openacc pgi

我的macOS是10.12.4 我已经在我的macbook上安装了PGI(只需通过从PGI官方网站下载的安装程序安装,激活自己的控制台,没有其他操作,在这个控制台中,有像" pgcc pgc ++等命令&# 34;),版本是16.10 我用CLion编辑测试代码:

#include <iostream>

#ifdef _OPENACC
#include <openacc.h>
#endif

using namespace std;

int main() {
#ifdef _OPENACC
    //part 1
    cout<<acc_get_num_devices(acc_device_not_host)<<endl;

    //part2
//    const int N = 1024;
//    //定义
//    int i, a[N], b[N], c[N];
//
//    for (i = 0; i < N; i++) {
//        c[i] = 0;
//        a[i] = b[i] = i;
//    }
//
//#pragma acc kernels
//    for (i = 0; i < N; i++) {
//        c[i] = b[i] + a[i];
//    }
//    std::cout << c[1] << std::endl;

#else
    cout << "not support OpenACC" << endl;

#endif

    return 0;
}

当我认罪时,我遇到了一些问题:

MacBook13:TestOpenCV Chen$ pgc++ -acc -std=c++11 -Minfo main.cpp
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 93: error: pair is not a
          template
  template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
                                                      ^

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 97: error: pair is not a
          template
  typename tuple_element<_Ip, pair<_T1, _T2> >::type&
                              ^

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 98: error: pair is not a
          template
  get(pair<_T1, _T2>&) _NOEXCEPT;
      ^

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 102: error: pair is not a
          template
  const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
                                    ^

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 103: error: pair is not a
          template
  get(const pair<_T1, _T2>&) _NOEXCEPT;
            ^

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 108: error: pair is not a
          template
  typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
                              ^

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
          /usr/bin/../include/c++/v1/__tuple", line 109: error: pair is not a
          template
  get(pair<_T1, _T2>&&) _NOEXCEPT;
      ^

7 errors detected in the compilation of "main.cpp".

并且无论使用pgc ++执行哪个部分(第1部分或第2部分),错误信息可能都是一样的,我不知道在哪里可以开始解决这个问题,我是一个新的macbook ,真的希望得到你的帮助〜

0 个答案:

没有答案