1<!--$Id: macosx.so,v 11.14 2005/10/21 20:16:41 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Mac OS X</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<a name="2"><!--meow--></a>
12<table width="100%"><tr valign=top>
13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for UNIX/POSIX systems</dl></b></td>
14<td align=right><a href="../build_unix/linux.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../build_unix/osf1.html"><img src="../../images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>Mac OS X</b></p>
17<ol>
18<p><li><b>When trying to link multiple Berkeley DB language interfaces (for
19example, Tcl, C++, Java, Python) into a single process, I get "multiple
20definitions" errors from dyld.</b>
21<p>To fix this problem, set the environment variable MACOSX_DEPLOYMENT_TARGET
22to 10.3 (or your current version of OS X), and reconfigure and rebuild
23Berkeley DB from scratch.  See the OS X ld(1) and dyld(1) man pages for information
24about how OS X handles symbol namespaces, as well as undefined and
25multiply-defined symbols.</p>
26<p><li><b>When trying to use system-backed shared memory on OS X I see
27failures about "too many open files".</b>
28<p>The default number of shared memory segments on OS X is too low.  To fix
29this problem, edit the file /etc/rc, changing the kern.sysv.shmmax and
30kern.sysv.shmseg values as follows:</p>
31<blockquote><pre>*** /etc/rc.orig        Fri Dec 19 09:34:09 2003
32--- /etc/rc     Fri Dec 19 09:33:53 2003
33***************
34*** 84,93 ****
35   # System tuning
36   sysctl -w kern.maxvnodes=$(echo $(sysctl -n hw.physmem) '33554432 /
37512 * 1024 +p'|dc)
38! sysctl -w kern.sysv.shmmax=4194304
39   sysctl -w kern.sysv.shmmin=1
40   sysctl -w kern.sysv.shmmni=32
41! sysctl -w kern.sysv.shmseg=8
42   sysctl -w kern.sysv.shmall=1024
43   if [ -f /etc/sysctl-macosxserver.conf ]; then
44         awk '{ if (!-1 && -1) print $1 }' &lt;
45/etc/sysctl-macosxserver.conf | while read
46--- 84,93 ----
47   # System tuning
48   sysctl -w kern.maxvnodes=$(echo $(sysctl -n hw.physmem) '33554432 /
49512 * 1024 +p'|dc)
50! sysctl -w kern.sysv.shmmax=134217728
51   sysctl -w kern.sysv.shmmin=1
52   sysctl -w kern.sysv.shmmni=32
53! sysctl -w kern.sysv.shmseg=32
54   sysctl -w kern.sysv.shmall=1024
55   if [ -f /etc/sysctl-macosxserver.conf ]; then
56         awk '{ if (!-1 && -1) print $1 }' &lt;
57/etc/sysctl-macosxserver.conf | while read</pre></blockquote>
58<p>and then reboot the system.</p>
59</ol>
60<table width="100%"><tr><td><br></td><td align=right><a href="../build_unix/linux.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../build_unix/osf1.html"><img src="../../images/next.gif" alt="Next"></a>
61</td></tr></table>
62<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
63</body>
64</html>
65