Previous: Berkeley DB on MS Windows, Up: Berkeley DB Notes


9.2 Berkeley DB on Mac OS X

The prebuilt installation of SICStus for Mac OS X assumes that Berkeley DB is installed in the default location /usr/local/BerkeleyDB.4.8/.

There is no binary installer available for installing Berkeley DB on Mac OS X. Instead you need to build it yourself. To do this you need to download and install the Apple C compiler (Xcode) and then download, build and install the Berkeley DB library, using something like the following in the Terminal program:

  1. Unpack the downloaded source code archive. At the time of writing, 4.8.30 is the latest version of Berkeley DB 4.8.

    tar xzf db-4.8.30.tar.gz

  2. Move into the source code folder tree

    cd db-4.8.30/build_unix/

  3. Configure Berkeley DB for both 32-bit and 64-bit

    ../dist/configure LDFLAGS='-arch x86_64 -arch i386' CFLAGS='-arch x86_64 -arch i386'

  4. Build

    make

  5. Install in the standard location

    sudo make install

    The installation step requires that you are running as an administrator and the sudo command will require that you provide the password.

  6. Verify that Berkeley DB was installed

    /usr/local/BerkeleyDB.4.8/db_archive -V

    This should print some version information, e.g. ‘Berkeley DB 4.8.30: (April 9, 2010)’.


Send feedback on this subject.