📄 notes.so
字号:
m4_comment([$Id: notes.so,v 10.54 2005/06/16 17:04:04 bostic Exp $])m4_ref_title(Building m4_db for UNIX/POSIX systems, Architecture independent FAQ, [@building for UNIX FAQ, building for @UNIX FAQ], build_unix/test, build_unix/aix)m4_nlistbeginm4_nlist([dnlm4_bold([I have gcc installed, but configure fails to find it.])m4_p([dnlm4_db defaults to using the native C compiler if none is specified.That is usually "cc", but some platforms require a different compilerto build multithreaded code. To configure m4_db to build with gcc, runconfigure as follows:])m4_indent([dnlenv CC=gcc ../dist/configure ...])])m4_hlm4_nlist([dnlm4_bold([When compiling with gcc, I get unreferenced symbols; for examplethe following:m4_indent([dnlsymbol __muldi3: referenced symbol not foundsymbol __cmpdi2: referenced symbol not found])])m4_p([dnlm4_db often uses 64-bit integral types on systems supporting largefiles, and gcc performs operations on those types by calling libraryfunctions. These unreferenced symbol errors are usually caused bylinking an application by calling "ld" rather than by calling "gcc":gcc will link in libgcc.a and will resolve the symbols. If that doesnot help, another possible workaround is to reconfigure m4_db using them4_linkpage(M4RELDIR/ref/build_unix/conf, --disable-largefile,--disable-largefile) configuration option and then rebuild.])])m4_hlm4_nlist([dnlm4_bold([My C++ program traps during a failure in a DB call on mygcc-based system.])m4_p([dnlWe believe there are some severe bugs in the implementation ofexceptions for some gcc compilers. Exceptions require some interactionbetween compiler, assembler, and runtime libraries. We're not sureexactly what is at fault, but one failing combination is gcc 2.7.2.3running on SuSE Linux 6.0. The problem on this system can be seen witha rather simple test case of an exception thrown from a shared libraryand caught in the main program.])m4_p([dnlA variation of this problem seems to occur on AIX, although we believe itdoes not necessarily involve shared libraries on that platform.])m4_p([dnlIf you see a trap that occurs when an exception might be thrown by them4_db runtime, we suggest that you use static libraries instead ofshared libraries. See the documentation for configuration. If thisdoesn't work and you have a choice of compilers, try using a more recentgcc- or a non-gcc based compiler to build m4_db.])m4_p([dnlFinally, you can disable the use of exceptions in the C++ runtime form4_db by using the m4_refcxx(DB_CXX_NO_EXCEPTIONS) flag with them4_refcxx(DbEnv) or m4_refcxx(Db) constructors. When this flag is on,all C++ methods fail by returning an error code rather than throwing anexception.])])m4_hlm4_nlist([dnlm4_bold([I get unexpected results and database corruption when runningthreaded programs.])m4_p([dnlm4_bold([I get error messages that mutex (for example, pthread_mutex_XXX ormutex_XXX) functions are undefined when linking applications with m4_db.])])m4_p([dnlOn some architectures, the m4_db library uses the ISO POSIX standardpthreads and UNIX International (UI) threads interfaces for underlyingmutex support; for example, Solaris and HP-UX. You can specifycompilers or compiler flags, or link with the appropriate thread librarywhen loading your application to resolve the undefined references:])m4_indent([dnlcc ... -lpthread ...cc ... -lthread ...xlc_r ...cc ... -mt ...])m4_p([dnlSee the appropriate architecture-specific Reference Guide pages for moreinformation.])m4_p([dnlOn systems where more than one type of mutex is available, it may benecessary for applications to use the same threads package from whichm4_db draws its mutexes. For example, if m4_db was built to use thePOSIX pthreads mutex calls for mutex support, the application may needto be written to use the POSIX pthreads interfaces for its threadingmodel. This is only conjecture at this time, and although we know ofno systems that actually have this requirement, it's not unlikely thatsome exist.])m4_p([dnlIn a few cases, m4_db can be configured to use specific underlying mutexinterfaces. You can use the m4_linkpage(M4RELDIR/ref/build_unix/conf,--enable-posixmutexes, --enable-posixmutexes) andm4_linkpage(M4RELDIR/ref/build_unix/conf, --enable-uimutexes,--enable-uimutexes) configuration options to specify the POSIX and UnixInternational (UI) threads packages. This should not, however, benecessary in most cases.])m4_p([dnlIn some cases, it is vitally important to make sure that you load thecorrect library. For example, on Solaris systems, there are POSIXpthread interfaces in the C library, so applications can link m4_dbusing only C library and not see any undefined symbols. However, theC library POSIX pthread mutex support is insufficient for m4_db, andm4_db cannot detect that fact. Similar errors can arise whenapplications (for example, tclsh) use dlopen to dynamically load m4_dbas a library.])m4_p([dnlIf you are seeing problems in this area after you confirm that you'relinking with the correct libraries, there are two other things you cantry. First, if your platform supports interlibrary dependencies, werecommend that you change the m4_db Makefile to specify the appropriatethreads library when creating the m4_db shared library, as aninterlibrary dependency. Second, if your application is using dlopento dynamically load m4_db, specify the appropriate thread library onthe link line when you load the application itself.])])m4_hlm4_nlist([dnlm4_bold([I get core dumps when running programs that fork children.])m4_p([dnlm4_db handles should not be shared across process forks, each forkedchild should acquire its own m4_db handles.])])m4_hlm4_nlist([dnlm4_bold([I get reports of uninitialized memory reads and writes whenrunning software analysis tools (for example, Rational Software Corp.'sPurify tool).])m4_p([dnlFor performance reasons, m4_db does not write the unused portions ofdatabase pages or fill in unused structure fields. To turn off theseerrors when running software analysis tools, build with them4_linkpage(M4RELDIR/ref/build_unix/conf, --enable-umrw, --enable-umrw)configuration option.])])m4_hlm4_nlist([dnlm4_bold([m4_db programs or the test suite fail unexpectedly.])m4_p([dnlThe m4_db architecture does not support placing the shared memoryregions on remote filesystems -- for example, the Network File System(NFS) or the Andrew File System (AFS). For this reason, the sharedmemory regions (normally located in the database home directory) mustreside on a local filesystem. See m4_link(M4RELDIR/ref/env/region,Shared Memory Regions) for more information.])m4_p([dnlWith respect to running the test suite, always check to make sure thatTESTDIR is not on a remote mounted filesystem.])])m4_hlm4_nlist([dnlm4_bold([The m4_ref(db_dump185) utility fails to build.])m4_p([dnlThe m4_ref(db_dump185) utility is the utility that supports theconversion of m4_db 1.85 and earlier databases to current databaseformats. If the build errors look something like the following, itmeans the db.h include file being loaded is not a m4_db 1.85 versioninclude file:])m4_indent([dnldb_dump185.c: In function `main':db_dump185.c:210: warning: assignment makes pointer from integer without a castdb_dump185.c:212: warning: assignment makes pointer from integer without a castdb_dump185.c:227: structure has no member named `seq'db_dump185.c:227: `R_NEXT' undeclared (first use in this function)])m4_p([dnlIf the build errors look something like the following, it means thatthe m4_db 1.85 code was not found in the standard libraries:])m4_indent([dnlcc -o db_dump185 db_dump185.old:Unresolved:dbopen])m4_p([dnlTo build m4_ref(db_dump185), the m4_db version 1.85 code must alreadybeen built and available on the system. If the m4_db 1.85 header fileis not found in a standard place, or if the library is not part of thestandard libraries used for loading, you will need to edit yourMakefile, and change the following lines:])m4_indent([dnlDB185INC=DB185LIB=])m4_p([dnlSo that the system m4_db 1.85 header file and library are found; forexample:])m4_indent([dnlDB185INC=/usr/local/includeDB185LIB=-ldb185])])m4_nlistendm4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -