📄 readme
字号:
DB_File Version 1.814 11th November 2005 Copyright (c) 1995-2005 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.IMPORTANT NOTICE================If are using the locking technique described in older versions ofDB_File, please read the section called "Locking: The Trouble with fd"in DB_File.pm immediately. The locking method has been found to beunsafe. You risk corrupting your data if you continue to use it.DESCRIPTION-----------DB_File is a module which allows Perl programs to make use of thefacilities provided by Berkeley DB version 1. (DB_File can be builtversion 2, 3 or 4 of Berkeley DB, but it will only support the 1.xfeatures),If you want to make use of the new features available in Berkeley DB2.x, 3.x or 4.x, use the Perl module BerkeleyDB instead.Berkeley DB is a C library which provides a consistent interface to anumber of database formats. DB_File provides an interface to all threeof the database types (hash, btree and recno) currently supported byBerkeley DB.For further details see the documentation included at the end of thefile DB_File.pm.PREREQUISITES-------------Before you can build DB_File you must have the following installed onyour system: * Perl 5.004_05 or greater. * Berkeley DB. The official web site for Berkeley DB is http://www.sleepycat.com. The latest version of Berkeley DB is always available there. It is recommended that you use the most recent version available at the Sleepycat site. The one exception to this advice is where you want to use DB_File to access database files created by a third-party application, like Sendmail or Netscape. In these cases you must build DB_File with a compatible version of Berkeley DB. If you want to use Berkeley DB 2.x, you must have version 2.3.4 or greater. If you want to use Berkeley DB 3.x or 4.x, any version will do. For Berkeley DB 1.x, use either version 1.85 or 1.86.BUILDING THE MODULE-------------------Assuming you have met all the prerequisites, building the module shouldbe relatively straightforward.Step 1 : If you are running either Solaris 2.5 or HP-UX 10 and want to use Berkeley DB version 2, 3 or 4, read either the Solaris Notes or HP-UX Notes sections below. If you are running Linux please read the Linux Notes section before proceeding.Step 2 : Edit the file config.in to suit you local installation. Instructions are given in the file.Step 3 : Build and test the module using this sequence of commands: perl Makefile.PL make make test NOTE: If you have a very old version of Berkeley DB (i.e. pre 1.85), three of the tests in the recno test harness may fail (tests 51, 53 and 55). You can safely ignore the errors if you're never going to use the broken functionality (recno databases with a modified bval). Otherwise you'll have to upgrade your DB library.INSTALLATION------------ make installUPDATES=======The most recent version of DB_File is always available at http://www.cpan.org/modules/by-module/DB_File/TROUBLESHOOTING===============Here are some of the common problems people encounter when buildingDB_File.Missing db.h or libdb.a-----------------------If you get an error like this: cc -c -I/usr/local/include -Dbool=char -DHAS_BOOL -O2 -DVERSION=\"1.64\" -DXS_VERSION=\"1.64\" -fpic -I/usr/local/lib/perl5/i586-linux/5.00404/CORE -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t DB_File.c DB_File.xs:101: db.h: No such file or directoryor this: LD_RUN_PATH="/lib" cc -o blib/arch/auto/DB_File/DB_File.so -shared -L/usr/local/lib DB_File.o -L/usr/local/lib -ldb ld: cannot open -ldb: No such file or directoryThis symptom can imply: 1. You don't have Berkeley DB installed on your system at all. Solution: get & install Berkeley DB. 2. You do have Berkeley DB installed, but it isn't in a standard place. Solution: Edit config.in and set the LIB and INCLUDE variables to point to the directories where libdb.a and db.h are installed.Undefined symbol db_version---------------------------DB_File seems to have built correctly, but you get an error like thiswhen you run the test harness: $ make test PERL_DL_NONLAZY=1 /usr/bin/perl5.00404 -I./blib/arch -I./blib/lib -I/usr/local/lib/perl5/i586-linux/5.00404 -I/usr/local/lib/perl5 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/db-btree..........Can't load './blib/arch/auto/DB_File/DB_File.so' for module DB_File: ./blib/arch/auto/DB_File/DB_File.so: undefined symbol: db_version at /usr/local/lib/perl5/i586-linux/5.00404/DynaLoader.pm line 166. at t/db-btree.t line 21 BEGIN failed--compilation aborted at t/db-btree.t line 21. dubious Test returned status 2 (wstat 512, 0x200)This error usually happens when you have two version of Berkeley DBinstalled on your system -- specifically, if you have both version 1 anda newer version (i.e. version 2 or better) of Berkeley DB installed. IfDB_File is built using the db.h for the newer Berkeley DB and the version1 Berkeley DB library you will trigger this error. Unfortunately the twoversions aren't compatible with each other. The undefined symbol error iscaused because Berkeley DB version 1 doesn't have the symbol db_version.Solution: Setting the LIB & INCLUDE variables in config.in to point to the correct directories can sometimes be enough to fix this problem. If that doesn't work the easiest way to fix the problem is to either delete or temporarily rename the copies of db.h and libdb.a that you don't want DB_File to use.Undefined symbol dbopen-----------------------DB_File seems to have built correctly, but you get an error like thiswhen you run the test harness: ... t/db-btree..........Can't load 'blib/arch/auto/DB_File/DB_File.so' for module DB_File: blib/arch/auto/DB_File/DB_File.so: undefined symbol: dbopen at /usr/local/lib/perl5/5.6.1/i586-linux/DynaLoader.pm line 206. at t/db-btree.t line 23 Compilation failed in require at t/db-btree.t line 23. ...This error usually happens when you have both version 1 and a more recentversion of Berkeley DB installed on your system and DB_File attemptsto build using the db.h for Berkeley DB version 1 and the newer versionlibrary. Unfortunately the two versions aren't compatible with eachother. The undefined symbol error is actually caused because versionsof Berkeley DB newer than version 1 doesn't have the symbol dbopen.Solution: Setting the LIB & INCLUDE variables in config.in to point to the correct directories can sometimes be enough to fix this problem. If that doesn't work the easiest way to fix the problem is to either delete or temporarily rename the copies of db.h and libdb.a that you don't want DB_File to use.Incompatible versions of db.h and libdb---------------------------------------BerkeleyDB seems to have built correctly, but you get an error like thiswhen you run the test harness: $ make test PERL_DL_NONLAZY=1 /home/paul/perl/install/bin/perl5.00560 -Iblib/arch -Iblib/lib -I/home/paul/perl/install/5.005_60/lib/5.00560/i586-linux -I/home/paul/perl/install/5.005_60/lib/5.00560 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/db-btree.......... DB_File needs compatible versions of libdb & db.h you have db.h version 2.3.7 and libdb version 2.7.5 BEGIN failed--compilation aborted at t/db-btree.t line 21. ...Another variation on the theme of having two versions of Berkeley DB onyour system.Solution: Setting the LIB & INCLUDE variables in config.in to point to the correct directories can sometimes be enough to fix this problem. If that doesn't work the easiest way to fix the problem is to either delete or temporarily rename the copies of db.h and libdb.a that you don't want BerkeleyDB to use. If you are running Linux, please read the Linux Notes section below.Solaris build fails with "language optional software package not installed"---------------------------------------------------------------------------If you are trying to build this module under Solaris and you get anerror message like this /usr/ucb/cc: language optional software package not installedit means that Perl cannot find the C compiler on your system. The crypticmessage is just Sun's way of telling you that you haven't bought theirC compiler.When you build a Perl module that needs a C compiler, the Perl buildsystem tries to use the same C compiler that was used to build perlitself. In this case your Perl binary was built with a C compiler thatlived in /usr/ucb.To continue with building this module, you need to get a C compiler,or tell Perl where your C compiler is, if you already have one.Assuming you have now got a C compiler, what you do next will be dependanton what C compiler you have installed. If you have just installed Sun'sC compiler, you shouldn't have to do anything. Just try rebuildingthis module.If you have installed another C compiler, say gcc, you have to tell perlhow to use it instead of /usr/ucb/cc.This set of options seems to work if you want to use gcc. Your mileagemay vary. perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" " make testIf that doesn't work for you, it's time to make changes to the Makefileby hand. Good luck!Solaris build fails with "gcc: unrecognized option `-KPIC'"-----------------------------------------------------------You are running Solaris and you get an error like this when you try tobuild this Perl module gcc: unrecognized option `-KPIC'This symptom usually means that you are using a Perl binary that has beenbuilt with the Sun C compiler, but you are using gcc to build this module.When Perl builds modules that need a C compiler, it will attempt to usethe same C compiler and command line options that was used to build perlitself. In this case "-KPIC" is a valid option for the Sun C compiler,but not for gcc. The equivalent option for gcc is "-fPIC".The solution is either: 1. Build both Perl and this module with the same C compiler, either by using the Sun C compiler for both or gcc for both. 2. Try generating the Makefile for this module like this perl perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" " LD=gcc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -