PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Unable to use assign to fill a vector from data held by set.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
kgt@lanl.gov



Joined: 03 Feb 2006
Posts: 2

PostPosted: Fri Feb 03, 2006 1:03 pm    Post subject: Unable to use assign to fill a vector from data held by set. Reply with quote

pgCC is unable to compile the code shown below. This code attempts to fill a vector using the assign member function where the arguments to the function are iterators for a set. Both pgCC version 5.2-4 and 6.0-2 produce this error. Neither g++ (Linux) or cxx (Tru64) exhibit this problem.

Code:

// file: sample.cc
#include <set>
#include <vector>

int main()
{
    using namespace std;

    std::set<unsigned> su;
    std::vector<unsigned> vu;

    su.insert(1);
    su.insert(100);
    su.insert(99);

    vu.assign( su.begin(), su.end() );

    return 0;
}


Executing

pgCC g sample.cc

produces the error

Code:

"/usr/local/pgi/linux86/6.0/include/CC/stl/_algobase.h", line 200: error: no
          suitable conversion function from
          "std::_Rb_tree_iterator<std::_Rb_tree<std::set<unsigned int,
          std::less<unsigned int>, std::allocator<unsigned int>>::key_type,
          std::set<unsigned int, std::less<unsigned int>,
          std::allocator<unsigned int>>::value_type,
          std::_Identity<std::set<unsigned int, std::less<unsigned int>,
          std::allocator<unsigned int>>::value_type>, std::set<unsigned int,
          std::less<unsigned int>, std::allocator<unsigned int>>::key_compare,
          std::allocator<unsigned int>>::value_type,
          std::_Const_traits<std::_Rb_tree<std::set<unsigned int,
          std::less<unsigned int>, std::allocator<unsigned int>>::key_type,
          std::set<unsigned int, std::less<unsigned int>,
          std::allocator<unsigned int>>::value_type,
          std::_Identity<std::set<unsigned int, std::less<unsigned int>,
          std::allocator<unsigned int>>::value_type>, std::set<unsigned int,
          std::less<unsigned int>, std::allocator<unsigned int>>::key_compare,
          std::allocator<unsigned int>>::value_type>>" to "const void *" exists
    return (_OutputIter)__copy_trivial(__first, __last, __result);


Any suggestions?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6211
Location: The Portland Group Inc.

PostPosted: Fri Feb 03, 2006 4:12 pm    Post subject: Reply with quote

Hello kgt,

I sent this on to our compiler team, and sure enough, it's a bug in our STL. Fortunately, it was an easy fix and should be available in our 6.1-3 release currently scheduled for March 2nd.

In the mean time you can fix the error by removing the comment at line 199 and then commenting out line 200 in the file "$PGI/linux86-64/6.1/include/CC/stl/_algobase.h".

Code:
<   //  return (_OutputIter)__copy_trivial(&(*__first), &(*__last), &(*__result));
<   return (_OutputIter)__copy_trivial(__first, __last, __result);
---
>     return (_OutputIter)__copy_trivial(&(*__first), &(*__last), &(*__result));
>   //PGI conversion erorr:return (_OutputIter)__copy_trivial(__first, __last, __result);


Thank you for bring this to our attention,
Mat
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6211
Location: The Portland Group Inc.

PostPosted: Tue Feb 28, 2006 2:19 pm    Post subject: Reply with quote

FYI, I've confirmed that this issue (TPR#3736) has been fixed in 6.1-3.

- Mat
Back to top
View user's profile
kgt@lanl.gov



Joined: 03 Feb 2006
Posts: 2

PostPosted: Mon Apr 10, 2006 3:14 pm    Post subject: Still broken in 6.1-3 ??? Reply with quote

Hi,

Our sysadmins finally installed PGI 6.1-3 and I tried to compile my sample code again. Unfortunately, the code still fails to compile:

% pgCC --version

pgCC 6.1-3 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.

% pgCC -g sample.cc

"/opt/PGI/pgi_6.1-3/linux86/6.1/include/CC/stl/_algobase.h", line 200: error:
no suitable conversion function from
"std::_Rb_tree_iterator<std::_Rb_tree<std::set<unsigned int,
std::less<unsigned int>, std::allocator<unsigned int>>::key_type,
std::set<unsigned int, std::less<unsigned int>,
std::allocator<unsigned int>>::value_type,
std::_Identity<std::set<unsigned int, std::less<unsigned int>,
std::allocator<unsigned int>>::value_type>, std::set<unsigned int,
std::less<unsigned int>, std::allocator<unsigned int>>::key_compare,
std::allocator<unsigned int>>::value_type,
std::_Const_traits<std::_Rb_tree<std::set<unsigned int,
std::less<unsigned int>, std::allocator<unsigned int>>::key_type,
std::set<unsigned int, std::less<unsigned int>,
std::allocator<unsigned int>>::value_type,
std::_Identity<std::set<unsigned int, std::less<unsigned int>,
std::allocator<unsigned int>>::value_type>, std::set<unsigned int,
std::less<unsigned int>, std::allocator<unsigned int>>::key_compare,
std::allocator<unsigned int>>::value_type>>" to "const void *" exists return (_OutputIter)__copy_trivial(__first, __last, __result);
^
<snip>

Any other suggestions?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6211
Location: The Portland Group Inc.

PostPosted: Mon Apr 10, 2006 3:39 pm    Post subject: Reply with quote

Hi kgt,

We did fix this for the 64-bit 6.1-3 pgCC STL but it appears we missed the 32-bit pgCC STL. Fortunately, it's the same file for both targets so you can manually change the 32-bit file as shown above or copy "/opt/PGI/pgi_6.1-3/linux86-64/6.1/include/CC/stl/_algobase.h" to "/opt/PGI/pgi_6.1-3/linux86/6.1/include/CC/stl/_algobase.h".

I have reopened TPR#3736 and sincerely appologize for this oversite.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group