Setting Up Your Development Environment on OpenSolaris
C/C++/Fortran Development Tools
The OpenSolaris OS provides many tools for C, C++, and Fortran development, including both Sun Studio and gcc. Sun Studio includes Performance Analyzer, Thread Analyzer, and the dbx debugger.
Sun Studio Software
Sun Studio software delivers a high-performance, optimizing C, C++, and Fortran developer toolchain for the OpenSolaris OS. The toolchain includes parallelizing compilers, code-level and memory debuggers, performance and thread analysis tools, OpenMP 3.0 support, as well as optimized math libraries. With Sun Studio compilers and tools, including a NetBeans-based IDE, you can more easily create, debug, and tune your applications to take advantage of the newest multicore architectures.
Sun Studio Express releases are fully functional releases that provide early access to new features in Sun Studio software.
Installing Sun Studio Software
Sun Studio software is available in OpenSolaris repositories as individual packages, which include the C, C++, and Fortran compilers and tools. For information on the Sun Studio releases currently available as OpenSolaris packages, how to install them, and where to find their documentation, see Sun Studio Software in OpenSolaris Repositories.
Sun Studio software is also available as part of a larger cluster of packages (ss-dev), which includes the latest release of the compilers and tools, and also the following additional tools: GNU automake, gmake, autoconf, and libtool; Flex Lexer; bison - a yacc replacement; make and other Solaris bundled tools; and the Mercurial, CVS, and Subversion source management systems.
After you have installed Sun Studio, the Sun Studio software is available in /opt/SunStudio/bin or /opt/SunStudioExpress/bin, and the Sun Studio man pages are available in /opt/SunStudio/man or /opt/SunStudioExpress/man. If necessary, update your PATH and MANPATH environment variables to include these paths.
Sun Studio Information Resources
See the following resources for Sun Studio information:
- Download and installation instructions
- How to Use the DLight Tool on a Sun Studio Project
- How to Use the NetBeans DTrace GUI Plug-in
- Using DTrace with Sun Studio Tools to Understand, Analyze, Debug, and Enhance Complex Applications
- Using DTrace to Demystify Watchpoints in the Sun Studio dbx Debugger
- Sun Studio Documentation Center on sun.com/documentation
- Sun Studio Technical Articles
- docs.sun.com
- Sun Studio Compilers and Tools
Sign on to the Sun Studio Forums to post questions to Sun engineering and the community.
GCC Tools
The OpenSolaris initial installation includes the GCC runtime libraries SUNWgccruntime. You might want to install the GNU Tools Development cluster (gcc-dev) or the GNU C compiler (SUNWgcc).
The gcc-dev package includes GNU gcc, gdb, automake, gmake, autoconf, and libtool; Flex Lexer; bison - a yacc replacement; make and other Solaris bundled tools; and the Mercurial, CVS, and Subversion source management systems.
To download and install the GNU Tools Development cluster by using the OpenSolaris Package Manager:
- Select System > Administration > Package Manager from the desktop menu bar on your OpenSolaris system.
- To find all the GCC packages, do one of the following steps:
- Select a Repository to search, type gcc in the Search field, and press the Enter key.
- Select All Repositories from the Search menu, type gnu tools in the Search field, and press the Enter key.
- A check mark in the Status column of the package list means that package is already installed on your system. A green star in the Status column means an update is available for that package. If the gcc-dev package is not already installed, or if you want to update that package, select the checkbox to the left of the package name and then select the Install/Update button or the Package > Install/Update menu option at the top of the Package Manager window.
To install other GCC or GNU components individually, use the Search field to find the packages you need to install. For example, type gnu into the Search field.
To use the IPS command line interface to install the GNU Tools Development cluster, enter the following command.
$ pfexec pkg install gcc-dev
See the following resources for information about GCC and related tools:
- GCC, the GNU Compiler Collection
- GCC online documentation
- GDB: The GNU Project Debugger
- GDB Documentation
Other C/C++/Fortran Development Tools
To install other C, C++, and Fortran development tools, do one of the following in the Package Manager utility:
- Use the Search field to find the packages you need to install. For example, enter "lib" into the Search field.
- Click the category menu on the left side of the Package Manager window, and select the Development category. Then select a sub-category such as C++ or Integrated Development Environments.
For more information, see the following resources:
