6    Development Environment

This chapter highlights the major features provided by the development environment for Tru64 UNIX. The following topics are discussed:

In addition, Tru64 UNIX supports internationalization, standard UNIX development tools (for example, awk, lint, make, and prof), and run-time libraries for Ada, C++, Cobol, Fortran, and Pascal programs.

For more more information, see the Programmer's Guide, the Programming Support Tools manual, the Assembly Language Programmer's Guide, and Writing Software for the International Market.

6.1    Compaq C Compiler

The Compaq C compiler for Tru64 UNIX is a standards-compliant, full-featured, highly-optimizing compiler that was specifically developed to exploit the Alpha architecture. In particular, the Compaq C compiler for Tru64 UNIX recognizes these popular C dialects:

The Compaq C compiler for Tru64 UNIX complies with the following standards:

For more information on standards compliance, see the standards(5) reference page.

The Compaq C compiler for Tru64 UNIX supports language extensions including:

The Compaq C compiler supports enhancements for mathematical computing such as:

For more information on the Compaq C compiler for Tru64 UNIX, see the cc(1) reference page.

6.2    Debuggers

Tru64 UNIX supports the following source code debuggers:

6.2.1    The dbx Debugger

The dbx debugger is used to debug programs at the source-code level or the machine-code level. The interface to dbx is a command line interface. The tasks you can perform with dbx include the following:

6.2.2    The ladebug Debugger

The ladebug debugger is a source-level symbolic debugger that has both a graphical user interface (GUI) and a command line interface similar to the dbx command line interface. The tasks you can perform with ladebug include the following:

Internationalization support is available in a separate kit. The internationalized ladebug debugger accepts multibyte characters as input, and outputs local language characters according to the current global locale set in the debugger. It also supports the wchar_t datatype in C and C++.

6.3    Profiling Tools

Tru64 UNIX provides the following profiling toolkit:

Tru64 UNIX also supports the following profiling tools:

For more information on profiling tools, see the Programmer's Guide and the appropriate reference pages.

6.4    Shared Libraries

Tru64 UNIX provides a full complement of dynamic shared libraries, compatible with System V semantics for shared library loading and symbol resolution, and the System V API for dynamic loading (dlopen, dlclose, dlsym, and dlerror).

Because they allow programs to include only information about how to load and access routines rather than the routines themselves, shared libraries increase system performance, reduce disk and memory requirements, and simplify system management.

The shared libraries are located in the /usr/shlib directory.

The Tru64 UNIX implementation of X11R6.3 and Motif also makes use of both static and shared libraries. The X11 shared libraries are located in the /usr/shlib/X11 directory.

6.4.1    Quickstart

Quickstart allows shared libraries with unique addresses to start faster than if their addresses were in conflict. Each shared library must have a unique address placed in the /usr/shlib/so_locations file, which allows applications that link against these shared libraries to start execution faster. This happens because the shared objects do not have to be relocated at run time. The ld utility can read and write an so_locations file when it creates a shared library.

6.4.2    Dynamic Loader

Tru64 UNIX uses a System V Release 4.0 compatible loader to load shared libraries dynamically. This loader provides the following features:

6.4.3    Versioning

Tru64 UNIX supports full and partial duplication of shared libraries. The loader looks for backward-compatible versions of shared libraries using a path constructed by appending the version string as a subdirectory of the normal search path. As a result, any changes to kernel interfaces or to global data definitions that would ordinarily break binary compatibility will not affect your applications, because you can maintain multiple versions of any shared library and link your application against the appropriate version of that shared library.

In Motif Version 1.2, for example, the OSF changed several of the interfaces, thereby breaking binary compatibility with applications built against Motif 1.1.3 libraries. To preserve binary compatibility, Tru64 UNIX supports both Motif 1.1.3 and Motif 1.2 shared libraries, so that applications can access the Motif 1.1.3 shared libraries. For more information on versioning, see the Programmer's Guide.

6.5    Run-Time Libraries

Tru64 UNIX supports the following run-time libraries. With these libraries, you can run previously compiled programs without having to install the corresponding language programs on your system.

6.6    Java Development Kit

The Java Development Kit (JDK) is a component of Tru64 UNIX. You can use this kit to develop and run Java applets and programs.

The JDK for Tru64 UNIX contains a just-in-time compiler (JIT), which provides on-the-fly compilation of your application's Java byte-code and run-time calls into native Alpha machine code. This results in significantly faster execution of your Java application compared with running it using the Java interpreter. The JIT runs by default when you enter the java command.

The JDK implements Java threads on top of native (POSIX) threads. This allows different Java threads in your application to run on different processors, provided that you have a multiprocessor machine. It also means that your Java application will run properly when linked with native methods or native APIs (such as DCE) that are also implemented using POSIX Threads.

For more information, see the Java documentation in the following directory on your Tru64 UNIX system where the JDK is installed: /usr/share/doclib/java/index.html

6.7    Development Commands

Tru64 UNIX supports the full array of development tools, including ar, as, btou, cb, cc, cflow, cpp, ctags, cxref, c89, dbx, dis, error, file, indent, ld, lex, lint, loader, m4, make, mig, mkstr, nm, odump, pixie, ppu, prof, ranlib, size, stdump, strings, strip, tsort, xstr, and yacc, as well as the source code control systems rcs and sccs.

Many of the development commands are specified by the System V, POSIX, XPG4, and XPG4-UNIX standards to which Tru64 UNIX is fully compliant.

6.8    Thread Support

Tru64 UNIX offers the POSIX Threads Library (formerly DECthreads), Visual Threads, and Thread-Independent Services.

6.8.1    POSIX Threads Library

The POSIX Threads Library is an implementation of the POSIX 1003.1c-1995 standard multithreading API. POSIX Threads provides efficient two-level scheduling (POSIX "process contention scope") that is tightly integrated with the kernel to automatically maintain the maximum level of computational and I/O concurrency at all times. For applications that require real-time scheduling with respect to hardware events or threads in other processes or in the kernel, POSIX Threads also provides "system contention scope" and scheduling.

6.8.2    Visual Threads

Visual Threads is a diagnostic tool for analyzing and debugging multithreaded applications. You can Visual Threads to automatically diagnose common problems associated with multithreading; these problems include deadlock, protection of shared data, and thread-usage errors.

You can also use this tool to monitor the thread-related performance of the application; it will help you identify bottlenecks or locking granularity problems. It is a unique debugging tool because it can be used to identify problem areas even if an application does not show any specific problem symptoms.

Visual Threads can be used with any Tru64 UNIX application that uses POSIX Threads (DECthreads) or is written in Java. It is designed for multithreaded applications of all sizes; it can handle applications with from two threads to hundreds of threads.

Visual Threads is licensed as part of the Developers' Toolkit.

6.8.3    Thread-Independent Services

Tru64 UNIX supports Thread-Independent Services (TIS) routines, which are provided to enable application writers to write thread-safe code for nonthreaded libraries and applications. In the presence of threads, these routines provide thread-safe functionality. In the absence of threads, these routines impose the minimum possible overhead on their caller. Note that the TIS routines are used by the C run-time library to provide support for both single and multithreaded applications.

6.9    Memory-Mapped File Support

Tru64 UNIX supports the Berkeley Memory-Mapped File Support (mmap) function, which allows an application to access data files with memory operations rather than file I/O operations.

6.10    Real-Time User and Programming Environment

Tru64 UNIX supports a real-time user and programming environment; it is shipped as an optional subset. The Tru64 UNIX real-time programming environment conforms to the POSIX 1003.1b-1993 standard for real time, which allows you to develop and run portable real-time applications in a POSIX environment. The POSIX 1003.1b interfaces are collected in the real-time and asynchronous I/O libraries librt and libaio, respectively.

If you enable kernel preemption, a higher priority process can preempt a lower-priority process regardless of whether it is running in kernel mode or user mode. With this fully preemptive kernel, the Process Preemption Latency (the amount of time it takes to preempt a lower-priority process) is minimized.

In addition to a preemptive kernel, the Tru64 UNIX real-time programming environment supports the following POSIX 1003.1b features:

For more information on the real-time programming environment, see the Guide to Realtime Programming. For information on configuring the real-time kernel, see the System Administration manual.

6.11    Network Programming Interfaces

The network programming environment includes the programming interfaces for application, kernel, and driver developers writing network applications and implementing network protocols. Additionally, it includes the kernel-level resources that an application requires to process and transmit data, some of which include libraries, data structures, header files, and transport protocols.

The following programming interfaces are supported by the operating system:

For more detailed information on the network programming environment, see the Network Programmer's Guide.