SIPB ClueDump #1
How To Build Random Software
Credits and Blurb
Run by: mkgray, yandros, ghudson
Written by: bobmacke
In this session we will talk about finding and building `interesting'
programs on the net. We may touch on some issues involved in
installing and maintaining programs as it's normally done in the sipb
and outland lockers.
NOTE: A lot of the means of usage shown here are
Athena-specific. If you are on another system, you will need to find
out what to do to use these services (assuming your system offers
them).
In This Cluedump:
First things First: Finding Stuff
Before you can build cool things, you have to find them. FTP works
well for this.
ncftp (or ftp)
Usage:
add sipb
ncftp <location>
(for example)
ncftp ftp.x.org:contrib/...
You should be prompted for a username and password. Most places
accept anonymous as the user, and prefer your email address as
the password.
At this point you should receive the ftp> prompt.
Here are the commands that will work in ftp:
ftp>
- ls lists the current directory.
- cd changes directory (usage: cd <directory or path>)
- binary / ascii controls whether sent over 7- or 8-bit
format
Usage:
- binary use this (AKA bin or
image) for most
files, especially .gif or other image files.
- ascii use this for text-only files.
- get transfers file to the directory at your home site.
Usage: get <filename>
- mget transfers multiple files to the dir at your home
site. Example: mget *.gif
- prompt toggles on/off the "Do you want to get...?"
prompting. Useful for toggling it off for mget-ting multiple files.
- lcd changes the local directory (the directory at your
homesite). Useful when you don't want to 'get' a file to the
local directory you are currently in.
Common errors:
- ftp: permission denied This is a local error which
means you are unable to write to your current local directory.
Remedy: Use lcd to change to a directory you can write
to.
- <some number>: <error message> This is an
ftp error. Depending on what it says, attempt to remedy the problem
yourself or get help from a clueful person.
To read a file (without retrieving it first)
- page <filename> runs the file through more
(ncftp only)
- get <filename> "| more" (sometimes this acts weird,
but it usually works)
- get <filename> |more
Where to Find Cool Stuff
So, now you know how to use ftp to find cool stuff, but where to ftp
to? Where is the best cool stuff located?
ls -lat "| more" ...
- ftp.x.org:contrib (x-stuff)
- prep.ai.mit.edu (gnu stuff)
- ftp.uu.net (general / usenet)
- gatekeeper.net.com (general)
- wuarchive.wustl.edu (general / msdos) - Use this as your second
choice to find EVERYTHING! (They have a very extensive archive of neat stuff)
- sunsite.unc.edu (linux stuff)
archie <foo> finds stuff for you! This searches
prospero for the file, and returns the sitename, pathname, and
sometimes a little more info. Sometimes, there are a zillion
entries listed. In that case, check the hostname endings to find the
most "local" host. FTP to the sites with the "nice" endings
(.mit.edu, .edu, .gov, etc.) and avoid "weird" endings which could be
overseas or something.
If the list is way too long, you can try archie -server <foo> to
narrow down the search.
Building Stuff
Okay, you finally found the cool thing you want. Now you have to
build it. How? Read on...
README
Before attempting to build/configure anything, check the directory
from which you are getting stuff to see if there is a file called
README or sometimes INSTALL. (Actually, any name in all caps should be
checked.) You should read these files before anything else.
They may have important, helpful, or vital information about
installing the stuff in the directory. Sometimes they only have pointless
info, but always read them anyway.
gunzip
Gunzip is used to decompress files that are compressed. Compressed
files have endings of .tar.gz, .tgz, and sometimes .tar.Z
add sipb
gunzip <file>.tar.gz (or .tar.Z or .tgz)
(Returns <file>.tar)
tar (and gtar)
Sometimes, what you want is packaged in a neat and tidy file that,
because it is just one file, is easy to port around and therefore easy
to put it where you want it. However, that one file is actually a
package of all the different files required for the software you want
to build. To separate it out into the separate files (such that you
can actually USE it), you want to use tar.
tar <commands> <file>.tar
(example): tar xvf xteddy.tar
Commands:
tar
- x - extract
- t - list
- c - create
- v - verbose (format)
- f - file
One thing you want to consider is that you probably should create a
subdirectory in which to put the files when you use tar. Otherwise,
(at best) you will wind up with a mess of files in your home directory
or (at worst) some of the files will have the same name as files that
already exist, and those files will be written over.
gtar - Should work similar to tar, except it adds the -z option
which runs gzip/gunzip (after compressing)/(before decompressing).
Under Linux, gtar is the default and is called "tar"
add outland
gtar <file>.tar.gz
./configure
This will usually be described in README (yet another argument for
reading README before attempting to build anything.)
xmkmf
add x11[m]
xmkmf <foo>
xmkmf stands for xmake makefile, sometimes known as IMakefile.
Some Makefiles require gmake (which adds a bunch of stuff that
not all makes have)
make
In theory, make should nicely build software for you without any
trouble. Just type make <foo> and you have a nice bit of
software built for you. yay. However, in practice make doesn't always
work that way. (boo)
Common Problems
- CC - you want to use the gcc compiler instead of the cc compiler
(add outland)
- weird undef'd character errors
- make: <foo> must be a separator on line xxx - bug in
make. Get help.
- make: <foo> don't know how to make <foo>
Problems:
- athena doesn't have certain files it needs
- need to attach something to access the files / lockers it
needs
- sipb
- outland
- x11 or x11r5
- motif1.1 or motif1.2 (If motif had beed attached
before, detach it before attaching motif1.1 or 1.2)
- Weird header files - shoulda used configure instead.
Native Compilers
Native Compilers are usually a pain in the butt.
<foo>.c Line 427: Identifier TIOCLN!... undeclared
(solution:) grep <foo>.c TIOC /usr/include/*.h
(Usually, this means that you need to include a header file that
wasn't included before, for whatever reason.)
bobmacke@MIT.edu