Archive-name: sgi/faq/apps
Last-modified: Tue Jul  5 20:54:50 CDT 1994

    SGI apps Frequently Asked Questions (FAQ)

This is one of the Silicon Graphics FAQ series, which consists of:

    SGI admin FAQ - IRIX system administration
    SGI apps FAQ - Applications and miscellaneous programming
    SGI graphics FAQ - Graphics and user environment customization
    SGI hardware FAQ - Hardware
    SGI Impressario FAQ - IRIS Impressario
    SGI Inventor FAQ - IRIS Inventor
    SGI misc FAQ - Introduction & miscellaneous information
    SGI movie FAQ - Movies
    SGI Performer FAQ - IRIS Performer
    SGI pointer FAQ - Pointer to the other FAQs

Read the misc FAQ for information about the FAQs themselves.  Each FAQ
is posted to comp.sys.sgi.misc and to the news.answers and comp.answers
newsgroups (whose purpose is to store FAQs) twice per month.  If you
can't find one of the FAQs with your news program, you can get it by
anonymous FTP from one of these sites:

    rtfm.mit.edu:/pub/usenet/comp.sys.sgi.misc/
    rtfm.mit.edu:/pub/usenet/news.answers/sgi/faq/
    rtfm.mit.edu:/pub/usenet/comp.answers/sgi/faq/
    viz.tamu.edu:/pub/sgi/faq/

Note that rtfm.mit.edu is home to many other FAQs and informational
documents, and is a good place to look if you can't find an answer
here. If you can't use FTP, send mail to mail-server@rtfm.mit.edu with
the command 'send usenet/news.answers/ftp-list/faq' on a line by itself
in the text, and it will send you a document describing how to FTP by
mail. You can also read a hypertext version of the FAQs at

    http://www.cis.ohio-state.edu/hypertext/faq/usenet/sgi/top.html

The SGI FAQs are freely distributable and we encourage wide circulation.
The contents are accurate as far as we know, but the usual disclaimers
apply. Please send additions and changes to sgi-faq@viz.tamu.edu.

Topics covered in this FAQ:
---------------------------
   -1- Where can I find software for SGIs?
   -2- Where can I find software already compiled for SGIs?
   -3- What about Explorer?
   -4- What about FlexFAX?
   -5- WHAT TO USE?
   -6- What's a good graphical text editor for SGIs?
   -7- What's a good graphical mail program for SGIs?
   -8- How can I convert ASCII to PostScript?
   -9- How can I preview PostScript?
  -10- How can I edit PostScript files?
  -11- How can I format unformatted manpages?
  -12- IRIX's version of top(1) doesn't let me renice or kill processes
       interactively. What to do?
  -13- BUGS AND PROBLEMS
  -14- Why isn't Iris Insight working properly?
  -15- Why don't the arrow keys work in vi?
  -16- How can I tell application X about my screen size?
  -17- Why does ksh lock up if one's home directory is NFS-mounted?
  -18- Why can't I 'talk' to Suns?
  -19- How can I change what the keys on my keyboard do?
  -20- Where did 'zip's file-browsing gizmo go in IRIX 5.x?
  -21- Why does 'man -k' repeat itself in IRIX 5.2?
  -22- COMPILERS AND PROGRAMMING
  -23- What are the correct versions of the Irix Development Option
       (IDO) and Fortran for current versions of IRIX?
  -24- Why doesn't my non-ANSI C program compile under IRIX 4.0.x?
  -25- Why is 'make' complaining about syntax errors that I can't find?
  -26- Where's edge in IRIX 5.x? What can I use instead?
  -27- Can I use dynamic shared objects in IRIX?
  -28- How can I tell which shared objects my executable uses?
  -29- How can I generate IRIX 4.0.x-compatible executables under IRIX
       5.x?
  -30- How can I convert IRIX 4.0.x executables to IRIX 5.x?
! -31- Why does malloc() never return NULL?
  -32- Where's CHILD_MAX?
  -33- Where did the system header files go after I installed IDO 4.1.1?
  -34- What prototypes are missing in IRIX 4.0.x and 5.x?
  -35- Why are some static libraries missing in IRIX 5.x?
  -36- Where are the audio, CD and DAT libraries in IRIX 5.x?
  -37- Where are the regcmp and regex functions?
  -38- Why doesn't application X understand NIS (Yellow Pages)?
  -39- Why can't my networking application resolve hostnames in IRIX
       5.x?
  -40- PORTING
  -41- How can I make the 'install' program work like BSD 'install'?
  -42- Where's 'ranlib'?
  -43- Why does GNU Emacs not compile, or compile but not run?
  -44- What do I need to do to build gcc/g++?
+ -45- Is there an SGI-compatible version of XView?

----------------------------------------------------------------------

Subject:    -1- Where can I find software for SGIs?
Date: 20 May 94 00:00:01 EST

Silicon Graphics can tell you about their own and third-party
commercial software.  Call SGI Direct for more information; see
the misc FAQ for phone numbers.

The best general reference for finding sources on the Internet is
Jonathan Kamens' "Finding Sources" document. It can be FTPed from
rtfm.mit.edu:/pub/usenet/news.answers/finding-sources. Read it
carefully before you post a question about finding software ...
because half of your answers will be "look in Archie" anyway, and
"Finding Sources" tells you how to do that.

Useful general archive sites include ftp.x.org:/ for X software
(particularly in the /contrib and /R5contrib directories) and X itself
(in /pub), prep.ai.mit.edu:/pub/gnu/ for GNU software, and
ftp.uu.net:/ and wuarchive.wustl.edu:/ for nearly anything, including
archives of many Usenet sources newsgroups and mirrors of the
aforementioned GNU and X archives.

The best SGI-specific reference is Bill Henderson's
<billh@hampton.sgi.com> SGI anonymous FTP list. (See "What are some
related network documents?" in the misc FAQ.) Good places to look, if
you just feel like looking, are ftp.sgi.com:/ and sgigate.sgi.com:/,
where are kept any number of freebies from the folks at SGI, and
swedishchef.lerc.nasa.gov:/, a site particularly well-stocked with
SGI-related materials.

Finally, see the next question for places to find precompiled software
and questions (in this and the other SGI FAQs) which discuss
particular packages for pointers to those packages.

------------------------------

Subject:    -2- Where can I find software already compiled for SGIs?
Date: 17 Jun 94 00:00:01 EST

A very large stash of SGI-compiled software is at
ftp.uni-stuttgart.de:/sw/; look in the sgi_40 directory for IRIX 4.0.x
versions and the sgi_51 directory for IRIX 5.x versions.

David Hinds <dhinds@allegro.stanford.edu> keeps a stock of GNU
software compiled for IRIX 4.0.x at cb-iris.stanford.edu:/pub/gnu/.
Presently it includes recent versions of binutils, emacs, gas, gcc,
glibc, gnuplot, groff, gzip, libg++, make, patch and perl.

Scott Henry <scotth@sgi.com> provides recent versions of GNU Emacs and
gzip compiled for IRIX 4.0.x and (pay attention here) IRIX 5.x, in
'inst' form, in sgigate.sgi.com:/net-services/gnu-emacs.

If none of the above helps, check Bill Henderson's list.  Keep in mind
that many of these binaries won't be the latest version, and it's worth
checking the latest version to see if IRIX support has improved.  SGI's
presence is continuously increasing and the trend is definitely toward
better IRIX support.

------------------------------

Subject:    -3- What about Explorer?
Date: 24 Feb 94 00:00:01 EST

The IRIS Explorer data visualization system has its own newsgroup,
comp.graphics.explorer. There is an FTP site at
ftp.epcc.ac.uk:/pub/explorer/ (with a North American mirror at
swedishchef.lerc.nasa.gov:/explorer/), a WWW page at
http://www.nag.co.uk:70/1h/Welcome_IEC and an FAQ which you can find
at any of those sites.

------------------------------

Subject:    -4- What about FlexFAX?
Date: 28 May 94 00:00:01 EST

There is a FlexFAX mailing list listed in the misc FAQ.

------------------------------

Subject:    -5- WHAT TO USE?
Date: 10 Dec 93 00:00:01 EST

The next few questions discuss software for various applications.

------------------------------

Subject:    -6- What's a good graphical text editor for SGIs?
Date: 11 Mar 94 00:00:01 EST

The most popular graphic text editors on SGIs include:

zip (by Tom Davis of SGI) is something like jot but is orders of
magnitude faster and laden with nifty features. It doesn't run well
remotely or at all on X-terminals, text terminals or non-SGI machines,
but if most of your editing will be at an SGI console, read no
further!  You can FTP it from ftp.sgi.com:/graphics/zip/. If you're
using IRIX 5.x, 'zip' has replaced 'jot' and you probably didn't even
need to read this question. However, see below for a bug and
workaround.

nedit is a straightforward graphical editor with programmers' features.
It needs X-windows but not GL. Get it from fnpspb.fnal.gov:/pub/nedit/.
Patches to make it work under IRIX 5.x are at
viz.tamu.edu:/pub/sgi/software/nedit/nedit-on-irix-5.x.patch.

GNU Emacs, a perennial favorite, isn't just an editor; it's a way of
life.  It has a X-windows mode and works on X-windows terminals as well
as SGI consoles and text terminals. Its X-windows support, once rather
lackluster, has improved in the recently released version 19. It may be
FTPed from any GNU archive, e.g. prep.ai.mit.edu:/pub/gnu/.

Epoch is a derivative of GNU Emacs 18 with better X-windows support. It
may be found at cs.uiuc.edu:/pub/epoch-files/epoch/.

Lucid Emacs is a derivative of an early version of GNU Emacs 19. It may
be found at lucid.com:/pub/lemacs/. It requires graphics.

Finally, the comp.windows.x FAQ (at
rtfm.mit.edu:/pub/usenet/comp.windows.x/) lists many more editors which
run under X-windows, both free and commercial.

------------------------------

Subject:    -7- What's a good graphical mail program for SGIs?
Date: 03 Apr 94 00:00:01 EST

SGI ships 'xmh' but not 'mh' (which 'xmh' needs), and it looks nasty
anyway. Here are some more popular choices:

The free programs Elm and Pine are not graphical, but they are
screen-oriented (they use text-based menus), easy to use, powerful and
can easily be run in a separate window. They can be configured to use
'metamail' for MIME support. (MIME, described in RFC1521, is a
standard for enclosing multimedia material in your mail.) Elm can be
FTPed from dsinc.dsi.com:/elm/, Pine from ftp.cac.washington.edu:/pine/
and 'metamail' from thumper.bellcore.com:/pub/nsb/. Elm has an FAQ (at
rtfm.mit.edu:/pub/usenet/comp.mail.elm). A package which makes Elm
work nicely with IRIX 4.0.5x's WorkSpace is at
proton.chem.yale.edu:/pub/elm-ws-support.shar. Note that Elm's
autoreply/arepdaemon subsystem has a bad security hole, so don't
install those binaries. The rest of Elm is fine.

An IRIX-friendly version of 'xmailtool' is in
crocus.medicine.rochester.edu:/pub/apps/.

Z-Mail is a commercial product written by Z-Code and redistributed by
SGI. IRIX 5.x includes MediaMail, a subset of Z-Mail. Both are
MIME-compatible and have a text-only mode.  The PostScript file
viz.tamu.edu:/pub/sgi/software/mail/zmail-vs-mediamail.ps describes
the differences between Z-Mail and MediaMail.  Z-Mail/MediaMail
includes 'metamail', so if you use both Z-Mail/MediaMail and Elm or
Pine or another free mail program, you can save yourself some trouble
by configuring the latter to use the former's 'metamail'.

Finally, Chris Lewis' "Unix Email Software - a Survey" lists many mail
programs, some of which are graphical. FTP it from
rtfm.mit.edu:/pub/usenet/news.answers/mail/setup/unix.

------------------------------

Subject:    -8- How can I convert ASCII to PostScript?
Date: 19 Jun 94 00:00:01 EST

- IRIX 4.0.x includes 'lptops', which, because it's called indirectly
  from 'lp', isn't as well known as it ought to be. Read the 'lptops'
  and 'gpsinterface' manpages.

- Adobe Transcript, which includes 'enscript' (something like 'lptops')
  and 'psroff' (nroff/troff-to-PostScript) is available at extra cost
  from SGI.  Most people manage without it.

- SGI's own Impressario does PostScript and a lot of other things. It
  too costs extra. See the Impressario FAQ.

- Popular free converters include 'a2ps' (at
  imag.fr:/archive/postscript/), 'lwf' (in volume 15 of
  comp.sources.unix, e.g.
  ftp.uu.net:/usenet/comp.sources.unix/volume15/lwf/) and 'psf' (in
  volume 35 of comp.sources.misc, e.g.
  ftp.uu.net:/usenet/comp.sources.misc/volume35/psf3/).  The
  comp.lang.postscript FAQ (at
  rtfm.mit.edu:/pub/usenet/comp.lang.postscript/) has a much longer
  list of such programs, unfortunately no longer including reviews or
  FTP sites.

- One good way to print manpages is with the '-m' option to 'a2ps'.

------------------------------

Subject:    -9- How can I preview PostScript?
Date: 20 Mar 94 00:00:01 EST

Display Postscript (DPS), which includes the 'xpsview' PostScript
previewer, is an extra-cost option from SGI. Happily, Robert Keller of
SGI <rck@fangio.asd.sgi.com> has made available GNU's GhostScript
previewer, compiled *and* in SGI 'inst' installable form. FTP it from
ftp.sgi.com:/sgi/ghost/.

Dale Atems <atems@physics.wayne.edu> points out:
Many people try ghostscript and give it up because of the fonts.  There
is something about ghostscript that's not as widely known as it should
be and deserves emphasis: if you have SGI's Display Postscript, you can
forget about most of the ugly bitmap fonts that come with ghostscript.
Edit your Fontmap file to point ghostscript to the DPS outline fonts
(in /usr/lib/DPS/outline/base) and it will use them instead. This will
improve both screen display and, if you're not using a Postscript
printer with those fonts already built in, printing quality.

------------------------------

Subject:   -10- How can I edit PostScript files?
Date: 07 May 93 00:00:01 EST

Ivan Bach <ib@sgi.com> collected some testimonials from a number of
SGIers:

- Adobe Illustrator and Corel Draw can edit PS files of type AI (a
  simplified version of PS that facilitates editing).

- Transverter (from TechPool, 212-291-1922) can convert some general
  PostScript files to AI PostScript. It also does other conversions,
  e.g.  to TIFF.

- If you have DPS extensions on your server and a DPS compile time
  environment you can do this quite well with xfig. Check out the
  version in crocus.medicine.rochester.edu:/pub/apps/.

- The InterViews tool `idraw' allows manipulation of EPS (Encapsulated
  PostScript) files, and has a `mac-type' interface.

- Island Draw 3.0 has an option to import Postscript, and it seems to
  accept arbitrary Postscript.  I have fed it single page Postcript
  files from Illustrator, Corel, Ventura, Designer, Eroff, and
  hand-coded files, and it made Island Draw objects out of them.  The
  file initially opens as one grouped object, but if you ungroup, you
  get editable objects.  I was quite impressed.  I don't doubt there
  are ways to fool the interpreter, but it works for output from
  drawing and publishing packages, which is what I need it for.

------------------------------

Subject:   -11- How can I format unformatted manpages?
Date: 19 Jun 94 00:00:01 EST

SGI provides manpages in formatted form, and does not therefore need to
provide us all with the formatting software. Most FTPable software,
however, comes with unformatted manpages.

Manpages are most often formatted with Documenter's Workbench (DWB),
which SGI has had to license separately from USL and we have to buy
separately from SGI.  SGI's DWB is based on version 2.1; the current
version from USL is 3.3.

Public domain alternatives to DWB include 'groff' and 'awf':

'groff' is by the Free Software Foundation and can be had from any GNU
archive (e.g. prep.ai.mit.edu:/pub/gnu/).  Compilers beware: it must be
compiled with g++ (or another C++ compiler?). However, there are
compiled binaries in cb-iris.stanford.edu:/pub/gnu/.  David Hinds
<dhinds@allegro.stanford.edu>, the man who put them there, gives this
advice for installing groff so that it can format manpages on the fly
in IRIX 4.0.x:

Create a script called 'eqn':

 > #!/bin/sh
 > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
 > geqn $*

and a script called 'neqn':

 > #!/bin/sh
 > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
 > geqn -Tascii $*

and do:

 > ln -s gnroff nroff

and edit the end of the gnroff script to be:

 > rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
 > exec groff -Wall -mtty-char $T $opts $rest

To get PostScript output from 'man -t', you also need to create a
'psroff' script similar to 'nroff'.  Here are the context diffs:

*** /usr/local/bin/nroff        Sat Feb 13 15:51:09 1993
--- /usr/local/bin/psroff       Sat Feb 13 17:45:46 1993
***************
*** 1,8 ****
  #!/bin/sh
! # Emulate nroff with groff.

  prog="$0"
! T=-Tascii
  opts=

  for i
--- 1,8 ----
  #!/bin/sh
! # Emulate psroff with groff.

  prog="$0"
! T=-Tps
  opts=

  for i
***************
*** 25,30 ****
--- 25,33 ----
        -Tascii|-Tlatin1)
                T=$1
                ;;
+       -t)
+               # ignore -- default is send to stdout
+               ;;
        -T*)
                # ignore other devices
                ;;
***************
*** 49,53 ****
  rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`

  # This shell script is intended for use with man, so warnings are
  # probably not wanted.  Also load nroff-style character definitions.
! exec groff -Wall -mtty-char $T $opts $rest
--- 52,56 ----
  rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`

  # This shell script is intended for use with man, so warnings are
! # probably not wanted.
! exec groff -Wall $T $opts $rest

The binaries on cb-iris.stanford.edu have these changes already made.

Paul Walmsley <ccshag@sgi1.phlab.missouri.edu> offers the following
advice for IRIX 5.x, which assumes that you have already followed
David Hinds' instructions for IRIX 4.0.x:

1. Remove the link from tbl to gtbl.

2. Rename gtroff to gtroff-exe or some other suitable name.  Note that
   if you name it something other than gtroff-exe, you must change the
   gtroff script below.

3. Install the gtroff and tbl scripts included below in place of the
   above two programs, and chmod them appropriately.

--- cut here for tbl ---
#!/bin/sh
# Shoehorn gtbl into IRIX 5.2 - Shag
# Removes the -TX from gtbl's command line - yes, I know this is a kludge

rest=`echo ${1+"$@"} | sed -e 's+-TX++'`
exec gtbl $rest
--- cut here for gtroff --
#!/bin/sh
# Shoehorn gtroff into working with IRIX 5.2 - Shag
# Translates all references for /usr/lib/tmac to /usr/local/lib/groff/tmac,
# and disables warnings - from David Hinds' code

rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
exec gtroff-exe -Wall -mtty-char $rest
--- you can stop cutting now ---

It is also possible to avoid the need for these scripts by setting
some environment variables, which are only documented in the man(1)
manpage (q.v.) in IRIX 5.2 and later.

Henry Spencer's awf ("Amazingly Workable Formatter") is written in
'awk', which we all have, and does a pretty good job, considering. It
can be FTPed from fresnel.stanford.edu:/pub/4D/.

Finally, you might be able to format them on a non-SGI machine which
does have nroff. You might need to specify the generic printer macros
with '-Tlp', i.e. 'nroff -man -Tlp foo.1 > foo'.

------------------------------

Subject:   -12- IRIX's version of top(1) doesn't let me renice or kill
                processes interactively. What to do?
Date: 10 Dec 93 00:00:01 EST

Try William LeFebvre's <phil@eecs.nwu.edu> version, which has these
capabilities. FTP it from eecs.nwu.edu:/pub/top/. One port to IRIX is
at ftp.cs.ruu.nl:/pub/SGI/top-3.1.tar.gz.

------------------------------

Subject:   -13- BUGS AND PROBLEMS
Date: 10 Dec 93 00:00:01 EST

This section discusses bugs and problems with various applications.

------------------------------

Subject:   -14- Why isn't Iris Insight working properly?
Date: 10 Dec 93 00:00:01 EST

Iris Insight 2.0 (which came on a CD included in the July/August
Pipeline) uses a different format in the .insightrc file in your home
directory. If there is an .insightrc left over from an older version
when you run Insight 2.0, it may emit error messages or not work in
various ways. Just delete the old .insightrc and restart Insight.

Greg Ferguson <gferg@hoop.timonium.sgi.com> keeps a list of other
problems with Insight, which can be found at
viz.tamu.edu:/pub/sgi/lists/insight-problems.

------------------------------

Subject:   -15- Why don't the arrow keys work in vi?
Date: 04 May 94 00:00:01 EST

Arrow keys send more than one character, and vi can misinterpret them
as multiple single-character commands on slow connections. Increase
vi's patience by putting the command 'set timeout=400' (or a larger or
smaller number to your taste) in the file ~/.exrc or the EXINIT
environment variable.  See also the ex(1) and vi(1) manpages.

Or use h, j, k and l. Or zip or Emacs.

Incidentally, an article in the March/April 1994 Pipeline discusses a
variety of 'vi' tips and tricks.

------------------------------

Subject:   -16- How can I tell application X about my screen size?
Date: 10 Dec 93 00:00:01 EST

IRIX does not have 'stty rows n' or 'stty columns n'. Use 'setenv LINES
n' and 'setenv COLUMS n' respectively.

------------------------------

Subject:   -17- Why does ksh lock up if one's home directory is NFS-
                mounted?
Date: 21 Jan 94 00:00:01 EST

Sez Dave Olson <olson@sgi.com>:
Since all ksh sessions for the same user write to the same file, ksh
uses locking on the history file.  Locking over NFS is problematic at
best.  There is an environment variable (HISTFILE) that can be set to
specify where the history file lives; I would suggest putting it
somewhere on the local disk.

------------------------------

Subject:   -18- Why can't I 'talk' to Suns?
Date: 16 Mar 94 00:00:01 EST

SGI, and most Unix vendors, use the 4.3BSD talk protocol, while Sun
still uses the 4.2BSD talk protocol. The fault is Sun's, not SGI's.
Look in thor.ece.uc.edu:/pub/sun-faq/ for Sun-compatible versions of
'new talk' (ntalk.tar.Z) and 'ytalk', which speaks both old and new
'talk' (ytalk-3.0.1.tar.gz).

You could also run 'ytalk' on your SGI. Get it from
ftp.uu.net:/usenet/comp.sources.unix/volume27/ytalk-3.0/.

------------------------------

Subject:   -19- How can I change what the keys on my keyboard do?
Date: 04 May 94 00:00:01 EST

Use 'xmodmap'. The manpage describes how to swap control and caps-
lock, which is the most common use. 'xwsh' and 'tcsh' also have key-
binding facilities, described in their manpages; consider these if you
want to change key meanings only in 'xwsh' windows or only in 'tcsh'.

------------------------------

Subject:   -20- Where did 'zip's file-browsing gizmo go in IRIX 5.x?
Date: 15 May 94 00:00:01 EST

'zip' uses Showcase's file-browsing gizmo,
/usr/lib/showcase/browsegizmo.  In IRIX 5.x, Showcase doesn't use or
include that gizmo.  Copy it from a 4.0.x system and put it in
/usr/lib/showcase; 'zip' will be able to use it and IRIX 5.x Showcase
won't know or care.

Oddly, Showcase 3.0 for IRIX 4.0.x, which came on a CD-ROM in the
July/August 1993 Pipeline, includes but does not use the browsegizmo.

------------------------------

Subject:   -21- Why does 'man -k' repeat itself in IRIX 5.2?
Date: 12 Jun 94 00:00:01 EST

'man -k' looks for two whatis databases, the default and one in a
directory specified by the environment variable LANG. If LANG is set
but empty, the paths come out the same and you see the same database
twice. Fix the problem by doing 'unsetenv LANG' or 'setenv'ing it to
something sensible.

------------------------------

Subject:   -22- COMPILERS AND PROGRAMMING
Date: 10 Dec 93 00:00:01 EST

This section discusses compilers and programming issues.  Check the
graphics FAQ for graphics programming issues, and the Inventor and
Performer FAQs for Inventor and Performer issues.

------------------------------

Subject:   -23- What are the correct versions of the Irix Development
                Option (IDO) and Fortran for current versions of IRIX?
Date: 12 Jun 94 00:00:01 EST

If you're using IRIX 4.0.x, you should be using IDO 4.1.1.  It
includes C 3.10.1 and the 3.12 back-end (the part of the compiler
which actually produces the executable; 3.12 is the number you see
when you use the 'file' command on an executable). The previous
version was badly buggy; upgrade ASAP.

IRIX 5.2 needs IDO 5.2, which includes C 3.18. Executables produced by
the IRIX 5.x back-end don't show a version number with 'file'.

Each version of IDO has a corresponding version of Fortran, and they
MUST be used together. IDO 4.1.1 needs Fortran 3.5.1 and IDO 5.2 needs
Fortran 4.0.1. This is true for other languages as well, but only
Fortran has confused enough people to have its version numbers here.

------------------------------

Subject:   -24- Why doesn't my non-ANSI C program compile under IRIX
                4.0.x?
Date: 14 May 94 00:00:01 EST

SGI's C compiler is ANSI C by default in IRIX 4.0.x. Use the '-cckr'
option to compile K&R C. You can do this most easily by setting the
environment variable SGI_CC to "-cckr" or by editing the application's
Makefile, often by adding "-cckr" to the CFLAGS variable.

A related problem is that Makefiles generated by 'imake' most often
use 'cc -cckr -prototypes'; missing or incorrect prototypes usually
just generate pages of warnings but may cause an unrecoverable error.
You can often work around this by removing "-prototypes" from the line
where it appears in the Makefile (not the Imakefile).

------------------------------

Subject:   -25- Why is 'make' complaining about syntax errors that I
                can't find?
Date: 26 May 94 00:00:01 EST

Two possibilities:

- SGI's 'make' sends shell commands to your shell (specified in the
  SHELL environment variable), while every other 'make' in the world
  uses /bin/sh by default. Put the line "SHELL=/bin/sh" at the top of
  a Makefile to make SGI's 'make' use /bin/sh.

- Dependency lines in your Makefile may begin with spaces.  Some
  'make's accept spaces; SGI's requires tabs.

------------------------------

Subject:   -26- Where's edge in IRIX 5.x? What can I use instead?
Date: 16 Jun 94 00:00:01 EST

SGI does not include edge with IRIX 5.x. When asked for substitutes,
SGI will direct you to their CASEVision debugger, which costs extra.
An oft-mentioned free graphical debugger is 'xdbx'; you can find the
original source in ftp.x.org:/R5contrib/, a patch to make it work on
IRIX 4.0.x in viz.tamu.edu:/pub/sgi/software/xdbx/xdbx.sgi.patch and
patched versions for IRIX 4.0.x and 5.x in
swedishchef.lerc.nasa.gov:/programs/X/. An 'inst'-installable binary
for IRIX 5.x only is in ftp.sgi.com:~ftp/sgi/xdbx/.

------------------------------

Subject:   -27- Can I use dynamic shared objects in IRIX?
Date: 07 May 93 00:00:01 EST

IRIX 5.x supports SVR4-style dynamic shared objects. IRIX 4.0.x does
not, but Jack Jansen <jack@cwi.nl> has written a package to do it
anyway. Get the file ftp.cwi.nl:/pub/dl-1.3.tar.Z by anonymous FTP.

------------------------------

Subject:   -28- How can I tell which shared objects my executable uses?
Date: 25 Apr 94 00:00:01 EST

Use 'odump -Lv' for COFF format executables (under IRIX 4.0.x, or 5.x using
the irix4 compatibility stuff) and 'elfdump -Dl' for ELF format executables
(IRIX 5.x only). Both are in the dev.cmplrs_sw.util subsystem.

------------------------------

Subject:   -29- How can I generate IRIX 4.0.x-compatible executables
                under IRIX 5.x?
Date: 10 Dec 93 00:00:01 EST

Strictly speaking, you can't. Many things changed in IRIX 5.x. You can,
however generate executables in COFF (IRIX 4.0.x) format instead of ELF
(IRIX 5.x) format, and these will often work on IRIX 4.0.x if they
don't use complex things like multiprocessing. The manual and release
notes describe how, and here's a summary:

1) Make sure you've installed all of the appropriate irix4
   compatibility subsystems. These include irix4_eoe, irix4_dev,
   irix4_c and others for Motif, Inventor, etc.

2) setenv SGI_IRIX4 1

3) If your source uses explicit paths to headers, libraries, etc.,
   change them to point to the irix4 versions.

4) Use cc or make or whatever as you normally would.

------------------------------

Subject:   -30- How can I convert IRIX 4.0.x executables to IRIX 5.x?
Date: 17 Jan 94 00:00:01 EST

Sez Jay McCauley <mccauley@sgi.com>:
IRIX does not and cannot have a coff2elf (actually, it's 'cof2elf')
converter.  The COFF (actually, ECOFF) to ELF transition was also the
transition to the use of Expanded Fundamental Types (EFT), an
SVR4-ism.  EFT enlarges a number of basic data types, finally casting
off the last vestages of the PDP-11.  So, structures built in an EFT
world would have their members at different offsets than they would in
a pre-EFT (e.g. IRIX 4.x) world. The operating system uses the fact
that an executable is in ELF to trigger the use of EFT-based strucures
for input and output.  So, even if you had a program like coff2elf,
the resulting transformed executable would not operate correctly for
almost any interesting case.  Trivial programs that don't have any
system calls which pass in structures or get structures back from the
OS could theoretically work, but these fall into the "uninteresting"
class.

------------------------------

Subject: ! -31- Why does malloc() never return NULL?
Date: 05 Jul 94 00:00:01 EST

Virtual memory is effectively infinitely large in IRIX 4.0.x, and it
can be configured to be so in IRIX 5.x. malloc() never returns NULL
because requests are always granted. The admin FAQ gives further
background, and tells how to configure your system to limit virtual
memory to physical memory and physical swap space.

------------------------------

Subject:   -32- Where's CHILD_MAX?
Date: 21 Jan 94 00:00:01 EST

/usr/include/limits.h has a bug in all versions of IRIX 4.0.5. The
definition of ARG_MAX on line 92 is missing a closing comment, so the
definition of CHILD_MAX on line 93 is ignored. Line 92

#define	ARG_MAX		5120 		/* max length of arguments to exec 

should look like this:

#define	ARG_MAX		5120 		/* max length of arguments to exec */

------------------------------

Subject:   -33- Where did the system header files go after I installed
                IDO 4.1.1?
Date: 14 May 94 00:00:01 EST

Some header files were in both the dev.hdr.lib subsystem (which is
part of IDO) and eoe1.sw.unix (which is part of basic IRIX) in IRIX
4.0.5, but are not in dev.hdr.lib in IDO 4.1 and 4.1.1. If one removes
an older IDO then installs IDO 4.1(.1), these headers will disappear.
The solution is to reinstall eoe1.sw.unix. Affected headers are all in
/usr/include/sys, and include domain.h, fddi.h, if_imf.h, if_ipg.h,
if_mf.h, if_sl.h, llc.h, mbuf.h, protosw.h, smt.h, socket.h,
socketvar.h, tcp-param.h, uio.h, un.h, and unpcb.h.

------------------------------

Subject:   -34- What prototypes are missing in IRIX 4.0.x and 5.x?
Date: 03 Apr 94 00:00:01 EST

Kevin Russo <russo@rudedog.nrl.navy.mil> has compiled a list, which
you can FTP from
viz.tamu.edu:/pub/sgi/software/prototypes/missing-protos.shar.

------------------------------

Subject:   -35- Why are some static libraries missing in IRIX 5.x?
Date: 05 Feb 94 00:00:01 EST

IRIX 5.x does not have static (non-shared) versions of some libraries,
notably libX11.a. This is only a problem if one needs to name one
explicitly in a linking statement; just use the shared version (in this
case, libX11.so.1).

But *why* are they missing? 1) The shared versions (but not the static
versions) are specified in the MIPS ABI, with which IRIX 5.x complies.
2) SGI can tune system-dependent aspects of the libraries without
losing binary compatibility between different SGI machines and with
other MIPS ABI-compliant platforms. 2) The library interfaces are
stable, so there is no need to link them statically. 3) It forces us
all to use the shared versions with the attendant benefits: less disk
and memory usage and better portability.

------------------------------

Subject:   -36- Where are the audio, CD and DAT libraries in IRIX 5.x?
Date: 05 Mar 94 00:00:01 EST

In IRIX 5.x, they (and the associated headers, sample code, etc.) have
moved to the extra-cost Digital Media Development option. Sorry.

------------------------------

Subject:   -37- Where are the regcmp and regex functions?
Date: 14 May 94 00:00:01 EST

In the libPW.a library. Add '-lPW' to your linking command.

------------------------------

Subject:   -38- Why doesn't application X understand NIS (Yellow Pages)?
Date: 19 Dec 93 00:00:01 EST

If you run NIS (aka Yellow Pages), you need to link programs which
access files served by NIS with -lsun. The functions in libc.a which
deal with these files are not NIS-aware; the NIS versions are in
libsun.a. Using libsun.a usually means adding '-lsun' to the variable
LIBS or LDFLAGS in one's Makefile. If '-lc' or '-lc_s' (libc_s.a is the
shared version of libc.a) is given explicitly, '-lsun' must precede it.

This is only true for IRIX 4.0.x; IRIX 5.x's libc.a is NIS-aware.

------------------------------

Subject:   -39- Why can't my networking application resolve hostnames in
                IRIX 5.x?
Date: 14 May 94 00:00:01 EST

The resolv.conf file, which tells IRIX how to resolve hostnames, is in
/usr/etc in IRIX 4.0.x but /etc in IRIX 5.x. Applications compiled
under IRIX 4.0.x and moved to a 5.x system will not be able to find
it.  The easiest fix is to do 'ln -s /etc/resolv.conf /usr/etc', and
the best fix is to recompile. See 'man 4 resolv.conf'.

------------------------------

Subject:   -40- PORTING
Date: 10 Dec 93 00:00:01 EST

This section discusses problems with porting software from other
systems to SGIs. Be sure to look through the previous section and the
programming part of the graphics FAQ too.

------------------------------

Subject:   -41- How can I make the 'install' program work like BSD
                'install'?
Date: 16 Jun 93 00:00:01 EST

The BSD and System V versions of the 'install' command are
incompatible; the BSD version is most often used by Makefiles. IRIX
provides both the System V version (/etc/install) and the BSD version
(/usr/bin/X11/bsdinst.sh). SGI's 'imake' defines INSTALL as
/usr/bin/X11/bsdinst.sh, and the Install* rules use that definition, so
Imakefile-generated Makefiles will use the BSD version.

Michael Joosten <joost@ori.cadlab.de> points out that you can also use
GNU install (available from any GNU archive, e.g.
prep.ai.mit.edu:/pub/gnu/), which emulates the BSD version.  Unlike
/usr/bin/X11/bsdinst.sh, it has a manpage.  It also may be better
debugged; SGI's version reportedly mishandles '-o' and installs
multiple files into a single directory.

------------------------------

Subject:   -42- Where's 'ranlib'?
Date: 16 Sep 93 00:00:01 EST

IRIX doesn't need it. Read the description of the 's' option in the
'ar' manpage. When the Makefile for a program you're porting wants
ranlib, delete the ranlib command, substitute 'true' or put a little
shell script in your PATH to fake it.

------------------------------

Subject:   -43- Why does GNU Emacs not compile, or compile but not run?
Date: 17 Jun 94 00:00:01 EST

You probably have an old version.

Emacs 18.59 is the last release of Emacs version 18. It builds and runs
correctly under IRIX 4.0.x. Some earlier versions failed to compile
(because cc now needs -cckr for K&R C compatibility) or failed to run
when stripped (because of object file format changes). For the latter
reason, the file unexmips.c in some versions of Epoch and Lucid Emacs
should be replaced with the same-named file from the GNU Emacs 18.59
distribution.

Karsten Kuenne <kuenne@desy.de> has patched Emacs 18.59 to work with
IRIX 5.0's new object file format. The patches are at
ftp.desy.de:/pub/gnu/emacs/emacs-irix5.0-patches.

Emacs 19.25 is the most recent release of Emacs version 19 at this
writing; it builds and runs correctly under IRIX 4.0.x and 5.x with
recent compilers (IDO 4.1.1 or newer). Be sure to read about Iris
quirks in etc/MACHINES. If you want to use dbx on Emacs 19.25, you
need viz.tamu.edu:/pub/sgi/software/emacs/unexelfsgi.c.patch.

See also "Where can I get software already compiled for SGIs?" above.

------------------------------

Subject:   -44- What do I need to do to build gcc/g++?
Date: 17 Jun 94 00:00:01 EST

Recent versions of gcc build reliably on IRIX 4.0.x and 5.x without
much difficulty. Just read the INSTALL document and follow the
directions.  A few hints:

- You need the headers and runtime libraries from SGI's extra-cost
  development option (IDO) to compile gcc. Of course if you buy IDO
  you'll get SGI's compiler anyway; this is comp.sys.sgi.*'s most
  popular Catch-22. However, you can get binaries from someone who
  does have IDO; see "Where can I get software already compiled for
  SGIs?" above.

- Don't forget to install the dev.cmplrs_hdr.internal subsystem, which
  contains needed headers and is not installed by default.

- You'll need up to 80Mb of free disk space. You can manage with as
  little as 50Mb by compiling without "-g", stripping binaries and
  pruning after each build stage.

_ If you are using IDO 4.1, use the 'mips-sgi-irix4loser'
  configuration, which disables optimization to avoid an assembler bug,
  or use the 'noasmopt' flag to gcc. This is not necessary with IDO
  4.1.1.

- If you are using IDO 5.1, don't use GNU's binutils ('ar' and 'ld') to
  build gcc. Use the IRIX versions.

- Under IRIX 5.x, add '-save-temps' to CFLAGS when building with the
  stage1 and stage2 compilers to eliminate problems in "make compare",
  edit the configure script to set "use_collect2" to "yes" for the
  "irix5*" case and be sure to recompile libg++ rather than using an
  IRIX 4.0.x binary.

- gcc's '-g' option (include debugging info) does not work on IRIX 5.x.
  This is not a bug, but an absence of support. '-g' will work when
  someone explicitly writes ELF support into gcc.

See also "Where can I get software already compiled for SGIs?" above.

------------------------------

Subject: + -45- Is there an SGI-compatible version of XView?
Date: 01 Jul 94 00:00:01 EST

For IRIX 4.0.x, look in swedishchef.lerc.nasa.gov:/libraries/XView3/.
For IRIX 5.x, look in
wuarchive.wustl.edu:/graphics/graphics/sgi-stuff/XView/xview3/irix5/.
A copy of the patches used to create the IRIX 5.x version is in
viz.tamu.edu:/pub/sgi/software/xview/.

------------------------------

End of sgi/faq/apps Digest
******************************
-- 
The SGI FAQ group                                sgi-faq@viz.tamu.edu
Finger us for info on the SGI FAQs, or look in viz.tamu.edu:/pub/sgi.
