Developing and Porting C and C++ Applications on AIX

Book description

This IBM Redbook will help experienced UNIX application developers who are new to the AIX operating system. The book explains the many concepts in detail, including the following:

- Enhancements and new features provided by the latest C and C++ compilers for AIX

- Compiling and linking tasks required to effectively use and manage shared libraries and run-time linking

- Use of process heap and shared memory in the 32- and 64-bit user process models

- A new programming paradigm in a partitioned environment where resources can be dynamically changed

- Parallel programming using POSIX threads and OpenMP

The following chapters are also useful for system administrators who are responsible for the software problem determination and application software release level management on AIX systems:

Chapter 3, "Understanding user process models"

Chapter 7, "Debugging your applications"

Chapter 12, "Packaging your applications"

Table of contents

  1. Copyright
  2. Figures
  3. Tables
  4. Preface
  5. Summary of changes
  6. C and C++ compilers
    1. C for AIX Version 6.0
    2. VisualAge C++ for AIX Version 6.0
    3. Installing the compilers
    4. Activating the compilers
    5. Activating the LUM server
    6. Enrolling a product license
    7. Invoking the compilers
    8. Where to find help
  7. Compiling and linking
    1. 32- and 64-bit development environments
    2. Compiling and linking: A quick overview
    3. Resolving symbols at link-time
    4. Supported link methods on AIX
    5. Run-time linking
    6. Dynamic loading
    7. Commands when manipulating objects and libraries
    8. Creating shared objects
    9. Shared libraries in a development environment
  8. Understanding user process models
    1. User process models on AIX
    2. The 32-bit user process model
    3. The 64-bit user process model
    4. Introduction to shared memory
    5. Shared memory segments allocation order
    6. Large page support
  9. Managing the memory heap
    1. Malloc subsystem
    2. Memory allocators
    3. Use of MALLOCDEBUG options
    4. Heap management using MEMDBG
  10. Creating DLPAR-aware applications
    1. Dynamic logical partitioning overview
    2. The process flow of a DLPAR operation
    3. DLPAR-safe and DLPAR-aware applications
    4. Integrating a DLPAR operation into the application
  11. Programming hints and tips
    1. Programming recommendations
    2. Diagnosing compile-time errors
    3. Diagnosing link-time errors
    4. Diagnosing run-time errors
  12. Debugging your applications
    1. Working with core files
    2. Using the printf()-debug method
    3. Preparing your application for debugging
    4. Using dbx
    5. Debugging with the truss command
    6. Using the trace facility
  13. Introduction to POSIX threads
    1. Overview of threads
    2. POSIX threads (Pthreads) on AIX
    3. Pthread management
    4. Data synchronization between Pthreads
    5. Thread-specific data
    6. Pthread cancellation
    7. Pthread priority and scheduling
    8. Pthread specific environment variables in AIX
    9. User API for Solaris threaded applications
  14. Program parallelization using OpenMP
    1. Introduction to OpenMP
    2. The OpenMP programming model
    3. Classification of OpenMP directives
    4. Parallel region construct
    5. Work-sharing constructs
    6. Combined parallel work-sharing constructs
    7. Synchronization constructs
    8. Data environment: The threadprivate directive
    9. Data-sharing attribute clauses
    10. Run-time library functions
    11. Environment variables
  15. Dealing with C++ templates
    1. What is a template
    2. AIX template implementations
    3. Simple code layout method
    4. Template instantiation file method
    5. Template registry: The preferred method
    6. Standard C++ Library and STL
  16. Creating shared objects from C++ source codes
    1. Creating shared objects from C++ source codes
    2. Shared objects with templates
  17. Packaging your applications
    1. Understanding the AIX standard packaging
    2. Packaging applications using mkinstallp
  18. Previous versions of C and C++ compiler products
    1. Compiler product similarities
    2. IBM C compilers
    3. IBM C++ compilers
  19. Useful information for linking and loading on AIX
    1. A brief history of UNIX programming development
    2. Historical view of linking and loading in AIX
    3. Definitions
  20. Subroutine references for shmat and mmap services
    1. References for shmat services
    2. References for mmap services
  21. Subroutine references for POSIX threads
    1. Subroutines defined in the POSIX thread standard
    2. Subroutines defined in the UNIX 98 Specification
    3. Extensions to POSIX thread
  22. Supported IBM SMP directives
    1. IBM SMP directives
  23. Sample compiler listing
    1. Compiler listing
  24. Abbreviations and acronyms
  25. Related publications
    1. IBM Redbooks
    2. Referenced Web sites
    3. How to get IBM Redbooks
  26. Back cover
  27. Index

Product information

  • Title: Developing and Porting C and C++ Applications on AIX
  • Author(s): Keigo Matsubara, Edison Kwok, Inge Rodriguez, Murali Paramasivam
  • Release date: June 2003
  • Publisher(s): IBM Redbooks
  • ISBN: 073842935X