Berkeley DB Reference Guide:
Building Berkeley DB for UNIX systems



  1. I can't compile and run multithreaded 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; for example, "-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 DB_ENV->open.

    AIX 4.1 allows applications to map only 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. On AIX 4.3.2 (or before) I see undefined symbols when linking C++ applications. Also, Java complains about missing symbols on this platform even though I've configured and built for Java.

    Versions of AIX 4.3.2 and before do not have the tools necessary to produce shared libraries for languages such as C++ and Java that use "name mangling" to map their names to C names. The Berkeley DB C++ API can be only used on this platform as a static library. The Berkeley DB Java API cannot be used on this platform.

  4. On AIX 4.3.3 I see undefined symbols for DbEnv::set_error_stream, Db::set_error_stream or DbEnv::verify when linking C++ applications. (These undefined symbols also appear when building the Berkeley DB C++ example applications).

    By default, Berkeley DB is built with _LARGE_FILES set to 1 to support the creation of "large" database files. However, this also affects how standard classes, like iostream, are named internally. When building your application, use a "-D_LARGE_FILES=1" compilation option, or insert "#define _LARGE_FILES 1" before any #include statements.

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

    If you're running on AIX 4.1 or earlier, try changing the source code for os/os_open.c to always specify the O_LARGEFILE flag to the open(2) system call, and recompile Berkeley DB from scratch.

    Also, 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; the ibmcxx product must be used instead. We have not heard whether 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