swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detailed Swarm-1.1 Install Guide For Linux Inside


From: Paul Johnson
Subject: Detailed Swarm-1.1 Install Guide For Linux Inside
Date: Thu, 02 Apr 1998 01:43:31 -0600 (CST)

Dear Swarm Users:

I had about one lock-up per 5 minutes in the Win95 Swarm experience, so I 
figure I'm staying
with Linux for development activity.  The Win95 version will probably be most 
useful in the
classroom setting when we can distribute pre-made applications, IMHO.  I did 
not have the
same troubles with WinNT, I'd hasten to add, although its nowhere near as much 
fun as Linux.
And its not available in our student labs.

Anyway, I've passed these instructions around a while and a few people, 
especially Marcus D,
have given helpful pointers, but all responsibility for mistakes and bad typing 
is mine.

Even if you don't need help with a Linux install, I wish you'd look in here for 
mistakes,
as this material will eventually find its way into the SwarmFAQ and I can't fix 
problems.
unless you let me know about them.

One warning: I've set my line length to 120 to protect the long lines in the 
Makefile.conf
example below.  If you have a shorter line length, some stuff will look broken 
up!
--------------------------------------------------------------------------
Notes on installing Swarm-1.1 in a Linux system.  Paul Johnson (address@hidden)
2/1/98 rev. 4-2-98

If you want to do Swarm in Linux, you have three alternatives: binary install, 
archive install
against  tcl7.6/tk4.2, or archive install against tcl8.0/tk8.0.  This note 
focuses mostly on the last
one, but gives information about the others as well. 

The binary install is by far the easiest.  You get the swarm-binary+source for 
your system--be  sure
to match your version of GCC and the C-library--download, untar, fiddle in 
Makefile.conf,  type
"make", and (maybe) set some environment variables.  

I created a directory /swarm and put most swarm stuff inside there, so the 
unpacked swarm-1.1 is in
/swarm/swarm-1.1.  For my Redhat 5.0 system, the top section of  Makefile.conf 
section is edited like
this:

        ifeq ($(SWARMSETUP),)
        # Select your setup here, set SETUP in the environment, or provide
        # a value on the command line.
        SETUP=NONE
        else
        SETUP=$(SWARMSETUP)
        endif

        ### for SETUP=NONE
        SYS=GNU/Linux
        OTHERINCDIRS= -I/usr/X11R6/include -I/usr/local/include 
        OTHERLIBDIRS= -L/usr/X11R6/lib -L/usr/local/lib
        SYSDEPLIBS=-ldl

        LDCONFIG=bin 

I have no SWARMSETUP environment variable, so it uses NONE as my configuration, 
and the specified
directories refer to the bare minimum required files.  Type "make" and there 
should be a show.  To
test the installation, get the swarmapps-1.1.tar.gz and uncork it, probably 
inside /swarm.  For the
first version of Swarm-1.1, it was necessary to create a SWARMHOME environment 
variable that pointed
to the install directory in order to run Swarm programs, but by the time you 
get this, it may not be
needed.  If you can compile swarm and swarmapps, but get seg faults when you 
run, try creating an
environment variable in your shell (in BASH, type "export 
SWARMHOME=/swarm/swarm-1.1").  In my case,
it was not necessary to specify environment variables for TCL_LIBRARY or 
TK_LIBRARY or BLT_LIBRARY,
as we were required to do for previous versions of Swarm. It may be that, by 
the time you get the
Swarm binary, it is not even necessary to specify the SWARMHOME variable.  Of 
course, if you don't
have a SWARMHOME, you might need TCL_LIBRARY and TK_LIBRARY... 

If you don't want to be a binary user, or there is no binary for your system, 
then you should
do the "archive" install. That is, build the swarm stuff from the "code-on-up." 
 I like this
way best because it makes me feel more independent and in-control.  I can apply 
"patches" to the swarm
source code and recompile swarm--binary users cannot.  Another advantage is 
filespace. 
The compiled heatbugs executable is 4.3MB from the binary install, but with the 
archive method, which
uses shared libraries, the executable's file size is only 2.3MB.

First, get the swarm-1.1.tar.gz file. You don't need a binary version included, 
just source.

Second, choose a version of BLT and TCL/TK.  If you have a Linux system with 
tcl7.6/tk4.2, it is 
probably easiest to leave them and configure Swarm to use BLT2.3.  The SwarmFAQ 
refers
to information about configuring with a tcl7.6/tk4.2 system. For Swarm-1.1, you 
need to get BLT2.3, 
tclobjc1.3, and a new library called FFI which was not required for previous 
versions of Swarm.  
(An example of how to install FFI is included below, it is the same no matter 
which BLT you pick).  

Redhat 5 comes with tcl/tk 8.0, and until Swarm-1.1, we had to go through all 
kinds of gyrations to
install the older tcl/tk and then BLT2.3.  That was a hassle because people who 
are not experts (like
me) can get the libraries from the two versions of tcl/tk confused and then 
there could be trouble. 
If you want to follow that route, it will still work, but, as Marcus Daniels 
has pointed out, you can
have unexpected problems  when you try to keep two different versions of a 
major development library
like tcl/tk when you don't know what you are doing (more and more, it seems I 
don't.)  In the process
of dealing with this, I've learned one major lesson.  When you install 
libraries just for swarm, it
is probably best not to install them in the usual /usr or /usr/local hierarchy. 
 If you install them
in there, it is hard to get them out, and there is danger other programs will 
find those files and
use them by mistake. The compiler is always going to trowel through 
/usr/local/include and
/usr/include and that can be a source of trouble.  So, for libraries that are 
general purpose, such
as tcl/tk, used by many programs, it is probably OK to install them in /usr or 
/usr/local, but you
should do it with the understanding of the broader issues involved.

The relases of Swarm-1.1 will help to solve some significant library problems 
because Swarm-1.1 is
compatible with a new version of BLT, which is called blt8.0-unofficial.  Its 
called unofficial
because the original BLT author seems to have "fallen from view" and others 
updated BLT to work with
tcl/tk8.0. Unfortunately, Redhat users will have to upgrade their tcl/tk to 
version 8.0p2, but as
outlined below, that is not a terrible hassle.  It is a useful system upgrade, 
in fact, because many
new software libraries such as TkStep will require tcl/tk8.0p2. 


While this is fresh in my mind (after fighting through installs on 2 machines), 
here is the install
method.

1. Get libffi-1.17.tar.gz and put it somewhere, perhaps in /usr/local/src.  
Untar it (tar -xzvf
libffi-1.17.tar.gz) and then just follow the standard procedure to make it 
install under
/swarm/ffi-1.17.  I chose to write this into the /swarm directory because I 
don't know of any other
software that requires ffi, and I want to keep it segregated so I can get rid 
of it whenever I want.
You type ($ is linux shell prompt)
  $ ./configure --prefix=/swarm/ffi-1.17
  $ make
  $ make install
  
You do not need to be root to do this, since (hopefully) you have given users 
permission to write on
the /swarm directory.

2. Get tcl/tk8.0p2.  If you have 8.0 now, as in a standard Redhat 5 system, it 
is not good enough. I
upgraded my tcl/tk the "old fashioned way" from the source, and I will describe 
that now, in case you
want to try it too.  If you want to try an easy route (which I have not tried), 
there are RPMS
available for tcl/tk8.0p2 on ftp://starship.skyport.net/pub/crew/andrich/ and I 
think they may do the
job.  If you install the 3 rpms for the tk8.0p2 and 3 for the tcl8.0p2, you 
will find it has put the
libraries and headers where you need them in /usr/lib and /usr/include and the 
"source" rpm (the one
called tcl-source-8.0p2-1.i386.rpm) has put the stuff in /usr/src. 

If you want to follow along with these source-based instructions, first, get 
the tcl/tk source from

                    ftp://ftp.smli.com/pub/tcl/tcl8.0p2.tar.gz
                    ftp://ftp.smli.com/pub/tcl/tk8.0p2.tar.gz
I put both of these in a directory called /usr/local/src/tktcl, and after 
untarring
there is one subdirectory for /tcl8.0 and one /tk8.0.

>From the  /usr/local/src/tktcl directory go like this: 
 
  $ cd tcl8.0
  $ cd unix
  $ ./configure --prefix=/usr --enable-gcc --enable-shared
  $ make
  $ make install

and for Tk, get into the directory tk8.0 and:  
  $ cd unix
  $ ./configure --prefix=/usr --with-x --enable-gcc --enable-shared 
--with-tcl=../../tcl8.0/unix
  $ make
  $ make install


3. Keep the TCL/TK source files in a common directory, and copy the blt8.0unoff 
into
that directory and unpack it. I copied it into /usr/local/src/tktcl, but if you 
used the RPMs, 
copy the blt source into /usr/src). After untarring, change into 
blt8.0-unoff/unix, type 
  $ mkdir Linux 
(assuming you are using linux--type "uname -s" to see what your system name is 
if you want to be sure).
Then change into the Linux subdirectory, type 
 $  ../configure --prefix=/swarm --enable-shared
And then
 $   make
Go into the demos directory (cd ../../demos) and type barchart or whatever to
test the executables created there. If all is OK, go back to 
blt8.0-unoff/unix/Linux
and type 
 $   make install
    
Note this puts blt8.0 in /swarm/blt8.0-unoff and the shared library in a
subdirectory called /swarm/blt8.0-unoff/lib/shared/libBLT8.0.so.  I had to go 
into
/swarm/blt8.0-unoff/lib and  manually create the symbolic link
 $    ln -sf shared/libBLT8.0.so libBLT.so    
    
4.  Get the tclobjc tarball from the swarm source. At the moment, the newest is 
1.3.
Unpack it anywhere you want.  I put it in /usr/local/src.  Then, run 
  # ./configure --prefix=/swarm/tclobjc-1.3
For me, the make would not work unless I went into the Makefile and forced it to
use the tcl/tk8.0.  My difficulty is due to the fact that I've got two 
different versions
of TCL/TK installed, you may not have that problem.  The Makefile looks like 
this for my 
Redhat 5.0 system:

# directories in which to find the required include files
TCL_INCLUDE_FLAGS = -I/usr/include
TK_INCLUDE_FLAGS= -I/usr/include
X_INCLUDE_FLAGS = -I/usr/X11R6/include
READLINE_INCLUDE_FLAGS =  # configured to not use readline

TCL_LIBRARY_FLAGS = -L/usr/lib -ltcl8.0
TK_LIBRARY_FLAGS = -L/usr/lib -ltk8.0
X_LIBRARY_FLAGS = -L/usr/X11R6/lib -lX11
READLINE_LIBRARY_FLAGS =  # configured to not use readline
    
Type "make", it goes makes fine.

After that change, you should type "make check" and a tclobjc "hello" program
puts a button on the screen.  If not, you've got problems.  The first time I
typed "make check", it generated some "invalid type cast" errors, but the hello
world button appeared.  That made me think it worked ok. The second time I did 
make
check, no such errors appeared.

5. Get the swarm-1.1 source (swarm-1.1.tar.gz). 

Unpack this somewhere, I created a directory called /swarm and copied the 
tarball into it. 
After it is unpacked (tar -xzvf swarm-1.1.tar.gz), look at the Makefile.conf.  
The settings in Makefile.conf have become increasingly specific over the years.
It may seem like a hassle to set all of these details, but Marcus Daniels has 
explained 
to me the attraction of explicitly specifying these directories and versions.  
The compilation
is much less likely to grab the wrong header files or libraries if you include 
these specifications.
Some of the example configurations in the Makefile make use of environment 
variables that
specify the top part of the directory structure.  My directories are explicit 
and don't
depend on anything I've specified in the environment. 

You can't just take a Makefile.conf from an older Swarm source and substitute 
it in Swarm-1.1.  
That will kill you every time! (I found out the hard way.)

Note: Your Makefile.conf may not be writable after untarring, so use "chmod +w
Makefile.conf" to fix that.

My Makefile.conf section looks like this (my "setup" is named 
pj-UKANS-GNU/Linux-glibc2):

SETUP=pj-UKANS-GNU/Linux-glibc2
else
SETUP=$(SWARMSETUP)
endif

### for SETUP=NONE

SYS=
OTHERINCDIRS= 
OTHERLIBDIRS=
SYSDEPLIBS=
LDCONFIG=archive

ifeq ($(SETUP),pj-UKANS-GNU/Linux-glibc2)
SYS=GNU/Linux
CC=gcc
OPTFLAGS=-O3 -g
FFPREFIX=/swarm/ffi-1.17
FFINCDIR=$(FFPREFIX)/include
FFLIBDIR=$(FFPREFIX)/lib
BLTPREFIX=/swarm/blt8.0-unoff
BLTINCDIR=$(BLTPREFIX)/include
BLTLIBDIR=$(BLTPREFIX)/lib
XPREFIX=/usr/X11R6
XINCDIR=$(XPREFIX)/include
XLIBDIR=$(XPREFIX)/lib
TCLVERS=8.0
TKVERS=8.0
TCLPREFIX=/usr
TCLINCDIR=$(TCLPREFIX)/include
TCLLIBDIR=$(TCLPREFIX)/lib/tcl$(TCLVERS)
TKPREFIX=/usr
TKINCDIR=$(TKPREFIX)/include
TKLIBDIR=$(TKPREFIX)/lib/tk$(TKVERS)
TCLOBJCPREFIX=/swarm/tclobjc-1.3
TCLOBJCINCDIR=$(TCLOBJCPREFIX)/include
TCLOBJCLIBDIR=$(TCLOBJCPREFIX)/lib
OTHERINCDIRS= -I$(TCLOBJCINCDIR) -I$(BLTINCDIR) -I$(TCLINCDIR) -I$(TKINCDIR) 
-I$(XINCDIR) -I$(FFINCDIR)
OTHERLIBDIRS= -L$(TCLOBJCLIBDIR) -L$(BLTLIBDIR) -L$(TKLIBDIR)/.. 
-L$(TCLLIBDIR)/.. -L$(XLIBDIR) -L$(FFLIBDIR)
override EXTRALDFLAGS+=-Wl,-rpath,$(TCLOBJCLIBDIR),-rpath,$(BLTLIBDIR)
override EXTRALDFLAGS+=-W1,-rpath 
$(TKLIBDIR)/..,-rpath,$(TCLLIBDIR)/..,-rpath,$(FFLIBDIR)
override EXTRACFLAGS+=-Wno-implicit-int
endif

(Warning: some of the above lines are very long--don't let a editor break them 
in the middle!)
                          
If you put the BLT or tclobjc files somewhere else, of course you have to 
adjust. Type "make"
and you should see a lot of gcc messages.

An important feature, new to me, is the EXTRALDFLAGS statement near the bottom. 
This
guides the dynamic linker to the directories you want it to use.  With this 
command
included, you don't need to modify ld.so.conf or fix LD_LIBRARY_PATH.  If the
compiler finds the stuff in the directories you specify, it uses them. If it 
doesn't
find them in there, it goes to the stuff that is specified in ld.so.conf.

Another thing to note is that the new style is to put "DIR" at the end of 
directory names in
Makefile.conf. That keeps them separated from references to specific file or 
library names.

5. Get a swarmapps-1.1 and unpack them somewhere. I put mine under /swarm. In 
order to run the 
applications, Swarm-1.1 (for now, anyway) requires you to create an environment 
variable SWARMHOME:
     $ SWARMHOME=/swarm/swarm-1.1
     $ export SWARMHOME
Then change to a directory, such as heatbugs. You don't need to edit the 
Makefile because it will
look in your environment for SWARMHOME and build against that set of libraries. 
 If you see errors
as the program compiles and links, look carefully for typos in your 
Makefile.conf.  Even though Swarm 
itself might compile, typos in the Makefile.conf still can affect efforts to 
compile programs.



----------------------------------
E-Mail: Paul Johnson <address@hidden>
Date: 02-Apr-98
Time: 01:33:44

This message was sent by XFMail
----------------------------------

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]