SUMMARY: Please clarify X11R5 with OW3 FAQ

From: rosi punton (rosi@redgum.ucnv.edu.au)
Date: Fri Feb 12 1993 - 06:09:48 CST


Thanks very much to all those who replied so quickly - & a particular
thanks to those who took pains to answer each question and add extra
useful info.

My original question:

> I need to get X11R5 xdm working with OW3 - pronto. I also need to setup
> an environment for X11R5 clients to be compiled and run under OW3.
> I have read the FAQ but some things are unclear to me.

> 1. If you choose to link the X11R5 libraries and the OW3 libraries
> into the same directory (eg /usr/local/lib) do you also need
> to link in the .a libraries (eg libX11.a)?
> 2. If you do need the .a libraries, and the OW3 library has the
> same name as the X11R5 library, which one do you need?
> 3. Is the sun patch 100452-25 only needed if you're putting
> X11R5 & OW3 libraries in the same directory?
> 4. Are there any disadvantages in combining libraries in the same
> directory? In particular, are there occasions when you
> need LD_LIBRARY_PATH set anyway?

In summary - we are all combining X11R5 & OW3 in different ways so
there is no single answer. The sun-mgrs FAQ suggests that you
can run R5 & OW3 simultaneously and not need to set LD_LIBRARY_PATH
by combining R5 & OW libraries in the same directory. However the
popular opinion seemed to be that it was best to keep libraries
separate and use other methods to circumvent the need for
LD_LIBRARY_PATH. In any case some commercial software may require
LD_LIBRARY_PATH to be set anyway.

The answers included here will tell it best.

It seems that XView jumbo patch 100452-25 ought to be installed anyway.
One respondent listed 13 others to install as well ...
Patches including 100452-25 and readme can be found on
    sasun1.epfl.ch in pub/sun-patch-list
                        and pub/sun-patches
                                        thanks to Alain Brossard

and from thor.ece.uc.edu in pub/sun-faq/Patches
                        thanks Rob Montjoy - see below

I haven't found an equivalent list in australia yet.

Here follows the replies beginning with the most detailed & useful to
me, thanks casper dik.

===============================================
        
From: Casper Dik <casper@fwi.uva.nl>
Date: Mon, 08 Feb 93 09:54:41 +0100

>I need to get X11R5 xdm working with OW3 - pronto. I also need to setup
>an environment for X11R5 clients to be compiled and run under OW3.
>I have read the FAQ but some things are unclear to me.
>
>1. If you choose to link the X11R5 libraries and the OW3 libraries
> into the same directory (eg /usr/local/lib) do you also need
> to link in the .a libraries (eg libX11.a)?

If you ever want to link statically, you'll need the X libraries.

>2. If you do need the .a libraries, and the OW3 library has the
> same name as the X11R5 library, which one do you need?

The best thing to do is to use the R5 libraries, if you combine
the directories. The problem is that the OW3 libs use undocumented
interface oparts from the OW3 Xlibs (R4).

>3. Is the sun patch 100452-25 only needed if you're putting
> X11R5 & OW3 libraries in the same directory?

100452 fixed the xview lib. It has nothing to do with which Xlibs you're using.

>4. Are there any disadvantages in combining libraries in the same
> directory? In particular, are there occasions when you
> need LD_LIBRARY_PATH set anyway?

Yes. OW application may not run unless you modify your R5 libs
to include the things the OW3 apps expect. ld.so picks the lib
with the right major version and with the highest minor version.
This means that OW3 apps will run with R5 libXmu, libX11 and libXt

What we have done is the following:

        - install the libs in seperate directories and none in /usr/lib
        - make sure that the library path is recorded in the R5 executables.
          (this is the default in R5 if you specify a ProjectRoot
        - make sure that /usr/openwin is OPENWINHOME or a symbolic link
          pointing to OPENWINHOME
        - modify the $OPENWINHOME/bin/openwin script not to set and
          export LD_LIBRARY_PATH if $OPENWINHOME = /usr/openwin
          (This is also what is done in OpenWindows 3.1 (in Solaris 2.1))
          This works because the applications shipped with OW3 are linked
          with -L/usr/openwin.

In this setup it is no longer necessary to set LD_LIBRARY_PATH.
Secondly, both R5 and OW3 executables will run with their own libs.

One problem remains: there are some programs shipped by sun that require
OW3 libs but aren't linked with -L$OPENWINHOME/lib. (dbxtool.ow)

This is easily taken care of with a wrapper shell script for the programs
that are a problem.

        #!/bin/sh
        # Set LD_LIBRARY_PATH if not set. Use OPENWINHOME if set, else
        # assume /usr/openwin
        : ${LD_LIBRARY_PATH:=${OPENWINHOME:-/usr/openwin}/lib}
        export LD_LIBRARY_PATH
        exec program.orig

or

        #!/bin/sh
        # Always set LD_LIBRARY_PATH
        LD_LIBRARY_PATH=${OPENWINHOME:-/usr/openwin}/lib:$LD_LIBRARY_PATH
        export LD_LIBRARY_PATH
        exec program.orig

Casper

=================================================================
another detailed reply, thanks Rob Montjoy

Date: 08 Feb 1993 08:16:15 -0500 (EST)
From: montjoy@thor.ece.uc.EDU (Robert Montjoy)

Hi..

>
> I need to get X11R5 xdm working with OW3 - pronto. I also need to setup
> an environment for X11R5 clients to be compiled and run under OW3.
> I have read the FAQ but some things are unclear to me.
>
> 1. If you choose to link the X11R5 libraries and the OW3 libraries
> into the same directory (eg /usr/local/lib) do you also need
> to link in the .a libraries (eg libX11.a)?
No...
> 2. If you do need the .a libraries, and the OW3 library has the
> same name as the X11R5 library, which one do you need?
The one with the higher version... i.e. libX11.so.4.10 is a higher
version than libX11.so.4.3.
> 3. Is the sun patch 100452-25 only needed if you're putting
> X11R5 & OW3 libraries in the same directory?
No.. You should go ahead and install it.. Actually, there are several patches
that should be installed. These include the following:
100444-35 100448-01 100451-43 100452-25
100454-02 100462-12 100478-01 100493-03
100497-01 100512-03 100524-06 100529-01
100544-01

I have most of these patches on thor.ece.uc.edu. Look in the
/pub/sun-faq/Patches directory..

> 4. Are there any disadvantages in combining libraries in the same
> directory? In particular, are there occasions when you
> need LD_LIBRARY_PATH set anyway?
Yes.. There times when commerical or other applications will require
LD_LIBRARY_PATH set..

The main problem with OPENWINDOWS 3.0 is that it is X11R4 based..
Some libraries like libXaw and libXt are not as compatable as the
should be.. You will on occasion get undefined symbols if you link
X11R5 applications aginist the openwin libraries.

If you want to avoid most of the problems link the R5 applications with
-Bstatic -lXaw -lXt -lXmu -lXext -lX11 -Bdynamic.. You should be able to
do this by modifying the Project.tmpl file..or by overriding the
HASSHAREDLIBRARIES variable in the sun.cf file.. This will
give you executables that will execute without problems under
X11R5 or Openwindows.. However, you lose some of the
benefits of shared libs but this would probably be the easiest to implement.

What we do is make sure that all applications are linked with
-L/libpath -lXaw -lXt -lXmu -lXext -lX11.. As long as you
do not set the LD_LIBRARY_PATH the executable will always
look at the proper library...

Finally, all these problems are history in Solaris 2.x.. You can
set at compile time to link aginist the right libraries and
it will "always" link aginist the right version... I just wish
they(Sun) would have but it in Solaris 1.x(SunOS 4.1.x).

-- 
Rob Montjoy                   		- Rob.Montjoy@UC.Edu
Computer Engineer    	      		- montjoy@ucbeh.BITNET
University of Cincinnati      		- montjoy@babbage.ece.uc.edu
Electrical and Computer Engineering	- uunet!uceng!rmontjoy

-- To Save the Earth. The Humans must die.

==============================================================

From: birger@vest.sdata.no (Birger A. Wathne) Message-Id: <9302080754.AA12670@sdvest.vest.sdata.no>

Keep the lib files in separate dirs, and *always* use the -R option when compiling (if you use Sun's compilers). This will hard-code the default LD_LIBRARY_PATH into your apps. You can then unset LD_LIBRARY_PATH, and the apps should find their own libs automagically.

Birger

===============================================================

Message-Id: <9302082056.AA02999@kalli.ups.com> From: ups!kalli!kevin@fourx.aus.sun.com (Kevin Sheehan {Consulting Poster Child}) Date: Tue, 9 Feb 1993 07:56:16 EST

[ Regarding "Please clarify X11R5 with OW3 FAQ", fourx!redgum.ucnv.edu.au!rosi writes on Feb 8: ]

> I need to get X11R5 xdm working with OW3 - pronto. I also need to setup > an environment for X11R5 clients to be compiled and run under OW3. > I have read the FAQ but some things are unclear to me. > > 1. If you choose to link the X11R5 libraries and the OW3 libraries > into the same directory (eg /usr/local/lib) do you also need > to link in the .a libraries (eg libX11.a)? > 2. If you do need the .a libraries, and the OW3 library has the > same name as the X11R5 library, which one do you need? > 3. Is the sun patch 100452-25 only needed if you're putting > X11R5 & OW3 libraries in the same directory? > 4. Are there any disadvantages in combining libraries in the same > directory? In particular, are there occasions when you > need LD_LIBRARY_PATH set anyway?

1. shouldn't - the .a libraries are only used for executables that are statically linked. If you don't do static linking, you shouldn't need the .a

2. Depends - if you are running X11R5, I'd go with the R5 version - if you are running xnews, I'd go with the openwin version. I would suspect that you don't need to worry about it if things are dynamically linked.

3. I have the description for 100452-28, which indicates it is a Jumbo patch, fixing all kinds of stuff. I'd recommend installing it on the OWV3 stuff on general principles.

4. You can't keep both versions - name clashes will get you. I have had X applications that depended on some "feature" of either the OW or X11 libraries often enough, that I keep both around - one in /usr/openwin/lib, and the other in /usr/local/X11/lib. If you don't have any of those apps, fine - if you do, it is probably worth the disk space.

I run both ways - on my test machine I run X11R5 as I don't need the postscript, and I use tvtwm, not olwm. On my machine, which occasionally need PS for AnswerBook, I run OWV3 with tvtwm. LD_LIBRARY_PATH is reversed on both, and the directories are separate. It's cleaner, even if it is a few more blocks.

l & h, kev

Kevin Sheehan kevin%ups.uucp@fourx.Aus.Sun.COM | Uniq Professional Services Pty Ltd ACN 056 279 335 | Why Not? PO Box 70, Paddington, NSW 2021, (Sydney) Australia | Phone: +61-2-360-7434 Fax: +61-2-331-2572 |

================================================================

From: lhume@macadam.mpce.mq.edu.au (Leigh Hume) Date: Tue, 9 Feb 1993 00:24:17 +1100 (EST)

It may not answer your questions but we kept the X!!R5 and OW3 stuff separate. I've not tried puttting in xdm (ver 5) in front of OW3 put that's going to be forced RSN but have tried using OW3 xnews in place of xsun. For reasons unfathomed as yet iit works ok to start up and twm runs on top ok but when quitting the session the Xserver takes several minutes to reset or die; xsun takes seconds. There is an xdm in OW3 but I don't know which subset it's in as it wasn't loaded with the a basic install of OW3. It appears to be th R4 version too. SOe fussing wiht path orders showed it self to be improtant too

setenv LD_LIBRARY_PATH /usr/openwin/lib setenv LD_LIBRARY_PATH /usr/local/X11/lib:$LD_LIBRARY_PATH setenv LD_LIBRARY_PATH /usr/local/sunc++/SC1.0:$LD_LIBRARY_PATH

ie grabbing the X11R5 lib in preference. that seemed to fix a few problems (and undoubtedly caused others).

Hope that is of some assistance.

-- Leigh HUME

Voice +61 2 805 7197 Fax +61 2 805 8983 Email lhume@mpce.mq.edu.au

=================================================================

From: blymn@mulga.awadi.com.AU (Brett Lymn) Date: Mon, 8 Feb 1993 16:15:01 +1030 (CST)

>I need to get X11R5 xdm working with OW3 - pronto. I also need to setup >an environment for X11R5 clients to be compiled and run under OW3. >I have read the FAQ but some things are unclear to me. >

Why put them in the same directory at all? If you put them somewhere else (say in /usr/X11R5) and just point at the libraries with the LD_LIBRARY_PATH. The LD_LIBRARY_PATH variable is a search path so you can do something like:

setenv LD_LIBRARY_PATH "/usr/X11R5/lib:$OPENWINHOME/lib"

which is what I do, that way I keep my X11R5 separate from the system OW stuff.

-- Brett Lymn | "Smoke me a kipper, I will be Computer Systems Administrator | back for breakfast" AWA Defence Industries | - Arnold "Ace" Rimmer

====================================================================

Date: Tue, 9 Feb 93 21:13:41 -0600 From: mikebo@timesink.chi.il.us (Michael Borowiec)

Why do you WANT to put X11R5 and OW3 libraries in the same directory? YUCK!!! Put OW3 where it belongs: /usr/openwin/... Put X11R5 where it belongs: /usr/local/X11R5/... Don't be afraid of LD_LIBRARY_PATH, it is your friend! Once you understand it and OPENWINHOME you'll be quite happy... I run the Xnews server and tvtwm and my LD_LIBRARY_PATH = /usr/local/X11R5/lib:/usr/openwin/lib:/usr/lib:/usr/local/lib ... Works great! Good luck. - Mike

-------------------------------------------------------------------------- Michael Borowiec (N9EUZ) - mikebo@timesink.chi.il.us - mikebo@isc.com >>> Dedicated to the Pursuit of Computer Assisted Time Dissipation <<< --------------------------------------------------------------------------

==================================================================== here endeth the collective wisdoms - i hope i haven't forgotten anyone.

with many humble thanks to:

blymn@mulga.awadi.com.AU (Brett Lymn) casper@fwi.uva.nl (casper Dik) birger@vest.sdata.no (Birger A. Wathne) ups!kalli!kevin@fourx.aus.sun.com (Kevin Sheehan) lhume@macadam.mpce.mq.edu.au (Leigh Hume) montjoy@thor.ece.uc.EDU (Robert Montjoy) mikebo@timesink.chi.il.us (Micael Borowiec)

==== rosi punton | We're all in this together sys prog | - by ourselves. ucnv, bendigo, victoria, australia | Lily Tomlin



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:28 CDT