Berkeley DB:"make install" 在 Linux 上失败

Berkeley DB: "make install" fails on Linux

我正在尝试在我的虚拟机上安装 Berkeley DB 18.1.40(C++ 版本)(Linux-Ubuntu)。

当我执行 sudo make install 时,我遇到以下错误消息:

Installing DB include files: /usr/local/BerkeleyDB.18.1/include ...
Installing DB library: /usr/local/BerkeleyDB.18.1/lib ...
libtool: install: cp -p .libs/libdb-18.1.so /usr/local/BerkeleyDB.18.1/lib/libdb-18.1.so
libtool: install: cp -p .libs/libdb-18.1.lai /usr/local/BerkeleyDB.18.1/lib/libdb-18.1.la
libtool: install: cp -p .libs/libdb-18.1.a /usr/local/BerkeleyDB.18.1/lib/libdb-18.1.a
libtool: install: chmod 644 /usr/local/BerkeleyDB.18.1/lib/libdb-18.1.a
libtool: install: ranlib /usr/local/BerkeleyDB.18.1/lib/libdb-18.1.a
libtool: install: cp -p libdb.a /usr/local/BerkeleyDB.18.1/lib/libdb.a
libtool: install: chmod 644 /usr/local/BerkeleyDB.18.1/lib/libdb.a
libtool: install: ranlib /usr/local/BerkeleyDB.18.1/lib/libdb.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/BerkeleyDB.18.1/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/BerkeleyDB.18.1/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing DB utilities: /usr/local/BerkeleyDB.18.1/bin ...
libtool: install: cp -p .libs/db_archive /usr/local/BerkeleyDB.18.1/bin/db_archive
libtool: install: cp -p .libs/db_checkpoint /usr/local/BerkeleyDB.18.1/bin/db_checkpoint
libtool: install: cp -p .libs/db_convert /usr/local/BerkeleyDB.18.1/bin/db_convert
libtool: install: cp -p .libs/db_deadlock /usr/local/BerkeleyDB.18.1/bin/db_deadlock
libtool: install: cp -p .libs/db_dump /usr/local/BerkeleyDB.18.1/bin/db_dump
libtool: install: cp -p .libs/db_hotbackup /usr/local/BerkeleyDB.18.1/bin/db_hotbackup
libtool: install: cp -p .libs/db_load /usr/local/BerkeleyDB.18.1/bin/db_load
libtool: install: cp -p .libs/db_log_verify /usr/local/BerkeleyDB.18.1/bin/db_log_verify
libtool: install: cp -p .libs/db_printlog /usr/local/BerkeleyDB.18.1/bin/db_printlog
libtool: install: cp -p .libs/db_recover /usr/local/BerkeleyDB.18.1/bin/db_recover
libtool: install: cp -p .libs/db_replicate /usr/local/BerkeleyDB.18.1/bin/db_replicate
libtool: install: cp -p .libs/db_stat /usr/local/BerkeleyDB.18.1/bin/db_stat
libtool: install: cp -p .libs/db_tuner /usr/local/BerkeleyDB.18.1/bin/db_tuner
libtool: install: cp -p .libs/db_upgrade /usr/local/BerkeleyDB.18.1/bin/db_upgrade
libtool: install: cp -p .libs/db_verify /usr/local/BerkeleyDB.18.1/bin/db_verify
Installing documentation: /usr/local/BerkeleyDB.18.1/docs ...
cp: cannot stat 'bdb-sql': No such file or directory
cp: cannot stat 'gsg_db_server': No such file or directory
Makefile:1307: recipe for target 'install_docs' failed
make: *** [install_docs] Error 1

我很困惑为什么会提示这个错误,因为 bdb-sqlgsg_db_server 不是安装手册中提到的内容。

有谁知道如何修复这些错误?

感谢您的帮助!

这似乎是 libdb 18.1.40 的错误,应报告给 Oracle。版本 18.1.32 在 https://download.oracle.com/otn/berkeley-db/db-18.1.32.tar.gz

正如@fuzzyTew 所说,这似乎是 18.1.40 的一个错误,但由于它仅限于文档,因此应该足够安全来给自己打补丁。有两种简单的方法可以做到这一点。到目前为止,更简单的方法是在 docs 目录中创建它想要的目录,使用 mkdir db-18.1.40/docs/bdb-sql db-18.1.40/docs/gsg_db_server 即可轻松完成。这将在您的文档文件夹中留下一对随机的空目录,但即使在使用它们的文档本身中我也找不到任何引用,所以它应该足够安全。或者,您可以在 运行 configure 之后使用 sed -i.bak -e 's: bdb-sql : :' -e 's: gsg_db_server : :' Makefile 从 Makefile 中删除它们。就个人而言,我更喜欢只创建空目录,因为这几乎不可能出错。

根据其他答案,我发现对我来说最好的解决方案是将丢失的目录从 18.1.32 复制到我的 18.1.40 源中:

tar -xzvf db-18.1.32.tar.gz
tar -xzvf db-18.1.40.tar.gz
cp -rp db-18.1.32/docs/bdb-sql db-18.1.40/docs/
cp -rp db-18.1.32/docs/gsg_db_server db-18.1.40/docs/

这样您就可以两全其美...您不必降级到 32,并且您可以获得文档而不是空文档文件夹。显然,这些文档是针对以前版本的,可能不是 100% 正确,但 IMO 总比没有好。