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

# Solaris

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

   Special compile-time flags and additional libraries are required when compiling threaded applications on Solaris. If you are compiling a threaded application, you must compile with the _REENTRANT flag and link with the libpthread.a or libthread.a libraries:

   >     cc -mt ...
   >     cc -D_REENTRANT ... -lthread
   >     cc -D_REENTRANT ... -lpthread

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

2. I've installed gcc on my Solaris system, but configuration fails because the compiler doesn't work.

   On some versions of Solaris, there is a cc executable in the user's path, but all it does is display an error message and fail:

   >     % which cc
   >     /usr/ucb/cc
   >     % cc
   >     /usr/ucb/cc: language optional software package not installed

   As Berkeley DB always uses the native compiler in preference to gcc, this is a fatal error. If the error message you're seeing is:

   >     checking whether the C compiler (cc -O ) works... no
   >     configure: error: installation or configuration problem: C compiler cannot create executables.

   then this may be the problem you're seeing. The simplest workaround is to set your CC environment variable to the system compiler, e.g.:

   >     env CC=gcc ../dist/configure

   and reconfigure.

   If you are using the --configure-cxx option, you may also want to specify a C++ compiler, e.g.:

   >     env CC=gcc CCC=g++ ../dist/configure

3. I get the error "libc internal error: _rmutex_unlock: rmutex not held", followed by a core dump, when running threaded or JAVA programs.

   This is a known bug in Solaris 2.5 and it is fixed by Sun patch 103187-25.

Copyright Sleepycat Software