Re: [gentoo-user] Re: undefined symbol "...[abi:cxx11]" (was: Do we have any Blender build experts in the house?)

2016-05-29 Thread J.
El dom, 29-05-2016 a las 08:35 -0600, J. García escribió:
> El dom, 29-05-2016 a las 09:02 +0200, David Haller escribió:
> > 
> > Yes, BUT...
> > 
> > a) use c++filt / nm -C (see below)
> > 
> > b) Won't help unless you actually recompile/emerge openexr with
> >    -std=c++11 or -std=gnu++11 (or -std={c,gnu}++14 or greater).
> >    reemerging as per default with -std=c++98 or less (what's the
> >    default std for c++ in g++?) won't help.
> > 
> Nice and informative post(I didn't know nm), I didn't said put 
> -std=c++11 in make.conf, or package.env, because, the news[1] item I
> pointed to in my first post says, quote
> "... GCC 5 uses the new C++ ABI by default." 
> I also said:
> > 
> > ... you might need to rebuild that and make sure(read the log) g++
> >  is being called with std=c++11
> So if you are using gcc:5 you don't need to specify the ABI, in the
> portage configuration files, to use the new one.
missed this:
[1]https://www.gentoo.org/support/news-items/2015-10-22-gcc-5-new-c++11
-abi.html



Re: [gentoo-user] Re: undefined symbol "...[abi:cxx11]" (was: Do we have any Blender build experts in the house?)

2016-05-29 Thread J.
El dom, 29-05-2016 a las 09:02 +0200, David Haller escribió:
> Yes, BUT...
> 
> a) use c++filt / nm -C (see below)
> 
> b) Won't help unless you actually recompile/emerge openexr with
>    -std=c++11 or -std=gnu++11 (or -std={c,gnu}++14 or greater).
>    reemerging as per default with -std=c++98 or less (what's the
>    default std for c++ in g++?) won't help.
> 
Nice and informative post(I didn't know nm), I didn't said put 
-std=c++11 in make.conf, or package.env, because, the news[1] item I
pointed to in my first post says, quote
"... GCC 5 uses the new C++ ABI by default." 
I also said:
> ... you might need to rebuild that and make sure(read the log) g++
>  is being called with std=c++11
So if you are using gcc:5 you don't need to specify the ABI, in the
portage configuration files, to use the new one.



[gentoo-user] Re: undefined symbol "...[abi:cxx11]" (was: Do we have any Blender build experts in the house?)

2016-05-29 Thread David Haller
Hello,

First of all, this has nothing to do with blender "per se" ...

On Sat, 28 May 2016, J. García wrote:
>El sáb, 28-05-2016 a las 17:26 -0600, J. García escribió:
>> BTW, eix won't help you here, I tried it, so the next step is to find
>> what provides the symbol 'Imf_2_1::Header::view', after some searches
>> with find and then google, I arrived at opencv(though not 100% sure),
>> so you might need to rebuild that and make sure(read the log) g++ is
>> being called with std=c++11. tracking this sort of stuff might be
>> tricky.
>I was left with the doubt if opencv was the package causing trouble,
>and it is not, so I searched a bit more in depth, and I have found the
>library you need to rebuild, it is libIlmImf.so, and this time I'm
>sure.
>
>Looking for the package:
>
>$ qfile /usr/lib64/libIlmImf.so 
>media-libs/openexr (/usr/lib64/libIlmImf.so)

*Hah* Learned something new, I've overlooked qfile so far :)

>Looking for the symbol: 
>
>$ readelf -s /usr/lib64/libIlmImf.so  | grep   '.*Header.*view.*'
>  1617: 0004a35025 FUNCGLOBAL DEFAULT   10
>_ZNK7Imf_2_16Header4viewB
>  2248: 00049e6025 FUNCGLOBAL DEFAULT   10
>_ZN7Imf_2_16Header4viewB5
>
>So you need to: emerge --oneshot media-libs/openexr

Yes, BUT...

a) use c++filt / nm -C (see below)

b) Won't help unless you actually recompile/emerge openexr with
   -std=c++11 or -std=gnu++11 (or -std={c,gnu}++14 or greater).
   reemerging as per default with -std=c++98 or less (what's the
   default std for c++ in g++?) won't help.

Generally: for any symbol containing '[abi:cxxNN]' you need that lib
compiled with the CXX flag '-std=c++NN'. As far as I can see, the
symbol 'foo[abi:cxxNN]' also provides the plain symbol 'foo', so it's
downwards compatible.

Ok, you got a symbol + [abi:cxxNN]. Usually, the first part of the
symbol gives you a hint as to what lib could be involved. In this case
some lib with *Imf* (Symbols Q* are usually Qt stuff ;). Searching
online usually helps if you've no idea, but use c++filt too if the
symbol seems weird (see below). But in this case with "Imf" ...:

$ ls /usr/lib64/*Imf*
/usr/lib64/libIlmImf-Imf_2_1.so.21  /usr/lib64/libIlmImf.so
/usr/lib64/libIlmImf-Imf_2_1.so.21.0.0

$ equery belongs /usr/lib64/libIlmImf.so 
 * Searching for /usr/lib64/libIlmImf.so ... 
media-libs/openexr-2.1.0 (/usr/lib64/libIlmImf.so -> 
libIlmImf-Imf_2_1.so.21.0.0)
media-libs/openexr-2.1.0 (/usr/lib64/libIlmImf-Imf_2_1.so.21.0.0)

$ nm /usr/lib64/libIlmImf.so | grep 'Imf_2_1.*Header.*view'
00049a40 T _ZN7Imf_2_16Header12previewImageEv
0003d5dc t 
_ZN7Imf_2_16Header14typedAttributeINS_14TypedAttributeINS_12PreviewImageERT_PKc.part.46
00049980 T _ZN7Imf_2_16Header15setPreviewImageERKNS_12PreviewImageE
000492c0 T _ZN7Imf_2_16Header4viewB5cxx11Ev
00049a80 T _ZNK7Imf_2_16Header12previewImageEv
0003d5dc t 
_ZNK7Imf_2_16Header14typedAttributeINS_14TypedAttributeINS_12PreviewImageERKT_PKc.part.51
00049ac0 T _ZNK7Imf_2_16Header15hasPreviewImageEv
00049300 T _ZNK7Imf_2_16Header4viewB5cxx11Ev
$ nm -C /usr/lib64/libIlmImf.so | grep 'Imf_2_1::Header::view'
000492c0 T Imf_2_1::Header::view[abi:cxx11]()
00049300 T Imf_2_1::Header::view[abi:cxx11]() const
$ nm /usr/lib64/libIlmImf.so | c++filt | grep 'Imf_2_1::Header::view'
000492c0 T Imf_2_1::Header::view[abi:cxx11]()
00049300 T Imf_2_1::Header::view[abi:cxx11]() const

Ok, nm does not work on stripped stuff. But strings does:

$ strip /usr/lib64/libIlmImf.so
$ nm /usr/lib64/libIlmImf.so 
nm: /usr/lib64/libIlmImf.so: no symbols
$ strings /usr/lib64/libIlmImf.so | c++filt | grep 'Imf_2_1::Header::view'
Imf_2_1::Header::view[abi:cxx11]()
Imf_2_1::Header::view[abi:cxx11]() const

And so does readelf[4]:

$ readelf -sW /usr/lib64/libIlmImf.so | c++filt | grep 'Imf_2_1::Header::view'
  1565: 0004930064 FUNCGLOBAL DEFAULT   10 
Imf_2_1::Header::view[abi:cxx11]() const
  2178: 000492c064 FUNCGLOBAL DEFAULT   10 
Imf_2_1::Header::view[abi:cxx11]()

(so, I already _DO_ have libIlmImf compiled with -std=c++11 or
-std=gnu++11, so I'm fine, but you're missing the '[abi:cxx11]', so
you need to recompile with -std=c++11/-std=gnu++11).

That's because I "default" by now to c++11 (and the extra CXXSTD var
is due to me starting to switch that (back and forth) before realising
the below).

$ grep CXX /etc/portage/make.conf
CXXSTD=" -std=c++11"
CXXFLAGS="$CFLAGS ${CXXSTD} "

BUT!

Some packages do not compile (yet) with c++11, and still need
c++98/gnu++98.

And some even seem to already need c++14 (mkvtoolnix). *Woah* After
realizing this and finding the stuff about the env-files (I love
gentoo for stuff like this!), I thought a moment... And ...

So, I've got a couple of env-files and use them for the packages that
need it.

First of all: I set the CPU-dependend stuff (-march, -O* etc. _AND
ONLY THAT_ (see below)) in CFLAGS in make.conf, then combine CFLAGS