Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 820593 - sci-libs/vtk-{9.0.3-r4,9.1.0} USE=cuda - error: expected class-name before ‘{’ token
Summary: sci-libs/vtk-{9.0.3-r4,9.1.0} USE=cuda - error: expected class-name before ‘{...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernd
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2021-10-28 11:34 UTC by Bernd
Modified: 2022-12-12 06:08 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info-vtk-9.0.3-r1.txt (emerge-info-vtk-9.0.3-r1.txt,10.84 KB, text/plain)
2021-10-28 11:36 UTC, Bernd
Details
vtk-9.0.3-r1:20211027-223133.log.bz2 (vtk-9.0.3-r1:20211027-223133.log.bz2,208.97 KB, application/octet-stream)
2021-10-28 11:37 UTC, Bernd
Details

Note You need to log in before you can comment on or make changes to this bug.
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?
Comment 10 Bernd 2022-10-19 06:13:19 UTC
This will be fixed in the v9.2.2 bump, which I'm currently preparing.
Upstream removed the fragile brigand.hpp which causes this issue. On my tests so far, vtk-9.2.2 builds with USE=cuda.
Comment 11 Larry the Git Cow gentoo-dev 2022-12-12 06:08:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=588025882a58b613f5ef08e02b96efbb7d4c7445

commit 588025882a58b613f5ef08e02b96efbb7d4c7445
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2022-09-29 05:18:39 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-12-12 06:08:29 +0000

    sci-libs/vtk: add 9.2.2
    
    - add a new function to check memory and disk space requirements
    - don't drop bundled external libraries, it's only a few MB which are freed
            through this and upstream does a good job to avoid automagic deps
    - request more modules to build explicitly depending on USE flag settings
    - don't export CC and friends with USE=mpi, package builds fine with gcc and still
            links to MPI libraries
    - add USE flag to build vtk-m optional
    
    Bug: https://bugs.gentoo.org/793221
    Bug: https://bugs.gentoo.org/835659
    Bug: https://bugs.gentoo.org/880759
    Closes: https://bugs.gentoo.org/820593
    Closes: https://bugs.gentoo.org/827310
    Closes: https://bugs.gentoo.org/846374
    Closes: https://bugs.gentoo.org/874798
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Closes: https://github.com/gentoo/gentoo/pull/28250
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 sci-libs/vtk/Manifest                              |   6 +
 .../vtk-9.2.2-VTKm-respect-user-CXXFLAGS.patch     |  81 +++
 ...9.2.2-link-with-glut-library-for-freeglut.patch |  18 +
 ...metryFilter-add-missing-mutex-header-file.patch |  20 +
 sci-libs/vtk/metadata.xml                          |  11 +-
 sci-libs/vtk/vtk-9.2.2.ebuild                      | 728 +++++++++++++++++++++
 6 files changed, 863 insertions(+), 1 deletion(-)