Library Version 12.1.6.2

Mac OS X
Prev | Chapter 7. Building Berkeley DB for UNIX/POSIX | Next

## Mac OS X

1. When trying to link multiple Berkeley DB language interfaces (for example, Tcl, C++, Java, Python) into a single process, I get "multiple definitions" errors from dyld.

   To fix this problem, set the environment variable MACOSX_DEPLOYMENT_TARGET to 10.3 (or your current version of OS X), and reconfigure and rebuild Berkeley DB from scratch. See the OS X ld(1) and dyld(1) man pages for information about how OS X handles symbol namespaces, as well as undefined and multiply-defined symbols.

2. When trying to use system-backed shared memory on OS X I see failures about "too many open files".

   The default number of shared memory segments on OS X is too low. To fix this problem, create a file named `/etc/sysctl.conf`, containing the variable assignments:

       kern.sysv.shmmax=134217728
       kern.sysv.shmmin=1
       kern.sysv.shmmni=32
       kern.sysv.shmseg=32
       kern.sysv.shmall=1024

   and then reboot the system.

   Check the version of OS X carefully because some versions require all five parameters to be set.

   The `SHMMAX` variable should be set to a value that is an exact multiple of 4096. Some versions of OS X ignore the value if it is not an exact multiple.

   Please check and verify with the OS X documentation on the proper setting of these parameters. In some cases a reboot is necessary and in others it is possible to change them dynamically using `sysctl`.

   The `/etc/sysctl.conf` file exists in OS X 10.3.9 and later. If you are running a version of OS X previous to 10.3.x, edit the `/etc/rc` file and change the values in the following commands:

       sysctl -w kern.sysv.shmmax=134217728
       sysctl -w kern.sysv.shmseg=32

   and then reboot the system.

   OS X system updates will overwrite `/etc/rc` so any changes to the file must be redone after sytem updates.

Prev | Up | Next
Linux | Home | QNX