Nvc++ fails with "remove_const_t is not a template"

When I attempt to compile the following C++ code:

#include <numeric>
#include <execution>

int main() {
    return 0;
}

…with nvc++ -stdpar -std=c++20 example.cpp, the following error is generated:

"/zapps7/nvidia-hpc-sdk/23.7/gcc-13.2.0_cuda-12.2/Linux_x86_64/23.7/compilers/include-stdpar/cuda/std/detail/libcxx/include/__functional/../__iterator/iterator_traits.h", line 143: error: remove_const_t is not a template
  using __iter_key_type = remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
                          ^

"/zapps7/nvidia-hpc-sdk/23.7/gcc-13.2.0_cuda-12.2/Linux_x86_64/23.7/compilers/include-stdpar/cuda/std/detail/libcxx/include/__functional/../__iterator/iterator_traits.h", line 150: error: add_const_t is not a template
      add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>,
      ^

2 errors detected in the compilation of "example.cpp".

I found this when trying to use std::transform_reduce(std::execution::par_unseq, ...), which requires <numeric> and <execution>.

My nvhpc version is 23.7, with Cuda 12.2 and GCC 13.2.0. I’m using the official modulefile included in the install. The operating system is RHEL 7.9.

Hi Michael,

We don’t support interoperability with GNU 13.x just yet. GNU 13.x made several fundamental changes that we’re needing to account for. However in our 23.5 we did make several updates which got past most issues.

For this issue, I’m not able to recreate it (it compiles fine for me), so not clear what could be causing it. Let me check with one of our C++ engineers to see if he might have some ideas on what’s going on.

-Mat

% cat example.cpp
#include <numeric>
#include <execution>
int main() {
    return 0;
}
% nvc++ -stdpar -std=c++14 example.cpp -V23.7 --gcc-toolchain=/home/sw/thirdparty/gcc/gcc-13.2.0/Linux_x86_64/
%

Hi Michael,

We were able to replicate the error, but only when configuring nvc++ to use the STL from GNU 4.8.

For GNU 13.2, did you update the default GNU on your system or are you using a build found in a different location?

For the later, try using the “–gcc-toolchain” flag to point to the non-default location.

For the former, you may need to update the compiler’s configuration file, “localrc”, via the command “makelocalrc -d . -x”, then copy the generated localrc to the compiler’s bin directory.

Alternatively, you can configure the localrc to use the GNU 13.2 install by running “makelocalrc -d . -x -gcc /full/path/to/gcc -gpp /full/path/to/g++ -g77 /full/path/to/gfortran”. You can then rename the localrc file to whatever you like and put it in any directory. Then to use this configuation, set the environment variable “NVLOCALRC=/full/path/to/localrc.gnu132” (change the filename to what you used).

-Mat

Mat,

Ah, that was it–I had foolishly assumed that having 13.2 loaded at install time and at compile time was all that was needed, adding --gcc-toolchain did the trick. Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.