Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 886343 - sci-libs/opencascade-7.7.0[vtk] fails to compile: expected identifier before ‘int’
Summary: sci-libs/opencascade-7.7.0[vtk] fails to compile: expected identifier 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:
 
Reported: 2022-12-16 14:49 UTC by Fat-Zer
Modified: 2022-12-31 15:36 UTC (History)
3 users (show)

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


Attachments
build.log.xz (build.log.xz,159.75 KB, application/x-xz)
2022-12-16 14:51 UTC, Fat-Zer
Details
emerge --info '=sci-libs/opencascade-7.7.0::gentoo' (emerge-info,9.90 KB, text/plain)
2022-12-16 14:52 UTC, Fat-Zer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fat-Zer 2022-12-16 14:49:25 UTC
This might be a sci-libs/vtk-9.2.2 issue, though I'm not sure: this happens because `X11/Xlib.h` (which is included indirectly) defines a `Status` macro as `int`. This breaks definition of a class of the same name in a subsequently included vtk file `vtk-9.2/vtksys/Status.hxx`.

```
[5927/5933] /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_RAPIDJSON -DHAVE_TK -DHAVE_VTK -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Dkiss_fft_scalar=double -I/var/tmp/portage/sci-libs/opencascade-7.7.0/work/occt-185d29b_build/include/opencascade -isystem /usr/include/freetype2 -isystem /usr/include/vtk-9.2 -isystem /usr/include/SDL2  -O2 -march=ivybridge -pipe -fexceptions -fPIC -Wall -Wextra -fPIC -fopenmp -std=gnu++11 -MD -MT src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -MF src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o.d -o src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.7.0/work/occt-185d29b/src/IVtkDraw/IVtkDraw_Interactor.cxx
FAILED: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_RAPIDJSON -DHAVE_TK -DHAVE_VTK -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Dkiss_fft_scalar=double -I/var/tmp/portage/sci-libs/opencascade-7.7.0/work/occt-185d29b_build/include/opencascade -isystem /usr/include/freetype2 -isystem /usr/include/vtk-9.2 -isystem /usr/include/SDL2  -O2 -march=ivybridge -pipe -fexceptions -fPIC -Wall -Wextra -fPIC -fopenmp -std=gnu++11 -MD -MT src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -MF src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o.d -o src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.7.0/work/occt-185d29b/src/IVtkDraw/IVtkDraw_Interactor.cxx
In file included from /usr/include/GL/glx.h:30,
                 from /var/tmp/portage/sci-libs/opencascade-7.7.0/work/occt-185d29b/src/IVtkDraw/IVtkDraw_Interactor.cxx:22:
/usr/include/vtk-9.2/vtksys/Status.hxx:15:21: error: expected identifier before ‘int’
   15 | class vtksys_EXPORT Status
      |                     ^~~~~~
In file included from /usr/include/vtk-9.2/vtksys/SystemTools.hxx:7,
                 from /usr/include/vtk-9.2/vtkSetGet.h:35,
                 from /usr/include/vtk-9.2/vtkObject.h:46,
                 from /usr/include/vtk-9.2/vtkCommand.h:235,
                 from /usr/include/vtk-9.2/vtkRenderWindowInteractor.h:48,
                 from /usr/include/vtk-9.2/vtkXRenderWindowInteractor.h:35,
                 from /var/tmp/portage/sci-libs/opencascade-7.7.0/work/occt-185d29b/src/IVtkDraw/IVtkDraw_Interactor.cxx:30:
/usr/include/vtk-9.2/vtksys/Status.hxx:16:1: error: expected unqualified-id before ‘{’ token
   16 | {
      | ^
```

Reproducible: Always
Comment 1 Fat-Zer 2022-12-16 14:51:47 UTC
Created attachment 843131 [details]
build.log.xz
Comment 2 Fat-Zer 2022-12-16 14:52:50 UTC
Created attachment 843133 [details]
emerge --info '=sci-libs/opencascade-7.7.0::gentoo'
Comment 3 Fat-Zer 2022-12-16 14:53:59 UTC
$ emerge -pqv '=sci-libs/opencascade-7.7.0::gentoo'
[ebuild   R   ] sci-libs/opencascade-7.7.0  USE="ffmpeg json vtk -doc -examples -freeimage -gles2 -optimize (-tbb)"
Comment 4 Bernd 2022-12-17 02:01:44 UTC
This can likely be solved by the patch from bug #885621.
I'm gonna prepare a PR for this.
Comment 5 Fat-Zer 2022-12-17 10:30:16 UTC
(In reply to Bernd from comment #4)
> This can likely be solved by the patch from bug #885621.
> I'm gonna prepare a PR for this.

Thanks for fast response, I can confirm that the patch resolves the issue...
Comment 6 Roy Bamford gentoo-dev 2022-12-22 18:27:34 UTC
The patch works on ~arm64 ... eventually.

My copy/paste turned all the space symbols into two byte symbols that looked like spaces but which upset patch.
Fixing the spaces with nano fixed that.
Comment 7 Larry the Git Cow gentoo-dev 2022-12-31 15:36:46 UTC
The bug has been closed via the following commit(s):

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

commit bdaa85f652b25c81c889d9a1bcff53a819b0afc2
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2022-12-18 15:37:34 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-12-31 15:36:06 +0000

    sci-libs/opencascade: build 7.7.0 against vtk-9.2
    
    cleanup some X related libraries
    
    Closes: https://bugs.gentoo.org/886343
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../opencascade-7.7.0-build-against-vtk-9.2.patch  | 36 ++++++++++++++++++++++
 ...de-7.7.0.ebuild => opencascade-7.7.0-r1.ebuild} | 25 ++++++---------
 2 files changed, 45 insertions(+), 16 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a10bb3a17cd9fa3929de46ca53d76adff94adbd

commit 3a10bb3a17cd9fa3929de46ca53d76adff94adbd
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2022-12-18 16:12:35 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-12-31 15:36:07 +0000

    sci-libs/opencascade: build 7.6.3 against vtk-9.2
    
    Backport patch from v7.7.0
    
    Bug: https://bugs.gentoo.org/886343
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Closes: https://github.com/gentoo/gentoo/pull/28704
    Signed-off-by: Sam James <sam@gentoo.org>

 ...de-7.6.3.ebuild => opencascade-7.6.3-r1.ebuild} | 25 +++++++++++-----------
 1 file changed, 12 insertions(+), 13 deletions(-)