krishi has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I was trying to install Prima-1.23 from CPAN on Solaris-9.
I followed these steps after extracting the module:

1. perl Makefile.PL
2. make
3. make test

The first 2 steps were completed successfully.
But the 'make test' command showed the following error:

bash-2.05# make test
Creating directories...
Testing Prima v1.23
ld.so.1: perl: fatal: relocation error: file ./auto/Prima/Prima.so: symbol XRenderFindDisplay: referenced symbol not found
make: *** test Killed

I have the XRender library installed in the system. It was recognised during the 'perl Makefile.PL' command.
What could be the reason even after 'make' is done correctly?

Thanks in advance,
Krishi.

Replies are listed 'Best First'.
Re: Prima installation
by almut (Canon) on Dec 19, 2007 at 13:38 UTC
    I have the XRender library installed in the system. It was recognised during the 'perl Makefile.PL' command.

    The fact that it was found at compile time doesn't necesssarily mean it will also be found at run time.  A couple of things to try:

    • Run ldd on Prima.so. You'll probably see it reporting "not found" for at least one dependent library (presumably the Xrender lib).
    • Find out in exactly what directory that library is installed, and then add that dir to the run time library seach path specified in the env variable LD_LIBRARY_PATH. This variable may or may not be already set. If it is not set, then just set it. Otherwise, the default approach would be to append the new dir at the end (so it will be searched last). Especially if you're opting to modify LD_LIBRARY_PATH for more than just the immediate execution context of the script (IOW, system-wide, or for your login session, etc. — see below for why that might be relevant), this will have the least side effects...
    • Fiddle with ldd and LD_LIBRARY_PATH until it reports that all libs are found. This is the execution env that you'll need to set for your Perl script. (BTW, Solaris' ldd has the nice -s option, which will make it be verbose about how it is searching for libs, which could help debugging).

    Note that the Solaris run time linker has a peculiarity due to caching issues. In short, it means that you can't normally modify LD_LIBRARY_PATH from within the Perl script itself (in a BEGIN block or so) — so you'll have to find some way to have it set before, e.g. by writing a shell wrapper, which sets LD_LIBRARY_PATH and then execs the Perl script.

      HI,
      I tried out your advice and it showed me the following results:

      bash-2.05# ldd -r Prima.so
      libsocket.so.1 => /usr/lib/libsocket.so.1
      libnsl.so.1 => /usr/lib/libnsl.so.1
      libdl.so.1 => /usr/lib/libdl.so.1
      libm.so.1 => /usr/lib/libm.so.1
      libc.so.1 => /usr/lib/libc.so.1
      libX11.so.4 => /usr/lib/libX11.so.4
      libXext.so.0 => /usr/lib/libXext.so.0
      libfreetype.so.6 => /usr/sfw/lib/libfreetype.so.6
      libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1
      libXrender.so.1 => /usr/sfw/lib/libXrender.so.1
      libXft.so.2 => /usr/local/lib/libXft.so.2
      libiconv.so.2 => /usr/local/lib/libiconv.so.2
      libgtk-x11-2.0.so.0 => /usr/local/lib/libgtk-x11-2.0.so.0
      libgdk-x11-2.0.so.0 => /usr/local/lib/libgdk-x11-2.0.so.0
      libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0
      libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0
      libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0
      libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0
      libcairo.so.2 => /usr/local/lib/libcairo.so.2
      libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0
      libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0
      libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0
      libintl.so.3 => /usr/local/lib/libintl.so.3
      libjpeg.so.62 => /usr/sfw/lib/libjpeg.so.62
      libpng12.so.0 => /usr/sfw/lib/libpng12.so.0
      libtiff.so.3 => /usr/sfw/lib/libtiff.so.3
      libungif.so.4 => /usr/local/lib/libungif.so.4
      libXpm.so.4.11 => /usr/local/lib/libXpm.so.4.11
      libmp.so.2 => /usr/lib/libmp.so.2
      libz.so.1 => /usr/lib/libz.so.1
      libexpat.so.0 => /usr/local/lib/libexpat.so.0
      libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
      libpangoft2-1.0.so.0 => /usr/local/lib/libpangoft2-1.0.so.0
      libSM.so.6 => /usr/lib/libSM.so.6
      libICE.so.6 => /usr/lib/libICE.so.6
      symbol not found: main (./Prima.so)
      /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1
      symbol not found: PL_origargv (./Prima.so)
      symbol not found: PL_origargc (./Prima.so)
      symbol not found: PL_sv_undef (./Prima.so)
      symbol not found: PL_stack_max (./Prima.so)
      symbol not found: PL_markstack_ptr (./Prima.so)
      symbol not found: PL_stack_sp (./Prima.so)
      symbol not found: PL_stack_base (./Prima.so)
      symbol not found: PL_op (./Prima.so)
      symbol not found: PL_tmps_ix (./Prima.so)
      symbol not found: PL_errgv (./Prima.so)
      symbol not found: PL_tmps_floor (./Prima.so)
      symbol not found: PL_markstack_max (./Prima.so)
      symbol not found: PL_sv_yes (./Prima.so)
      symbol not found: Perl_newXS (./Prima.so)
      symbol not found: Perl_sv_free (./Prima.so)
      symbol not found: Perl_warn (./Prima.so)
      symbol not found: Perl_av_len (./Prima.so)
      symbol not found: Perl_av_fetch (./Prima.so)
      symbol not found: Perl_sv_2pv_flags (./Prima.so)
      symbol not found: Perl_newSVsv (./Prima.so)
      symbol not found: Perl_hv_fetch (./Prima.so)
      symbol not found: Perl_croak (./Prima.so)
      symbol not found: Perl_sv_2bool (./Prima.so)
      symbol not found: Perl_hv_exists (./Prima.so)
      symbol not found: Perl_hv_delete (./Prima.so)
      symbol not found: Perl_newAV (./Prima.so)
      symbol not found: Perl_newSVpv (./Prima.so)
      symbol not found: Perl_av_push (./Prima.so)
      symbol not found: Perl_newRV (./Prima.so)
      symbol not found: Perl_newSViv (./Prima.so)
      symbol not found: Perl_newRV_noinc (./Prima.so)
      symbol not found: Perl_stack_grow (./Prima.so)
      symbol not found: Perl_sv_2mortal (./Prima.so)
      symbol not found: Perl_sv_2iv (./Prima.so)
      symbol not found: Perl_sv_mortalcopy (./Prima.so)
      symbol not found: Perl_sv_2nv (./Prima.so)
      symbol not found: Perl_hv_store (./Prima.so)
      symbol not found: Perl_newHV (./Prima.so)
      symbol not found: Perl_hv_clear (./Prima.so)
      symbol not found: Perl_hv_iterinit (./Prima.so)
      symbol not found: Perl_hv_iternext (./Prima.so)
      symbol not found: Perl_newSVpvn (./Prima.so)
      symbol not found: Perl_sv_2uv (./Prima.so)
      symbol not found: Perl_utf8_to_uvchr (./Prima.so)
      symbol not found: Perl_sv_catpvn_flags (./Prima.so)
      symbol not found: Perl_push_scope (./Prima.so)
      symbol not found: Perl_save_int (./Prima.so)
      symbol not found: Perl_markstack_grow (./Prima.so)
      symbol not found: Perl_sv_setsv_flags (./Prima.so)
      symbol not found: Perl_call_sv (./Prima.so)
      symbol not found: Perl_sv_catsv_flags (./Prima.so)
      symbol not found: Perl_free_tmps (./Prima.so)
      symbol not found: Perl_pop_scope (./Prima.so)
      symbol not found: Perl_block_gimme (./Prima.so)
      symbol not found: Perl_sv_newmortal (./Prima.so)
      symbol not found: Perl_gv_efullname4 (./Prima.so)
      symbol not found: Perl_newSVnv (./Prima.so)
      symbol not found: Perl_utf8_length (./Prima.so)
      symbol not found: Perl_utf8_hop (./Prima.so)
      symbol not found: Perl_sv_2io (./Prima.so)
      symbol not found: Perl_PerlIO_fileno (./Prima.so)
      symbol not found: Perl_PerlIO_read (./Prima.so)
      symbol not found: Perl_PerlIO_write (./Prima.so)
      symbol not found: Perl_PerlIO_seek (./Prima.so)
      symbol not found: Perl_PerlIO_tell (./Prima.so)
      symbol not found: Perl_PerlIO_flush (./Prima.so)
      symbol not found: Perl_PerlIO_error (./Prima.so)
      symbol not found: Perl_sv_setpv (./Prima.so)
      symbol not found: Perl_sv_setpvf (./Prima.so)
      symbol not found: Perl_sv_2cv (./Prima.so)
      symbol not found: Perl_call_method (./Prima.so)
      symbol not found: Perl_call_pv (./Prima.so)
      symbol not found: Perl_eval_pv (./Prima.so)
      symbol not found: Perl_gv_stashsv (./Prima.so)
      symbol not found: Perl_gv_fetchmeth (./Prima.so)
      symbol not found: Perl_gv_stashpv (./Prima.so)
      symbol not found: Perl_hv_store_ent (./Prima.so)
      symbol not found: Perl_hv_exists_ent (./Prima.so)
      symbol not found: Perl_hv_fetch_ent (./Prima.so)
      symbol not found: Perl_hv_iterkeysv (./Prima.so)
      symbol not found: Perl_newSV (./Prima.so)
      symbol not found: Perl_sv_setpvn (./Prima.so)
      symbol not found: Perl_hv_delete_ent (./Prima.so)
      symbol not found: Perl_sv_catpv (./Prima.so)
      symbol not found: XRenderFindDisplay (./Prima.so)
      symbol not found: XRenderFindStandardFormat (/usr/local/lib/libXft.so.2)
      symbol not found: XRenderQuerySubpixelOrder (/usr/local/lib/libXft.so.2)
      symbol not found: XRenderQuerySubpixelOrder (/usr/local/lib/libgdk-x11-2.0.so.0)
      symbol not found: FT_GlyphSlot_Embolden (/usr/local/lib/libcairo.so.2)
      symbol not found: png_set_expand_gray_1_2_4_to_8 (/usr/local/lib/libcairo.so.2)
      symbol not found: XRenderFindStandardFormat (/usr/local/lib/libcairo.so.2)
      symbol not found: XRenderSetPictureFilter (/usr/local/lib/libcairo.so.2)
      symbol not found: XRenderSetPictureTransform (/usr/local/lib/libcairo.so.2)
      symbol not found: XRenderCompositeTrapezoids (/usr/local/lib/libcairo.so.2)
      symbol not found: XRenderQuerySubpixelOrder (/usr/local/lib/libcairo.so.2)


      The path /usr/local/lib is already there in the LD_LIBRARY_PATH variable and I have also appended the path to Prima.so in the LD_LIBRARY_PATH env variable.

      The LD_LIBRARY_PATH now shows the following path:
      bash-2.05# echo $LD_LIBRARY_PATH
      /usr/sfw/lib:/usr/local/lib:/opt/sfw/lib:/usr/local/perl588/lib/site_perl/5.8.8/sun4-solaris/auto/Prima
      But still I am getting the same error.

      Krishi.

        (Sorry for not getting back to this earlier...)

        bash-2.05# ldd -r Prima.so ... libXrender.so.1 => /usr/sfw/lib/libXrender.so.1 ... symbol not found: XRenderFindDisplay (./Prima.so) symbol not found: XRenderFindStandardFormat (/usr/local/lib/libXft.so. +2) symbol not found: XRenderQuerySubpixelOrder (/usr/local/lib/libXft.so. +2) symbol not found: XRenderQuerySubpixelOrder (/usr/local/lib/libgdk-x11 +-2.0.so.0) symbol not found: FT_GlyphSlot_Embolden (/usr/local/lib/libcairo.so.2) symbol not found: png_set_expand_gray_1_2_4_to_8 (/usr/local/lib/libca +iro.so.2) symbol not found: XRenderFindStandardFormat (/usr/local/lib/libcairo.s +o.2) symbol not found: XRenderSetPictureFilter (/usr/local/lib/libcairo.so. +2) symbol not found: XRenderSetPictureTransform (/usr/local/lib/libcairo. +so.2) symbol not found: XRenderCompositeTrapezoids (/usr/local/lib/libcairo. +so.2) symbol not found: XRenderQuerySubpixelOrder (/usr/local/lib/libcairo.s +o.2)

        So, as it looks, it's correctly loading libXrender.so, but somehow this specific version doesn't appear to have the required symbols... — maybe too old or something(?)

        You can manually check which symbols a library provides with nm, e.g.

        $ nm /usr/sfw/lib/libXrender.so | grep XRenderFindDisplay [27] | 2940| 84|FUNC |LOCL |0 |10 |XRenderFindDisp +lay

        (the symbol must not only be found, it should also not say UNDEF in the penultimate column)

        The above is what I got on the Solaris 9 box that I just tried this on. In other words, it looks OK here.  Not sure what the problem is on your side...

        (BTW, in addition to the XRender stuff, it looks like it also can't resolve two other symbols which are not from XRender: FT_GlyphSlot_Embolden, and png_set_expand_gray_1_2_4_to_8. The former should be defined in libfreetype.so, the latter in libpng.so.  Googling for the symbol name might help... (often, you're not the only one who has encountered the problem, and even if some thread is not exactly about your specific platform, etc., it could still help to generate hypotheses...). Good luck anyway!

Re: Prima installation
by Anonymous Monk on Dec 19, 2007 at 07:37 UTC
      I have gone through these links but they do not seem to be of much help.
      Can anybody help please?