Problems in building and installing DDD                          -*- text -*-
***************************************

This file lists problems encountered when building and installing DDD
in various environments.

Table of Contents
=================

    * Ada
    * AIX
    * DEC
    * FreeBSD
    * GCC
      + GCC 3.0 prereleases
      + GCC and libg++
    * HP-UX
    * LessTif
    * Linux
    * OSF/1
    * Solaris 2.x
    * SunOS
      + SunOS 4.1 and X11R6
      + SunOS 4.1 and Sun C++
    * Unixware
    * X11R4

ADA
===

Reported by: Rick Flower <Rick.Flower@trw.com>

    To debug Ada programs created with Gnat, you need a set of GDB
    patches.  The current best set of patches for GDB 4.16 can be
    found at `ftp://cs.nyu.edu/pub/gnat/gdb'.


AIX
===

Reported by: jensen@Adobe.COM (Freddy Jensen)

To compile DDD 3.3 for AIX 4.3.3:

     I had to set these two flags before running configure:

     setenv CPPFLAGS "-I/usr/shared/gcc_2.95/aix_4.3/lib/gcc-lib/rs6000-ibm-aix4.3.2.0/2.95.2/include"
     setenv LDFLAGS  "-Wl,-bbigtoc"

     After running configure I had to edit ddd/config.h and 
     change this:

     From: #define HAVE_TCDRAIN 1
     To:   #define HAVE_TCDRAIN 0

     Otherwise I would get tcdrain() undefined. I tried to link
     in libcurses.a explicitly, but that did not work. I am not
     sure exactly what the effect of not having tcdrain() is,
     although ddd seems to run just fine without it.


Reported by: Andreas Zeller <zeller@gnu.org>

    Some EGCS versions on AIX have trouble compiling DDD.  If you get
    internal compiler errors, try compiling the affected modules
    without optimization.  Here are the commands:

	$ cd TOPLEVEL        # Top of DDD distribution
	$ make -k            # Build all with optimization
	$ cd ddd
	$ make -k CXXOPT=    # Build remainder of DDD without optimization


Reported by: Brian Cameron <bcameron@tuc.com>

    When compiling DDD using EGCS, you may get a conflict between
    <math.h> and the <exception> header.  As a workaround, create a
    local `math.h' file that contains:

	#define exception math_exception
	#include_next <math.h>
	#undef math_exception


Reported by: Andreas Zeller <zeller@gnu.org>

    Because of a limitation in the AIX linker, linking of DDD may stop
    with the message "TOC overflow".  The AIX Table of Contents (TOC)
    by default has only 16,384 entries; DDD has far more symbols.

    If you use EGCS 1.1 or GCC 2.8.0 or later, `configure' should
    already have fixed this for you.  In other configurations, there
    are three ways to fix this problem:

    1. Add the flag `-Wl,-bbigtoc' to the `LDFLAGS' definition in
       `ddd/Makefile' and retype `make'.  This makes the AIX linker
       use a larger TOC.

    2. If this does not work, add the flags `-mno-fp-in-toc' and
       `-mno-sum-in-toc' to the `CXXFLAGS' definition in
       `ddd/Makefile' and recompile all.  Each of these options causes
       GCC to produce very slightly slower and larger code at the
       expense of conserving TOC space.

    3. If this still does not work, add the flag `-mminimal-toc' to
       the `CXXFLAGS' definition in `ddd/Makefile' and recompile all.
       When you specify this option, GCC will produce code that is
       slower and larger but which uses extremely little TOC space.


Reported by:	Jacek M. Holeczek <holeczek@us.edu.pl>

    This "howto" describes the way one can get ddd-3.0 compiled on AIX 4.1
    using standard AIX utilities: C Set ++ for AIX Compiler (xlC), lex
    and yacc. The same procedure should be valid on AIX 4.2 and AIX 3.2.

    First unpack the source distribution and go to the ddd-3.0 subdirectory.

    Then set some environment variables:
            export CC=xlC
            export CXX=xlC
            export CFLAGS="-O"
            export CXXFLAGS="-O"
            export LDFLAGS="-O"
            unset LIBPATH

    If you decide NOT to use gnu gcc, flex, and bison you may also
    need to remove the /usr/local/bin (or any other subdirectory where
    you keep gnu executables) from the PATH environment variable (so
    that the ./configure script will not find them, and it will find
    standard AIX xlC, lex, and yacc):
            export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin

    Then run configure:
            ./configure -v

    On AIX 3.2 you might need to add a line in ./ddd/config.h in form:
            #define HAVE_GETHOSTNAME_DECL 1
    (On AIX 4.1, AIX 4.2 you should have it already defined by ./configure.)

    If you decide NOT to use gnu flex and gnu bison and use standard
    AIX lex and yacc instead, you have to remove some files:

            rm ./ddd/vsl-gramma.C ./ddd/vsl-gramma.h
            rm ./ddd/vsl-lex.C
            rm ./ddd/rxscan.C

    Now run "make clean" and then "make".

    If you decided to use standard AIX lex and yacc the make will
    complain (while working on ./ddd/vsl-lex.*, ./ddd/vsl-gramma.*,
    ./ddd/rxscan.*):
            lextoC: cannot determine lex type -- reverting to flex
            yacctoC: cannot determine yaccpar type -- reverting to bison
    You can safely ignore these messages (they come from ./ddd/lextoC
    and ./ddd/yacctoC and mean that they have no AIX lex and yacc
    specific entries). Later on, the make will crash while compiling 
    ./ddd/VSLRead.C. You have to edit ./ddd/vsl-gramma.C (after the
    ./ddd/vsl-gramma.C is newly created by yacc) and modify the
    declaration of vslerror:
            extern "C" void vslerror(char *s);       // added "C"

    and the definition of vslparse:
            #ifdef __cplusplus
            // extern "C"                           // commented extern "C"
            #endif /* __cplusplus */
            int
            vslparse()

    In case you created ./ddd/rxscan.C with AIX 4.1 lex (from the
    ./ddd/rxscan.L) you additionally need to modify one line in the
    beginning of this file increasing YYLMAX from 200 to 8192 (this is
    a result of a bug in AIX 4.1 lex, most probably not present on
    both AIX 3.2 and AIX 4.2 - note here that you will not get any
    compile time errors if you do not modify it, but your executable
    will be broken):

            # define YYLMAX 8192

    then run "make" again.  You should get no other warnings/errors except:
      - when compiling ./ddd/mainloop.C:
	68  1500-010: (W) WARNING in ddd_main_loop(): Infinite loop.  
            Program may not stop.
        ( this is intentional, you can safely ignore it ).
    Finally run "make strip" and "make install".  Have fun ...

DEC
===

Reported by: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>

    When using DEC's C++ compiler 6.0, more than 99% of the warnings I
    get *normally* when building ddd are complaints about the X11R6
    header files not explicitly using `int' as a return type.  To make
    it easier to see the other warnings, I've added

	`-msg_disable nonstd_implicit_int'

    to the `CXXFLAGS' before building this time.


Reported by: Pascal Quesseveur <abak@hol.fr>

    I have encountered some problems when compiling ddd on DEC Alpha 
    station running Digital UNIX 4.0 with gcc version 2.7.2.2:

    ddd/config.h created by configure is wrong: symbol 
    HAVE_GETHOSTNAME_DECL must be defined in config.h since include file 
    /usr/include/unistd.h contains a prototype for gethostname. This 
    prototype is
        int gethostname(char *, size_t)
    when symbol _XOPEN_SOURCE_EXTENDED is defined and
        int gethostname (char *, int)
    in the other cases. There is a conflict with the prototype defined in
    ddd/hostname.C.

    The `ddd/Makefile' created by configure is wrong: variables
    LIBNSL, NON_XLIBS and LIBGEN have incorrect values - the values
    must be null to link ddd correctly.

Jim Tarrant <jtarrant@inri.co.uk> reports:

    To compile DDD-3.0 on our Digital Unix 4.0D workstations with GCC
    2.8.1, I had to turn optimization off while building (use `make
    CXXOPT=-DNDEBUG' to build DDD).


FreeBSD
=======

Reported by:  taob@gate.sinica.edu.tw (Brian Tao)

    Use `gmake' (GNU make) instead of `make' for building DDD.



GCC
===

GCC 3.0 prereleases
-------------------

    Building DDD with GCC 3.0 prerelases on Intel/Linux currently
    leads to duplicate template instantiations.  Recompiling the
    conflicting objects without optimization should make the problem
    go away.  Use something like:

       $ rm buttons.o DataDisp.o settings.o BreakPoint.o ddd.o session.o
       $ make CXXOPT=

    to rebuild DDD.


GCC and LIBG++
--------------

    If you have multiple copies of gcc and/or libg++ installed, be
    sure that the referenced versions match each other.  This is a
    common source for various problems.


HP-UX
=====

Reported by: jensen@Adobe.COM (Freddy Jensen)

     To compile DDD 3.3 for HP-UX 10.20:

     After running configure I had to edit ddd/Makefile and do this:

     1. Change LIBTERMCAP

        From: LIBTERMCAP = -lcurses
        To:   LIBTERMCAP = /usr/lib/libHcurses.a

     2. Change LIBXM

        From: LIBXM = -lXm
        To:   LIBXM = /usr/lib/Motif1.2_R6/libXm.a
    

Reported by:  (various)

    Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> reports that he
    has successfully built DDD-3.2 with HPs native compilers "cc" and
    "aCC" under HP-UX 10.20 without GNU cc.  His configure line was:

    CC=cc CXX=aCC F77=fort77 YACC=yacc LEX=lex CFLAGS="+O2 -Ae +DAportable" \
     CXXFLAGS="+O2 +DAportable" FFLAGS="+O2 +DAportable" \
     CPPFLAGS="-I/usr/local/include" CXXCPPFLAGS="-I/usr/local/include" \
     LDFLAGS="-L/usr/local/lib" \
     ./configure \
      --x-includes /usr/include/X11R6 --x-libraries /usr/lib/X11R6 \
      --without-athena --with-readline-libraries

    Hints:
    * The "+DAportable" flag compiles code that will also run on older
      machines, it has no other influence.
    * I do have libXpm and readline as shared libraries under /usr/local,
      appropriate packages (binary distributions may install at different
      locations) can be found at http://hpux.connect.org.uk/.
    * All libraries, especially Motif, are used as shared libs, statically
      linking is not necessary in this setup.
      (Athena Widgets are only available as ".a" static libraries, so I decided
      against include them.)
    * IMPORTANT: I just installed the latest aCC patch, released 
      around yesterday (2000/02/02)!!! Its number is PHSS_20959.
      Without it, linking failed with
        /usr/ccs/bin/ld: Unsatisfied symbols:
       static_r (data)

    Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> adds that when
    using GCC, you _must_ link in Motif(?) statically with
    /usr/lib/libXm.a instead of the dynamic version obtained by
    specifying -lXm.

    Joseph H. Buehler <jhpb@sarto.gaithersburg.md.us> reports that gcc
    2.95 on HP-UX 11.00 crashes with an internal error, turning off
    -O2 eliminates the problem.  However, even when gcc 2.95 builds
    DDD, it core dumps immediately at start.

    On HP-UX 10.01, if you cannot link DDD or get an illegal
    instruction at start-up, this is due to some bugs in the X11 and
    Motif libraries as shipped by HP.  Mark Harig <markh@landmark.com>
    says that some patches to X11 and Motif libraries are required to
    build DDD on HP-UX 10.01.  You can find these patches at:
    `ftp://us-support.external.hp.com/hp-ux_patches/'; he found the
    patches he needed in the directory `s700_800/10.X'.

    In that directory are the files:

       PHSS_10789  (the patch for S700/S800, HP-UX 10.20)
       PHSS_10789.txt (description of the patch and instructions)  

    You might also need patch PHSS_10688, PHSS_9810, PHSS_9811,
    PHSS_9813, and PHSS_9815.  Because the patch file names change as
    new patches are created, you should look in this directory for the
    file 'catalog', which lists the patch file names along with brief
    descriptions.

    According to some DDD users, linking problems on HP-UX can be
    solved by using patched versions of the GNU binutils (such as ld
    and ar) instead of the HP-UX binutils.  For more information on
    HP-PA versions of the GNU tools, see
    `ftp://jaguar.cs.utah.edu/dist/pagnutools.html'.

    Frank Hofmann <hofmann@wpax01.physik.uni-wuerzburg.de> fixed an
    `Invalid loader fixup for symbol _XtInheritTranslations,
    xmPrimitiveClassRec' by replacing `XtInheritTranslations' by
    `NULL' in `GraphEdit.C' and `ScrolledGE.C' and replacing
    `xmPrimitiveClassRec' with `XmPrimitiveWidgetClass' in
    `GraphEdit.C'.

    Roy Dragseth <royd@math.uit.no> says that you must link against
    the X11R6 version of Xmu, the X11R4 version gave an error on
    _XEditResCheckMessages being undefined at the link stage.

    Ivar Ruyter <ivarr@troll.hz.kfa-juelich.de> states: Build
    everything statically and add `-l:libdld.sl' to the LIBS line in
    the Makefile, voila you have a nice new Christmas Present.
    This also worked for Hal Manuel <hemanuel@esy.com>.

    Roy Dragseth <royd@math.uit.no> adds:
    Statically link as stated above. Actually it is only
    neccessary to statically link libXm, so if you exchange 
            -L/usr/lib/Motif1.2 -lXm
    with
            /usr/lib/Motif1.2/libXm.a
    in the link step DDD works fine. This might be useful for people
    who don't have the gnu linker. It also makes the executable ~1Mb
    smaller than when you add -l:libdld.sl to the link step.

    Lassi A. Tuura <Lassi.Tuura@cern.ch> suggests to use the option
    `-mmillicode-long-calls' when compiling.  It should permit fixes
    into shared library calls (these errors only occur with shared
    libraries).

LessTif
=======
    
    To use DDD with LessTif, get a recent LessTif release from
    `http://www.lesstif.org'.  Be sure to apply the patches found in
    the `patches/' subdirectory.

    With DDD 3.1.6 and LessTif 0.88.9, the following problems are
    currently known:

    * Resizing the plot window does not work properly.

    See the DDD WWW page for further issues and patches.

Linux
=====

Intel
-----

Reported by: Jim Van Zandt <jrv@vanzandt.mv.com>

     Under slackware 3.1, the file permissions in `/dev/ptyp?' do not
     allow for DDD <-> GDB interaction.  I did "cd /dev; rm pty*;
     MAKEDEV ptyp ptyq ptys ptyt", the former permissions and device
     numbers were restored, and DDD worked.
     [Can anyone tell me how to circumvent this within DDD?  - AZ]


Reported by:  Bernie Borenstein <c372321@hc1056.mdc.com>

     Make sure you use libc version 4.6.27 or later.  Otherwise some
     Motif versions will cause DDD to crash as soon as `Open
     Program...' is selected (or any other file selection dialog is
     opened).  Linux Motif's are very sensitive about this.

     As an intermediate workaround, use the GDB `file' and `core'
     commands; to open a specific source, use the GDB `info file
     FUNCTION' command, where FUNCTION is a function defined in that
     source file.


Alpha
-----

Reported by:  J.H.M. Dassen <jdassen@wi.leidenuniv.nl>

    The kernel headers before Linux 2.1.61 and 2.0.32 don't work
    correctly with glibc.  Compiling C programs is possible in most
    cases but C++ programs have (due to the change of the name lookups
    for `struct's) problems.  One prominent example is `struct
    fd_set'.
     
    There might be some problems left but 2.1.61/2.0.32 fix most of
    the known ones.  See the BUGS file for other known problems.


Pmac
----

Reported by:  Ryan Ware <ware@shocking.com>

    I just wanted to let you know that (unlike previous versions of
    DDD) 2.99 compiles almost straight out of the box for linux-pmac.
    The only thing I had to change was the optimization level to O1.
    O2 broke the compiler.  It looks and runs great.  Thanks.  I look
    forward to many hours of using it.


OSF/1
=====

Reported by:  Marc Mengel <mengel@fnal.gov>

    On our OSF1 V3.2 machine, one has to turn of -g, or the 
    assembler chokes when compiling ddd.C.


Solaris 2.x
===========

Reported by: Joe VanAndel <vanandel@ucar.edu>

    When compiling for Solaris (SPARC) with X11R6.1 on Solaris 2.5.1, 
    LDFLAGS='-lICE -lSM -lsocket' ./configure  <configure_flags>
    
    so that all the necessary X libraries are linked in.

Reported by:  Matthias Klose <doko@cs.tu-berlin.de>

    If you configure DDD in Solaris with gcc and you have installed
    the libg++/libstdc++ libraries as shared libraries, you may try to
    run configure with LDFLAGS set to -R<prefix of libstdc++>/lib. If
    libstdc++/libg++ are installed in /usr/xyz, call configure with

	LDFLAGS=-R/usr/xyz/lib configure  <configure flags ...>

Reported by:  Blair Zajac <blair@olympia.gps.caltech.edu>

    When using Sun cc to compile `libiberty' as shipped with DDD, change
    `extern char *__builtin_alloca();' to `extern void
    *__builtin_alloca();' in `alloca-norm.h' to get the code to compile.
    This does not happen with GCC.

SunOS
=====

SunOS 4.1 and X11R6
-------------------

Reported by:  dmitzel@everest.hitc.com (Danny J. Mitzel) and
    doko@cs.tu-berlin.de (Matthias Klose)

    Using certain Motif and Athena libraries may cause
    `_vendorShellWidgetClass' to be defined twice.  A possible
    workaround is to configure DDD to run without Athena widgets
    (i.e. in `config.h', undefine `HAVE_ATHENA_WIDGETS' and remove the
    -lXaw flag from the `Makefile' linking command).


SunOS 4.1 and Sun C++
---------------------

Reported by:	Franklin Chen <chen@adi.com>

    On SunOS 4.1.x, with Sun C++ 4.0.1, `config.h' needs to end up with
        #define SIGHANDLERARGS int, ...
    rather than
        #define SIGHANDLERARGS int
    to avoid compile errors in a number of source files.

UNIXWARE
========

Reported by: Vinnie Shelton  <shelton@icd.teradyne.com>

    For Unixware, I have to set up `ddd/Makefile' as follows 
    after configuration:

    LINK.cc = env LD_RUN_PATH=/usr/X11R6/lib $(CXX) $(CXXBINDING) $(LDFLAGS)

X11R4
=====

Reported by:  mlj@gensym.com (Magnus Ljungberg)

    You may need to prohibit the use of the _XEditResCheckMessages()
    function by entering a line saying '#undef HAVE_X11_XMU_EDITRES_H' in
    `ddd.C'.



$Id: PROBLEMS,v 1.103 2001/04/24 17:24:38 zeller Exp $
