Skip to content

Compilation errors with gcc-14 and c++11

Description:

There are compiler errors when compiling with nvcc -c -std=c++11, which prevents alvr-nvidia from compiling ffmpeg with cuda support. It compiles fine with gcc-13.

Makepkg truncated output for alvr-nvidia
$ bash -c "PKG_CONFIG_PATH=\'/home/remi/.cache/yay/alvr-nvidia/src/alvr/deps/linux/nv-codec-headers/build/lib/pkgconfig\' ./configure --prefix=/home/remi/.cache/yay/alvr-nvidia/src/alvr/deps/linux/ffmpeg/alvr_build --enable-gpl --enable-version3 --enable-static --disable-programs --disable-doc --disable-avdevice --disable-avformat --disable-swresample --disable-swscale --disable-postproc --disable-network --disable-everything --enable-encoder=h264_vaapi --enable-encoder=hevc_vaapi --enable-encoder=av1_vaapi --enable-hwaccel=h264_vaapi --enable-hwaccel=hevc_vaapi --enable-hwaccel=av1_vaapi --enable-filter=scale_vaapi --enable-vulkan --enable-libdrm --enable-pic --enable-rpath --fatal-warnings --enable-encoder=h264_nvenc --enable-encoder=hevc_nvenc --enable-encoder=av1_nvenc --enable-nonfree --enable-cuda-nvcc --enable-libnpp --nvccflags=\"-gencode arch=compute_52,code=sm_52 -O2\" --extra-cflags=\"-I/opt/cuda/targets/x86_64-linux/include\" --extra-ldflags=\"-L/opt/cuda/targets/x86_64-linux/lib\""
ERROR: failed checking for nvcc.

Additional info:

  • package version(s):
    • cuda 12.8.1-3
    • gcc14 14.2.1+r753+g1cd744a6828f-2
    • gcc13 13.3.1+r432+gfc8bd63119c0-2

Steps to reproduce:

  1. Create the file test.cu
extern "C" {
    __global__ void hello(unsigned char *data) {}
}
  1. Compile with nvcc -c -std=c++11 test.cu
Output
nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/c++/type_traits(1610): error: "__is_nothrow_new_constructible" is not a function or static data member


      constexpr bool __is_nothrow_new_constructible
                     ^

/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/c++/type_traits(1610): error: "constexpr" is not valid here


      constexpr bool __is_nothrow_new_constructible
      ^

2 errors detected in the compilation of "test.cu".

3. Compile with `NVCC_CCBIN='gcc-13' nvcc -c -std=c++11 test.cu`

Output
nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information