Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 596740 - media-gfx/krita-3.0.1[vc] - emake failed: error: ‘R Vc_1::AvxIntrinsics::stream_load(const float*) [with R = __vector(8) float]’ conflicts with a previous declaration
Summary: media-gfx/krita-3.0.1[vc] - emake failed: error: ‘R Vc_1::AvxIntrinsics::stre...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-10 08:11 UTC by Serge Gavrilov
Modified: 2017-02-15 16:44 UTC (History)
3 users (show)

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


Attachments
emerge --info (emerge--info.txt,20.38 KB, text/plain)
2016-10-10 08:11 UTC, Serge Gavrilov
Details
build.log.gz (build.log.gz,70.43 KB, application/gzip)
2016-10-11 11:15 UTC, Serge Gavrilov
Details
krita-3.1.2-r1: build.log.gz (build.log.gz,190.57 KB, application/x-gzip)
2017-02-03 16:47 UTC, Fat-Zer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Gavrilov 2016-10-10 08:11:58 UTC
Created attachment 449726 [details]
emerge --info

Build fails with USE=vc. With USE=-vc the build is successful.


[ 15%] Built target kritaundo2
make[2]: Leaving directory '/var/tmp/portage/media-gfx/krita-3.0.1/work/krita-3.0.1_build'
make[1]: *** [CMakeFiles/Makefile2:5517: libs/pigment/CMakeFiles/kritapigment.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/media-gfx/krita-3.0.1/work/krita-3.0.1_build'
make: *** [Makefile:128: all] Error 2
Comment 1 Coacher 2016-10-11 09:31:45 UTC
Please attach a complete build.log where the problem can be seen.
Comment 2 Serge Gavrilov 2016-10-11 11:15:45 UTC
Created attachment 449852 [details]
build.log.gz
Comment 3 Michael Palimaka (kensington) gentoo-dev 2016-10-12 19:10:44 UTC
Which version of dev-libs/vc is installed?
Comment 4 Serge Gavrilov 2016-10-12 19:23:07 UTC
latest 1.2.0
Comment 5 Michael Palimaka (kensington) gentoo-dev 2016-10-12 20:21:08 UTC
@amadio, any idea about this VC-related build failure?
Comment 6 Mircea Sava 2016-11-10 10:52:02 UTC
Same thing here with VC v1.3.0
Comment 7 3e4wrthge 2016-11-18 07:41:19 UTC
Same issue here. Build fails with VC 1.3
But it succeeds with VC 0.7.3

Apparently Krita works only with VC 0.7.x

In this bug report https://bugs.kde.org/show_bug.cgi?id=360773
Boudewijn Rempt (A Krita contributor) says:
"I'm sorry, but at the moment, only Vc 0.7 is supported. We're looking into porting to a newer version of Vc, but that's not done yet, so this build error is expected."

Also the build instructions page referred to on Krita's website http://www.davidrevoy.com/article193/guide-building-krita-on-linux-for-cats

David REVOY (The writer of the instructions) says:
"@NETHead : Oh ! good job ! Too bad to see again the library issue with Krita using an old specific VC version :-/
Thank you for the fast build script and the solution !"

In the current Krita 3.0.1 ebuild
        vc? ( >=dev-libs/vc-1.1.0 )
changing it to use 0.7.3
        vc? ( =dev-libs/vc-0.7.3 )
in a local overlay is a work around that worked for me.
Also dev-libs/vc-0.7.3 is not masked, while >=dev-libs/vc-0.7.4 are still masked right now.
Comment 8 Laurence v/d Elshout 2016-12-19 14:59:13 UTC
An old vc simply results in krita 3 being built without vc, so that's not really a solution.

The real solution to this issue is actually right there in the compiler-output on the last line of every error:

/usr/include/Vc/avx/intrinsics.h:646:1: error: 'R Vc_1::AvxIntrinsics::stream_load(const float*) [with R = __vector(8) float]' conflicts with a previous declaration
 }
 ^
/usr/include/Vc/avx/intrinsics.h:638:75: note: previous declaration 'R Vc_1::AvxIntrinsics::stream_load(const float*) [with R = __vector(4) float]'
 template<> Vc_INTRINSIC m128 stream_load<m128>(const float *mem)
                                                                           ^
/usr/include/Vc/avx/intrinsics.h:642:75: note: -fabi-version=6 (or =0) avoids this error with a change in mangling
 template<> Vc_INTRINSIC m256 stream_load<m256>(const float *mem)


Krita (and probably everything else that compiles against vc) requires a newer C++-ABI. Add "-fabi-version=0" (or 6+, gcc 4.9 goes up to 8) to CXXFLAGS for krita, and it compiles. Globally changing the C++-ABI is not a good idea.
Comment 9 Michael Palimaka (kensington) gentoo-dev 2017-02-02 10:36:51 UTC
(In reply to Laurence v/d Elshout from comment #8)
> Krita (and probably everything else that compiles against vc) requires a
> newer C++-ABI. Add "-fabi-version=0" (or 6+, gcc 4.9 goes up to 8) to
> CXXFLAGS for krita, and it compiles. Globally changing the C++-ABI is not a
> good idea.

There's been some concern raised about fiddling with the ABI. An alternative solution could be to require GCC 5 to be active when USE="vc" is enabled.
Comment 10 Guilherme Amadio gentoo-dev 2017-02-02 13:00:38 UTC
(In reply to Michael Palimaka (kensington) from comment #5)
> @amadio, any idea about this VC-related build failure?

Sorry, I missed this bug before. Compiling against Vc requires the newer C++ ABI, so the solutions have already been found: either add -fabi-version=0, or require >=sys-devel/gcc-5 to be the active compiler. However, is this still an issue? I found the following in the CMakeLists.txt for krita-3.1.2.1 (only version in the tree now):

    if(Vc_COMPILER_IS_CLANG)
        set(ADDITIONAL_VC_FLAGS "-Wabi -ffp-contract=fast -fPIC")
    elseif (NOT MSVC)
        set(ADDITIONAL_VC_FLAGS "-Wabi -fabi-version=0 -ffp-contract=fast -fPIC")
    endif()

That should take care of the issue, so I'm closing this bug.
Comment 11 Fat-Zer 2017-02-03 16:47:55 UTC
Created attachment 462360 [details]
krita-3.1.2-r1: build.log.gz

Please reopen the bug, the build still fails for me.

media-gfx/krita-3.1.2-r1
sys-devel/gcc-4.9.4
dev-libs/vc-1.3.0
Comment 12 Fat-Zer 2017-02-03 18:56:56 UTC
(In reply to Guilherme Amadio from comment #10)
>     if(Vc_COMPILER_IS_CLANG)
>         set(ADDITIONAL_VC_FLAGS "-Wabi -ffp-contract=fast -fPIC")
>     elseif (NOT MSVC)
>         set(ADDITIONAL_VC_FLAGS "-Wabi -fabi-version=0 -ffp-contract=fast
> -fPIC")
>     endif()
> 
> That should take care of the issue, so I'm closing this bug.

Note that neither ADDITIONAL_VC_FLAGS nor ko_compile_for_all_implementations{,_no_scalar} macros aren't used in the cmake files any place after their definitions. So this snip of code either broken or piece of not finished functionality...

PS: I can confirm that passing "-fabi-version=0" to C[XX]FLAGS workarounds the issue.
Comment 13 Guilherme Amadio gentoo-dev 2017-02-15 16:44:38 UTC
(In reply to Fat-Zer from comment #12)
> (In reply to Guilherme Amadio from comment #10)
> >     if(Vc_COMPILER_IS_CLANG)
> >         set(ADDITIONAL_VC_FLAGS "-Wabi -ffp-contract=fast -fPIC")
> >     elseif (NOT MSVC)
> >         set(ADDITIONAL_VC_FLAGS "-Wabi -fabi-version=0 -ffp-contract=fast
> > -fPIC")
> >     endif()
> > 
> > That should take care of the issue, so I'm closing this bug.
> 
> Note that neither ADDITIONAL_VC_FLAGS nor
> ko_compile_for_all_implementations{,_no_scalar} macros aren't used in the
> cmake files any place after their definitions. So this snip of code either
> broken or piece of not finished functionality...
> 
> PS: I can confirm that passing "-fabi-version=0" to C[XX]FLAGS workarounds
> the issue.

You are right. I applied a patch that uses add_compile_options(), which fixes this now:

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