[1304] in Release_7.7_team

home help back first fref pref prev next nref lref last post

Sun compiler changes

daemon@ATHENA.MIT.EDU (Alex T Prengel)
Mon Jun 8 18:23:50 1998

To: release-team@MIT.EDU
Cc: alexp@MIT.EDU, facdev@MIT.EDU, mbarker@MIT.EDU, wdc@MIT.EDU
Date: Mon, 08 Jun 1998 18:23:43 EDT
From: Alex T Prengel <alexp@MIT.EDU>


Sorry this is so long-winded; but if the compilers break there'll be a lot
of hollering...

After some discussions with the Release Team, I have made static linking
the default for the Sun compilers in the sunsoft_v5.1 locker, which I
expect to make the Athena default soon. This will minimize dynamic
linking, which is problematic for software in lockers. I did this by
moving the dynamic libraries (actually, links to them) from the "expected"
place, <top>/SUNWspro/lib, to <top>/SUNWspro/libdynamic. I plan to send
the following message as a "cookie message" to users running the compilers
when the default is switched to the new compilers:

start*****

                         Sun compiler changes
 
A new set of Sun compilers has been made the Athena default. These are
from the Volume 5 Number 1 Sun update CD and include:
 
        Compiler        Version
        cc              4.2
	CC		4.2
        f77             4.2
        f90             1.2
 
The default link behavior has been changed from dynamic to static as 
dynamic linking is problematic in our environment.
 
In order to fully link dynamically in this release, you will need to add
 
        -L/mit/sunsoft/SUNWspro/libdynamic
 
to your compilation command lines. 

In order to allow your dynamically linked binaries to find the
necessary dynamic libraries at run time, you will generally need to set the
LD_LIBRARY_PATH environment variable to point to these. We recommend
that you rename your binary (suppose it's called myprog) to something
like myprog.real, and to create an "attach and run" script called
myprog, containing lines like the following:
 
        #!/bin/sh
        attach -q sunsoft
        if test ${LD_LIBRARY_PATH-undefined} = "undefined"
        then
         LD_LIBRARY_PATH="/mit/sunsoft/SUNWspro/libdynamic"
        else
         LD_LIBRARY_PATH="/mit/sunsoft/SUNWspro/libdynamic:${LD_LIBRARY_PATH}"
        fi
        export LD_LIBRARY_PATH
        exec myprog.real $*
  
You may not need to do this in some cases (C, C++) where the runtime system
only uses libraries in /usr/lib, which are still dynamically linked by default.
To check if this is the case run ldd on your binary. You will need to use
the "attach and run" script if any libraries are listed as "(not found)".

end*****

Before the new compilers are made the default (i.e. now), every
reference to "sunsoft" should in principle be replaced by
"sunsoft_v5.1" (however see note below).  It would be great if folks
could test this out and/or comment ASAP... I'd like to change the
default soon; also this locker has been installed for about 4 months
and the change may break dynamic binaries that assume the default
library location. I will need to notify the consultants shortly to
tell users to set LD_LIBRARY_PATH to /mit/sunsoft/SUNWspro/libdynamic,
presuming this is the way we intend to keep things.

One further confusing factor is that at least simple C and C++
programs seem to only need libraries in /usr/lib which are not in the
locker. These will default to dynamic linking anyway and don't need the
attach and run script. I don't know of an easy way to tell if libraries
in the locker will be needed (and hence need the script) other than by
running ldd on each binary. Oh well....

To get the new compilers now do "add -f sunsoft_v5.1" (the -f gets around
the current attach and run script in the release which attaches the sunsoft 
locker).

If I don't hear from anyone I plan to switch the default within a couple of
weeks, around the time I get back after USENIX (6/23).

                                               Alex

Note: I made a symlink from /mit/sunsoft/SUNWspro/libdynamic to
/afs/athena/software/sunsoft_v5.1/SUNWspro/libdynamic, so the attach-and-run
script above will work now, and "-L/mit/sunsoft/SUNWspro/libdynamic" will
work also if you attach the sunsoft locker as well. This may be pretty 
confusing but won't be an issue after the default is switched.


home help back first fref pref prev next nref lref last post