Difference between revisions of "Berkeley DB"

From CBLFS
Jump to navigationJump to search
(Berkley DB does not ship with RPC anymore -- (Configure Info))
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{| style="text-align: left; background-color: AliceBlue;"
 
{| style="text-align: left; background-color: AliceBlue;"
|-
+
|-valign="top"
 
!Download Source:
 
!Download Source:
 
| http://download.oracle.com/berkeley-db/db-{{Berkeley DB-Version}}.tar.gz
 
| http://download.oracle.com/berkeley-db/db-{{Berkeley DB-Version}}.tar.gz
Line 7: Line 7:
 
----
 
----
  
== Introduction to Berkley DB ==
+
{{Package-Introduction|The Berkeley DB package contains programs and utilities used by many other applications for database related functions.|http://www.oracle.com/technology/products/berkeley-db/index.html}}
 
 
The Berkeley DB package contains programs and utilities used by many other applications for database related functions.
 
  
 
== Dependencies ==
 
== Dependencies ==
Line 17: Line 15:
 
* [[JDK]]
 
* [[JDK]]
 
* [[Sharutils]]
 
* [[Sharutils]]
 +
 +
== Additional Configuration Options ==
 +
 +
''--enable-java'': Enables the building of the Berkeley DB Java API ([[JDK]]).
 +
 +
''--enable-pthread_api'': Enables the POSIX thread library.
 +
 +
''--enable-tcl'': Enables the bulding of the Berkeley DB [[TCL]] API. You will need the ''--with-tcl=DIR'' flag if you use this one.
 +
 +
''--enable-test'': Enables the building of the test suite. The Berkeley DB [[TCL]] API must be built to run the test suite.
 +
 +
''--with-tcl=DIR'': This flag tells configure where [[TCL]]'s '''tclConfig.sh''' is located. The default is '''/usr/local/lib''', so if you want to enable [[TCL]] support in Berkeley DB, you will need to use this flag. '''tclConfig.sh''' will be in '''/usr/lib''', '''/usr/lib32''', or '''/usr/lib64''' - depending on which architecture you're building for.
 +
 +
== Test Suite Notes ==
 +
 +
Berkeley DB has a ''very'' extensive test suite. It will take hours - possibly half the day - to run. In addition, it's pretty much a guarantee that you'll have at least a few errors. So, think twice - perhaps even three or four times - before running it.
 +
 +
If you decide that you actually want to run the test suite, then you must have [[TCL]] installed and pass the following flags to configure:
 +
 +
''--enable-tcl''
 +
''--with-tcl=DIR''
 +
''--enable-test''
 +
 +
After running make, you will run:
 +
 +
tclsh
 +
 +
This opens up the [[TCL]] shell from where you will run the test suite:
 +
 +
source ../test/test.tcl
 +
run_parallel 5 run_std
 +
exit
 +
 +
So, after the '''run_parallel 5 run_std''' command you can run off to watch the entire Lord of the Rings or something. When you get back, you're going to have to build Berkeley DB again. This is because it is not recommended to use Berkeley DB configured with ''--enable-test'' on a production system.
 +
 +
So run '''make realclean''' and then run configure without the ''--enable-test'' flag. You can keep the [[TCL]]-related flags if you want to because [[TCL]] support in Berkeley DB can still be useful, but we don't want the test suite enabled. After that of course, you continue with building and installing Berkeley DB as normal.
  
 
== Non-Multilib ==
 
== Non-Multilib ==
Line 24: Line 58:
 
  cd build_unix &&
 
  cd build_unix &&
 
  ../dist/configure --prefix=/usr \
 
  ../dist/configure --prefix=/usr \
     --enable-compat185 --enable-cxx --enable-rpc &&
+
     --enable-compat185 --enable-cxx &&
 
  make
 
  make
  
Line 33: Line 67:
 
  chown -v root:root /usr/bin/berkeley_db_svc &&
 
  chown -v root:root /usr/bin/berkeley_db_svc &&
 
  chown -v -R root:root /usr/share/doc/db-{{Berkeley DB-Version}}
 
  chown -v -R root:root /usr/share/doc/db-{{Berkeley DB-Version}}
 +
 +
=== Command Explanations ===
 +
 +
''--enable-compat185'': This flag makes it so that you can compile or load Berkeley DB 1.85 applications against this release of the Berkeley DB library.
 +
 +
''--enable-cxx'': Enables the building of the Berkeley DB C++ API.
 +
 +
''--enable-rpc'': Enables the building of the Berkeley DB RPC client code and server utility.
 +
 +
''docdir=/usr/share/doc/db-{{Berkeley DB-Version}}'': This tells make to install the documentation in '''/usr/share/doc''' instead of the default '''/usr/docs'''.
 +
 +
'''chown -v root:root...''': The makefile uses '''cp -p''' to install files. As such, the files are owned by the user that built them. So, unless you want that to be the case (as in the [http://www.linuxfromscratch.org/hints/downloads/files/more_control_and_pkg_man.txt package user package management system]) you're going to want to chown them to root.
  
 
== Multilib ==
 
== Multilib ==
Line 42: Line 88:
 
  cd build_unix &&
 
  cd build_unix &&
 
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ../dist/configure --prefix=/usr \
 
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ../dist/configure --prefix=/usr \
     --enable-compat185 --enable-cxx --enable-rpc &&
+
     --enable-compat185 --enable-cxx &&
 
  make
 
  make
  
Line 50: Line 96:
 
  chown -v root:root /usr/bin/db_* /usr/lib/libdb* /usr/include/db* &&
 
  chown -v root:root /usr/bin/db_* /usr/lib/libdb* /usr/include/db* &&
 
  chown -v root:root /usr/bin/berkeley_db_svc &&
 
  chown -v root:root /usr/bin/berkeley_db_svc &&
  chown -v -R root:root /usr/share/doc/db-{{Berkeley DB-Version}}
+
  chown -Rv root:root /usr/share/doc/db-{{Berkeley DB-Version}}
  
 
=== N32 ===
 
=== N32 ===
Line 58: Line 104:
 
  cd build_unix &&
 
  cd build_unix &&
 
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ../dist/configure --prefix=/usr \
 
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ../dist/configure --prefix=/usr \
     --libdir=/usr/lib32 --enable-compat185 --enable-cxx --enable-rpc &&
+
     --libdir=/usr/lib32 --enable-compat185 --enable-cxx &&
 
  make
 
  make
  
Line 74: Line 120:
 
  cd build_unix &&
 
  cd build_unix &&
 
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ../dist/configure --prefix=/usr \
 
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ../dist/configure --prefix=/usr \
     --libdir=/usr/lib64 --enable-compat185 --enable-cxx --enable-rpc &&
+
     --libdir=/usr/lib64 --enable-compat185 --enable-cxx &&
 
  make
 
  make
  
Line 83: Line 129:
 
  chown -v root:root /usr/bin/berkeley_db_svc &&
 
  chown -v root:root /usr/bin/berkeley_db_svc &&
 
  chown -v -R root:root /usr/share/doc/db-{{Berkeley DB-Version}}
 
  chown -v -R root:root /usr/share/doc/db-{{Berkeley DB-Version}}
 +
 +
[[Category:General Libs]]

Latest revision as of 14:21, 15 January 2012

Download Source: http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz

Introduction to Berkeley DB

The Berkeley DB package contains programs and utilities used by many other applications for database related functions.

Project Homepage: http://www.oracle.com/technology/products/berkeley-db/index.html

Dependencies

Optional

Additional Configuration Options

--enable-java: Enables the building of the Berkeley DB Java API (JDK).

--enable-pthread_api: Enables the POSIX thread library.

--enable-tcl: Enables the bulding of the Berkeley DB TCL API. You will need the --with-tcl=DIR flag if you use this one.

--enable-test: Enables the building of the test suite. The Berkeley DB TCL API must be built to run the test suite.

--with-tcl=DIR: This flag tells configure where TCL's tclConfig.sh is located. The default is /usr/local/lib, so if you want to enable TCL support in Berkeley DB, you will need to use this flag. tclConfig.sh will be in /usr/lib, /usr/lib32, or /usr/lib64 - depending on which architecture you're building for.

Test Suite Notes

Berkeley DB has a very extensive test suite. It will take hours - possibly half the day - to run. In addition, it's pretty much a guarantee that you'll have at least a few errors. So, think twice - perhaps even three or four times - before running it.

If you decide that you actually want to run the test suite, then you must have TCL installed and pass the following flags to configure:

--enable-tcl
--with-tcl=DIR
--enable-test

After running make, you will run:

tclsh

This opens up the TCL shell from where you will run the test suite:

source ../test/test.tcl
run_parallel 5 run_std
exit

So, after the run_parallel 5 run_std command you can run off to watch the entire Lord of the Rings or something. When you get back, you're going to have to build Berkeley DB again. This is because it is not recommended to use Berkeley DB configured with --enable-test on a production system.

So run make realclean and then run configure without the --enable-test flag. You can keep the TCL-related flags if you want to because TCL support in Berkeley DB can still be useful, but we don't want the test suite enabled. After that of course, you continue with building and installing Berkeley DB as normal.

Non-Multilib

Compile the package:

cd build_unix &&
../dist/configure --prefix=/usr \
    --enable-compat185 --enable-cxx &&
make

Install the package

make docdir=/usr/share/doc/db-5.3.21 install &&
chown -v root:root /usr/bin/db_* /usr/lib/libdb* /usr/include/db* &&
chown -v root:root /usr/bin/berkeley_db_svc &&
chown -v -R root:root /usr/share/doc/db-5.3.21

Command Explanations

--enable-compat185: This flag makes it so that you can compile or load Berkeley DB 1.85 applications against this release of the Berkeley DB library.

--enable-cxx: Enables the building of the Berkeley DB C++ API.

--enable-rpc: Enables the building of the Berkeley DB RPC client code and server utility.

docdir=/usr/share/doc/db-5.3.21: This tells make to install the documentation in /usr/share/doc instead of the default /usr/docs.

chown -v root:root...: The makefile uses cp -p to install files. As such, the files are owned by the user that built them. So, unless you want that to be the case (as in the package user package management system) you're going to want to chown them to root.

Multilib

32Bit

Compile the package:

cd build_unix &&
CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ../dist/configure --prefix=/usr \
    --enable-compat185 --enable-cxx &&
make

Install the package

make docdir=/usr/share/doc/db-5.3.21 install &&
chown -v root:root /usr/bin/db_* /usr/lib/libdb* /usr/include/db* &&
chown -v root:root /usr/bin/berkeley_db_svc &&
chown -Rv root:root /usr/share/doc/db-5.3.21

N32

Compile the package:

cd build_unix &&
CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ../dist/configure --prefix=/usr \
    --libdir=/usr/lib32 --enable-compat185 --enable-cxx &&
make

Install the package

make docdir=/usr/share/doc/db-5.3.21 install &&
chown -v root:root /usr/bin/db_* /usr/lib32/libdb* /usr/include/db* &&
chown -v root:root /usr/bin/berkeley_db_svc &&
chown -v -R root:root /usr/share/doc/db-5.3.21

64Bit

Compile the package:

cd build_unix &&
CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ../dist/configure --prefix=/usr \
    --libdir=/usr/lib64 --enable-compat185 --enable-cxx &&
make

Install the package

make docdir=/usr/share/doc/db-5.3.21 install &&
chown -v root:root /usr/bin/db_* /usr/lib64/libdb* /usr/include/db* &&
chown -v root:root /usr/bin/berkeley_db_svc &&
chown -v -R root:root /usr/share/doc/db-5.3.21