Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 820593

Summary: sci-libs/vtk-{9.0.3-r4,9.1.0} USE=cuda - error: expected class-name before ‘{’ token
Product: Gentoo Linux Reporter: Bernd <waebbl-gentoo>
Component: Current packagesAssignee: Bernd <waebbl-gentoo>
Status: CONFIRMED ---    
Severity: normal CC: fordfrog, proxy-maint, sci
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/22878
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 732706    
Attachments: emerge-info-vtk-9.0.3-r1.txt
vtk-9.0.3-r1:20211027-223133.log.bz2

Description Bernd 2021-10-28 11:34:45 UTC
While updating to the latest 9.0.3-r1, I encountered this cuda related error:

FAILED: ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/cont/CMakeFiles/vtkm_cont.dir/ArrayHandleVirtual.cxx.o 
/opt/cuda/bin/nvcc -forward-unknown-to-host-compiler -DVTK_IN_VTK -I/var/tmp/portage-ondisk/portage/sci-libs/v
tk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m -I/var/tmp/portage-ondisk/portage/sci-libs/vtk-9.0.3-
r1/work/vtk-9.0.3_build/ThirdParty/vtkm/vtkvtkm/vtk-m/include -I/var/tmp/portage-ondisk/portage/sci-libs/vtk-9
.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/taotuple -I/var/tmp/portage-ondisk/portag
e/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/optionparser -I/var/tmp/p
ortage-ondisk/portage/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/diy -
I/var/tmp/portage-ondisk/portage/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/third
party/lcl/vtkmlcl -I/var/tmp/portage-ondisk/portage/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvt
km/vtk-m/vtkm/thirdparty/loguru --generate-code=arch=compute_35,code=sm_35 -Xnvlink=--suppress-stack-size-warn
ing -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -Xcompiler=-Wall,-Wno-unknown-pragmas,-Wno-unused-local-ty
pedefs,-Wno-unused-local-typedefs,-Wno-unused-function,-Wcast-align,-Wchar-subscripts,-Wpointer-arith,-Wformat
,-Wformat-security,-Wshadow,-Wunused,-fno-common,-Wfloat-conversion,-Wodr -Xcudafe=--display_error_number -Xco
mpiler=-ffunction-sections --expt-relaxed-constexpr -Xcompiler=-fopenmp -std=c++11 -MD -MT ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/cont/CMakeFiles/vtkm_cont.dir/ArrayHandleVirtual.cxx.o -MF ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/cont/CMakeFiles/vtkm_cont.dir/ArrayHandleVirtual.cxx.o.d -x cu -dc /var/tmp/portage-ondisk/portage/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/cont/ArrayHandleVirtual.cxx -o ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/cont/CMakeFiles/vtkm_cont.dir/ArrayHandleVirtual.cxx.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
... several warnings omitted ...
/var/tmp/portage-ondisk/portage/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/internal/brigand.hpp:1061:131: error: expected class-name before ‘{’ token
 1061 |         struct find<true, false, L1, L2, Ls...> : find<true, F<Ts..., L2>::value, L2, Ls...>
      |                                                                                                                                   ^
/var/tmp/portage-ondisk/portage/sci-libs/vtk-9.0.3-r1/work/VTK-9.0.3/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/internal/brigand.hpp:1067:160: error: expected class-name before ‘{’ token
 1067 |         struct find<false, false, L0, L1, L2, L3, L4, L5, L6, L7, L8, Ls...>
      |                                                                                                       

followed by an identical error in another file before the build stops.

Could this be a gcc-11 related issue? I emerged 9.0.3 on Oct 2nd with the same use flags but still with gcc-10 and finally updated to use gcc-11 on Oct 17th.

Reproducible: Always




Build log and emerge --info output attached.

# emerge -pqv =vtk-9.0.3-r1
[ebuild     U ] sci-libs/vtk-9.0.3-r1 [9.0.3] USE="X boost cuda doc examples ffmpeg gdal imaging json mpi openmp pegtl postgres python qt5 rendering theora views -all-modules -java -kits -mysql -odbc -offscreen -tbb -test -tk -web" PYTHON_SINGLE_TARGET="python3_9 -python3_8" VIDEO_CARDS="nvidia"
Comment 1 Bernd 2021-10-28 11:36:39 UTC
Created attachment 747078 [details]
emerge-info-vtk-9.0.3-r1.txt

output of emerge --info =vtk-9.0.3-r1
Comment 2 Bernd 2021-10-28 11:37:17 UTC
Created attachment 747081 [details]
vtk-9.0.3-r1:20211027-223133.log.bz2

build log
Comment 3 Thomas Scheiblauer 2021-11-02 09:53:06 UTC
It compiles with gcc-10 but not 11
Comment 4 Bernd 2021-11-02 17:54:56 UTC
Thanks for testing this. Didn't had the time yet to test with both compilers.
Comment 5 Bernd 2021-11-12 19:34:10 UTC
still happens with 9.1.0
Comment 6 Thomas Scheiblauer 2021-12-02 22:28:58 UTC
Now it doesn't even compile with gcc-10 any more.
The error seems to be produced by nvcc.
Comment 7 Larry the Git Cow gentoo-dev 2021-12-14 08:36:25 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6010f1d0f545b9ddf5f2ee3fd673332d8342821a

commit 6010f1d0f545b9ddf5f2ee3fd673332d8342821a
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2021-11-05 19:34:22 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-12-14 08:36:16 +0000

    sci-libs/vtk: bump to 9.1.0
    
    Bug: https://bugs.gentoo.org/820593
    Closes: https://bugs.gentoo.org/822780
    Closes: https://bugs.gentoo.org/820521
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 sci-libs/vtk/Manifest         |   6 +
 sci-libs/vtk/vtk-9.1.0.ebuild | 596 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 602 insertions(+)
Comment 8 Scott Alfter 2022-05-18 04:46:18 UTC
vtk-9.1.0-r1 doesn't fix the error, either.  I'm getting the same error:

/var/tmp/portage/sci-libs/vtk-9.1.0-r1/work/VTK-9.1.0/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/internal/brigand.hpp:1061:131: error: expected class-name before ‘{’ token


as the OP when building with CUDA enabled and VTK_CUDA_ARCH=pascal set in /etc/portage/make.conf (as I'm running a GeForce GTX 1070).  Without CUDA, it builds OK.

Looking at the commit history for VTK-m (https://gitlab.kitware.com/vtk/vtk-m/-/commit/a771359d7222b835043481c24139ecc36bf9d39d), it looks like brigand.hpp was deprecated and removed about 3 months ago.  Perhaps a backport of these changes is in order.
Comment 9 Bernd 2022-05-18 05:34:09 UTC
(In reply to Scott Alfter from comment #8)
> vtk-9.1.0-r1 doesn't fix the error, either.  I'm getting the same error:
> 

I'm aware of this. Changed the title to reflect this.

> Looking at the commit history for VTK-m
> (https://gitlab.kitware.com/vtk/vtk-m/-/commit/
> a771359d7222b835043481c24139ecc36bf9d39d), it looks like brigand.hpp was
> deprecated and removed about 3 months ago.  Perhaps a backport of these
> changes is in order.

Thanks for the hint. I wasn't yet aware of this change. That's a huge change, not just the commit you have linked, look at the merge request at https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/2715.

I'm wondering whether it wouldn't be better to mask the cuda USE flag, until vtk uses a vtk-m version with these changes in place?