[RevServer + Rev on Linux] Checking if you have the needed libraries

Andre Garzia andre at andregarzia.com
Wed Jul 28 11:09:54 CDT 2010


Thanks for the kind words Richard, I know that half of the problem of rev
under linux is getting it to run, may it be rev cgi engine, revserver or rev
ide. This is just an email to be indexed by all the crawlers out there so
that when people search for this kind of trouble they can get a good answer.

I struggle with libraries and that damn linker every day here, so I learned
some tricks.

ldd and otool are very good for troubleshooting. ln is also a good friend
when you have the wrong version of a library.

On Wed, Jul 28, 2010 at 1:06 PM, Richard Gaskin
<ambassador at fourthworld.com>wrote:

> VERY valuable stuff, Andre.  Thanks. I wasn't aware of the ldd command -
> good stuff to know.
>
> --
>  Richard Gaskin
>  Fourth World
>  Rev training and consulting: http://www.fourthworld.com
>  Webzine for Rev developers: http://www.revjournal.com
>  revJournal blog: http://revjournal.com/blog.irv
>
>
>
> Andre Garzia wrote:
>
>  For those running or trying to run revolution under linux, there on trick
>> that help you troubleshoot library dependency problems. Go to your
>> terminal
>> and into the folder that contains the executable engine for revolution be
>> it
>> revserver or rev ide and run "ldd <executable file>" like this:
>>
>>   ldd /home/agarzia/prog/revolution/4.5.0-dp-3/revolution
>>
>> The output of this command lists the shared library used and their
>> location,
>> like this example output from my ubuntu machine:
>>
>>    linux-gate.so.1 =>  (0x00e3c000)
>>    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x007ca000)
>>    libX11.so.6 => /usr/lib/libX11.so.6 (0x00110000)
>>    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00a1d000)
>>    libXext.so.6 => /usr/lib/libXext.so.6 (0x0037c000)
>>    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x004e6000)
>>    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x0038c000)
>>    /lib/ld-linux.so.2 (0x00548000)
>>    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00c2b000)
>>    libXau.so.6 => /usr/lib/libXau.so.6 (0x00ff0000)
>>    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00c15000)
>>
>> Now, when it does not find some library like RevServer is doing on my
>> ubuntu
>> machine, the output is like this:
>>
>>    ldd revserver:
>>
>>    linux-gate.so.1 =>  (0x00410000)
>>    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00a0b000)
>>    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x007fc000)
>>    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x005a8000)
>>    libpcre.so.0 => not found
>>    libpng12.so.0 => /lib/libpng12.so.0 (0x00110000)
>>    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x006fe000)
>>    libcurl.so.4 => /usr/lib/libcurl.so.4 (0x006a1000)
>>    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00135000)
>>    libz.so.1 => /lib/libz.so.1 (0x00326000)
>>    /lib/ld-linux.so.2 (0x0084a000)
>>    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0076e000)
>>    libidn.so.11 => /usr/lib/libidn.so.11 (0x00e48000)
>>    liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0x00cbe000)
>>    libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0x00482000)
>>    librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x004e7000)
>>    libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x0028f000)
>>    libssl.so.0.9.8 => /lib/i686/cmov/libssl.so.0.9.8 (0x008ad000)
>>    libcrypto.so.0.9.8 => /lib/i686/cmov/libcrypto.so.0.9.8 (0x00a0f000)
>>    libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0x002be000)
>>    libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x002d2000)
>>    libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0x0033b000)
>>    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00965000)
>>    libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x004f0000)
>>    libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x002ea000)
>>    libcom_err.so.2 => /lib/libcom_err.so.2 (0x0030e000)
>>    libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x0079d000)
>>    libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00312000)
>>    libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0x00fad000)
>>    libgcrypt.so.11 => /lib/libgcrypt.so.11 (0x00d9e000)
>>    libgpg-error.so.0 => /lib/libgpg-error.so.0 (0x009f9000)
>>
>> You can see on the fourth line that it did not find libpcre which is the
>> Perl Regular Expression library that among other stuff gives use matchtext
>> and matchchunk functionalities and might be used internally as well. Now,
>> I
>> used synaptic to install libpcre just now, why it is not able to find it?
>>
>> Using the "locate" command, you can see where the libraries are located,
>> here it goes:
>>
>>    locate libpcre
>>
>>    /lib/libpcre.so.3
>>    /lib/libpcre.so.3.12.1
>>
>> What we can see from that output is that revserver wants libpcre.so.0 and
>> we
>> have libpcre.so.3 so what would a good unix chap do? A symlink to create
>> an
>> alias pointing libpcre.so.0 to libpcre.so.3:
>>
>>    sudo ln -s /lib/libpcre.so.3 /lib/libpcre.so.0
>>
>> This creates the symbolic link and now:
>>
>>    ldd ./revserver
>>
>>    linux-gate.so.1 =>  (0x00939000)
>>    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x005dc000)
>>    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00bac000)
>>    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00cf5000)
>>    libpcre.so.0 => /lib/libpcre.so.0 (0x00e91000)
>>    ...
>>
>> Now you see that the engine is happy and found all its required libs. Let
>> us
>> create a simple revserver page named test.irev with the following content:
>>
>>    <?rev
>>
>>      put "hello world from revserver" && the version && the buildnumber &
>> cr
>>
>>    ?>
>>
>> Now when we run it from the terminal:
>>
>>    ./revserver test.irev
>>
>>    hello world from revserver 3.5.0 860
>>
>> Hope this little piece here shows you that with some unix trick you can
>> put
>> your engines to work. Remember Linux Administration is 50% Symlinking like
>> mad, 25% reading logs and 25% faith.
>>
>> :D
>>
>> Oh, you can do the same thing under mac os x with "otool" instead of
>> "ldd".
>>
>> Andre "I will symlink you into submission" Garzia
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list