### Berkeley DB Reference Guide: Building Berkeley DB for UNIX systems |

# AIX

1. I can't compile and run multi-threaded applications.

   Special compile-time flags are required when compiling threaded applications on AIX. If you are compiling a threaded application, you must compile with the _THREAD_SAFE flag and load with specific libraries, e.g., "-lc_r". Specifying the compiler name with a trailing "_r" usually performs the right actions for the system.

   >     xlc_r ...
   >     cc -D_THREAD_SAFE -lc_r ...

   The Berkeley DB library will automatically build with the correct options.

2. I can't run using the DB_SYSTEM_MEM option to DBENV->open.

   AIX 4.1 only allows applications to map 10 system shared memory segments. In AIX 4.3 this has been raised to 256K segments, but only if you set the environment variable "export EXTSHM=ON".

3. I can't create database files larger than 1GB on AIX.

   Berkeley DB does not include large-file support for AIX systems by default. Sleepycat Software has been told that the following changes will add large-file support on the AIX 4.2 and later releases, but we have not tested them ourselves.

   Add the following lines to the db_config.h file in your build directory:

   >     #ifdef	HAVE_FILE_OFFSET_BITS
   >     #define	_LARGE_FILES		/* AIX specific. */
   >     #endif

   Change the source code for os/os_open.c to always specify the O_LARGEFILE flag to the open(2) system call.

   Recompile Berkeley DB from scratch.

   Note that the documentation for the IBM Visual Age compiler states that it does not not support the 64-bit filesystem APIs necessary for creating large files, and that the ibmcxx product must be used instead. We have not heard if the GNU gcc compiler supports the 64-bit APIs or not.

   Finally, to create large files under AIX, the filesystem has to be configured to support large files and the system wide user hard-limit for file sizes has to be greater than 1GB.

Copyright Sleepycat Software