SUMMARY: Good C Compiler

From: Houser, Doug W. (dhouser@seta.com)
Date: Mon Aug 19 1996 - 10:45:52 CDT


thanks to all who contributed. don't know what i'd do without you.

my original message:
I am not a strong user of C on the sun, but I would like to add C program
development, debugging, and compilation to my Solaris 2.4 configuration.
Can anyone suggest a good compiler/development environment?
or do you just use the c shell to write code?

I got a number of warnings, such as "you should _never_ write scripts in
c-shell, always use bourne or
korn shells!" "The C shell is an interactive shell, using C-like
constructs. It
cannot be used to develop using the C language." "Don't dare ever use the
c-shell for writing anything longer than 3 lines! It will lead you to
hazardeous programming style, non-portability and the
greatest pain you may ever receive!"

one person said try sparcworks, one said he was using Sunpro, most said use
gnu c. a couple gave raved about Perl, especially for small programs.

most said, just use gnu c or c++ compiler cause its good, most commonly
used, and *free*
"performs almost as good as commercial grade compilers"..debugger gdb, "a
nice graphical interface to the debugger": xddd or xgdb...you will need to
get the pre-compiled version since solaris 2.x doesn't include a
compiler..."i have been quite impressed with the configuration, and would
recommend the gnu C compiler, and it's associated C++ & objective C
compilers very highly."

download sites were given

you can download it at ftp.digital.com/pub/GNU/gcc-2.7.2.tar.gz
ftp to: prep.ai.mit.edu
ftp.uu.net
ftp://prep.ai.mit.edu/pub/gnu/gcc-2.7.2.tar.gz
http://smc.vnet.net/solaris.html
BTW: you can get all the GNU stuff at ftp://gatekeeper.dec.com/pub/GNU
>> The locations of a precompiled gcc for Solaris 2.4 are:
>> Search with archie for a file called FSFgcc
>> version 2.5.6 from ftp://qiclab.scn.rain.com
>> ftp.quintus.com cd /pub/GNU
>> opcom.sun.ca's ftp site in /pub/binaries/solaris
>> http://smc.vnet.net/solaris_2.5.html

Herbert Wengatz:
(I LOVE PERL, I believe I'll soon start using it as my shell! ;) )
Perl is VERY easy to learn, if you are already familiar with tools like
"grep, awk, sed, sh,..."
and the latest perl version (3 years old, right now, so you can be sure it
works fine!),
is also object-oriented. Nontheless, it's an interpreted language, which
makes debugging very easy and it's *FAST* !!!!

It's also _very_ close to all standard UNIX-tools, so you will feel right
at home, when you use it.

Raju Krishnamurthy:
Depends on what you want to do. If you're writing a quick and dirty program
that makes a lot of systems calls (call to other programs) you'll be better
of writing it in sh or csh. If you're doing things that require pattern
matching (parsing inputs), I would go with perl or some combination of
sed and awk (however, perl is my sledgehammer of choice). I only use C
for longer programs (more than 200-300 lines) or if I'm really concerned
with performance or security. You can get GNU's compiler (gcc), debugger
(gdb) and other development tools (GNU make, flex, bison, rcs etc.) and
build the enviroment you want without much hassle. If you're looking of
a development package and don't mind paying for it, I would suggest getting
a copy of "Unix Review" magazine, or any of several Unix software
development
magazine and look through the ads.

Torsten Metzner added the following useful message:
I am also using SunPro's C and C++ compiler and debugger.
But it's not for free.
If you want to program C++, Tools++ is a nice class library for
the Sun Compiler and the newsest version CC4.0.1 can use HP's
STL implementation ( Standard Template Library, you can find it on the net )
without any problems !!
The g++ ( GNU C++ compiler ) have the STL built in, but there are some
problems.

In my opinion the gcc optimize a little bit better and it is available
on a lot of systems, but I like both development envirnments.

You should also take a look at Casper Dicks FAQ.
Here is the important part for you.

Archive-name: Solaris2/FAQ
Version: $Revision: 1.57 $
Last-Modified: $Date: 1996/06/26 13:16:41 $
Maintained-by: Casper Dik <Casper.Dik@Holland.Sun.COM>

The following is a list of questions that are frequently asked about
Solaris 2.x. You can help make it an even better-quality FAQ by writing a
short contribution or update and sending it BY EMAIL ONLY to me.
Thanks!

As you may have noted, I have switched employers and work for Sun as of
April 1st 1995. Sun is in no way responsible for the contents
of this FAQ.

The latest Solaris 2 FAQ, including an HTML version, and some other goodies
can be obtained through ftp from <ftp://ftp.fwi.uva.nl/pub/solaris>.

A new version of the FAQ is available with an index separate from
all questions, it's <http://www.fwi.uva.nl/pub/solaris/solaris2/>.
So it's a lot quicker to download. Also, an experimental FAQ search service
at <http://www.fwi.uva.nl/cgi-bin/sfaq.cgi> is now available.

The HTML <http://www.fwi.uva.nl/pub/solaris/solaris2.html> version
of the FAQ contains references to most FTP sites and files mentioned
in the FAQ. The references to ftp sites are always to either HTML
files or directories, never to binary files.

6. SOFTWARE DEVELOPMENT

6.1) Where is the C compiler or where can I get one?

    Where have you been? :-) Sun has dropped their old K&R C
    compiler, supposedly to create a market for multiple compiler
    suppliers to provide better performance and features. Here
    are some of the contenders:

    1) SunPro C: <http://www.sun.com/sunsoft/>

    SunPro, SMCC, and various distributors sell a new
    ANSI-standard C compiler on the unbundled (extra cost)
    SPARCcompiler/SPARCworks CD-ROM. There are some other nice
    tools there too, like a "make tool" and a visual diff
    (interactive diff).

    You have to license and pay per concurrent user.

    2) Apogee compilers
            <http://www.apogee.com/>

    Apogee sells C, C++, f77 and f90 compilers, mainly for SPARC.
    These compiler include the KAP preprocessors from Kuck and
    Associates.

    3) Cygnus GCC: <http://www.cygnus.com/>

    Cygnus Support and the Free Software Foundation make the GNU C
    compiler for Solaris, a free software product. Source code
    and ready-to-run binaries can be installed from the CDware CD
    (Volume 4 or 5).

    Like all GNU software, there are no restrictions on who can
    use it, how many people can use it at a time, what machines it
    can be run on, or how many copies you can install, run, give
    away, or sell.

    Cygnus sells technical support for these tools, under annual
    support contracts.

    The Cygnus distribution includes:
    gcc (ansi C compiler), gdb (good debugger), byacc (yacc repl),
    flex (lex repl), gprof, makeinfo, texindex, info, patch,
    cc (a link to gcc)

    The Cygnus compiler on uunet is starting to show its age a
    bit. If you want to compile X11R5, you can get the latest
    version of GCC in source code, from the usual places
    (prep.ai.mit.edu or one of the many mirrored copies of it).
    Build and install that compiler using the Cygnus gcc binaries.
    Or get tech support from Cygnus; they produce a new version
    for their customers every three months, and will fix any
    bug you find.

    4) Gcc.

    Gcc is available from the GNU archives in source and binary
    form. Look in a directory called sparc-sun-solaris2 for
    binaries. You need gcc 2.3.3 or later. You should not use
    GNU as or GNU ld. Make sure you run just-fixinc if you use
    a binary distribution. Better is to get a binary version and
    use that to bootstrap gcc from source.

    GNU software is available from:

            prep.ai.mit.edu:/pub/gnu
            gatekeeper.dec.com:/pub/GNU
            ftp.uu.net:/systems/gnu
            wuarchive.wustl.edu:/mirrors/gnu
            nic.funet.fi:/pub/gnu

    When you install gcc, don't make the mistake of installing
    GNU binutils or GNU libc, they are not as capable as their
    counterparts you get with Solaris 2.x.

    5) Info on other compiler vendors will be added if you send us some.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:08 CDT