Compiling on your Sun Workstation
Here at CCPO we offer the following compilers:
- Sun Fortran
- Sun C Compiler
- GNU ANSI C Compiler
- GNU C++ Compiler
- IBM XL Fortran77 Compiler (ver. 2.3) with the Engineering & Scientific Subroutine Library
Sun Fortran
The Sun fortran compiler is based on the 1977 Fortran standard. In
order to use the Sun Fortran compiler you must have
/usr/local/lang in your path. If you are using the default
configuration files, this should not be a problem. The fortran
compiler can be accessed by using the f77 command. Use man
f77 for information on the fortran compiler's options.
Sun C Compiler
The Sun C Compiler is based on the Kernighan & Ritchie (K&R)
specification for C. It does not understand most ANSI conventions and
it should not be used. The GNU ANSI C Compiler is a much more robust
and portable compiler. In order to use the Sun C compiler you
must have /usr/bin in your path. If you are using the default
configuration files, this should not be a problem. The Sun C Compiler
can be accessed by using the cc command. Use man cc for
information on the Sun C compiler's options.
GNU ANSI C Compiler
The GNU ANSI C Compiler is based on the ANSI Standard C
specification. It is the most robust and portable of the two C
compilers offerred. Its use is highly recommended. In order to use the
GNU ANSI C compiler you must have /usr/local/bin in your path. If
you are using the default configuration files, this should not be a
problem. The GNU ANSI C Compiler can be accessed by using the gcc
command. Use man gcc for information on the GNU ANSI C compiler's
options.
GNU C++ Compiler
The GNU ANSI C Compiler is based roughly on the AT&T 3.0 specification
of C++. In order to use the GNU C++ compiler you must have
/usr/local/bin in your path. If you are using the default
configuration files, this should not be a problem. The GNU C++
Compiler can be accessed by using the c++ or g++
command. Use man g++ for information on the GNU C++ compiler's
options.
Include Files
On all of the above compilers you can use the -Iinclude_file_directory option to specify additional directories to search for include files. The following include directories might be of interest:
- For netCDF use -I/usr/local/netcdf/include
- For HDF use -I/usr/local/hdf/include
- For G++ use -I/usr/local/g++/lib/g++-include
- For NCAR use -I/usr/local/ncar/include/ncarg
- For X11 & Motif use -I/usr/local/X11/include
Libraries Files
On all of the above compilers you can use the -Linclude_file_directory option to specify additional directories to search for library files. In order to specify the specific library you can either put the entire library name and path on the command line or you can use the -llibrary_name (like -L/usr/local/imsl/ib/lib.sun4 -limsl) The following libraries might be of interest:
- For netCDF use -L/usr/local/netcdf/lib -lnetcdf
- For HDF use -L/usr/local/hdf/lib -ldf
- For G++ use -L/usr/local/g++/lib -lg++ -liostream
- For NCAR use -L/usr/local/ncar/lib -lncarg
- For X11 & Motif use -L/usr/local/X11/lib -lX11 -lXt -lXmu -lXm
- For IMSL use -L/usr/local/imsl/lib/lib.sun4 -limsl
Press here to return to the Compiling Menu