📄 install.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link HREF="http://www.drhanson.net/" REV="made" TITLE="David R. Hanson"><title>CII Installation Guide</title></head><body><h1>CII Installation Guide</h1><p ALIGN="LEFT"><strong><a HREF="http://drh.home.dyndns.org/">David R. Hanson</a>,Google</strong></p><h2>Contents</h2><dir> <li><a HREF="#intro">Introduction</a></li> <li><a HREF="#unix">Installation on UNIX</a></li> <li><a HREF="#win32">Installation on Windows 95/NT</a></li> <li><a HREF="#bugs">Reporting Bugs</a></li></dir><h2><a NAME="intro">Introduction</a></h2><p>This page describes how to install the software from my book <cite><aHREF="http://www.awl.com/cseng/titles/0-201-49841-3/">C Interfaces and Implementations:Techniques for Creating Reusable Software</a></cite> (<aHREF="http://cseng.aw.com/seriesdetail.qry?SeriesID=4">Addison-Wesley ProfessionalComputing Series</a>, 1997, ISBN 0-201-49841-3). A CII distribution includes the followingfiles and directories.</p><table BORDER="0" CELLPADDING="0" CELLSPACING="2"> <tr> <td><code><a HREF="README">README</a></code></td> <td></td> <td>distribution identification</td> </tr> <tr> <td><code><a HREF="packing.lst">packing.lst</a></code></td> <td></td> <td>a list of the files in the distribution</td> </tr> <tr> <td><code><a HREF="install.html">install.html</a></code></td> <td></td> <td>this file</td> </tr> <tr> <td><code><a HREF="history.html">history.html</a></code></td> <td></td> <td>describes the distribution's revision history</td> </tr> <tr> <td><code><a HREF="makefile">makefile</a></code></td> <td></td> <td>UNIX makefile</td> </tr> <tr> <td><code><a HREF="makefile.nt">makefile.nt</a></code></td> <td></td> <td>Windows 95/NT makefile</td> </tr> <tr> <td><code><a HREF="include">include</a>/*.h</code></td> <td></td> <td>interfaces (<code>.h</code> files) for the CII library</td> </tr> <tr> <td><code><a HREF="src">src</a>/*.c</code></td> <td></td> <td>implementations (<code>.c</code> files) for the CII library</td> </tr> <tr> <td><code><a HREF="examples">examples</a>/*.[ch]</code></td> <td></td> <td>example clients, including those from the book</td> </tr></table><p>The CII distributions are numbered <em>X.Y</em> where <em>X</em> is the major releasenumber and <em>Y</em> is the minor release number. Starting with major release 1, minorreleases fix bugs and perhaps make improvements, but do <strong>not</strong> changeinterfaces. The interfaces and the compiled library are compatible with earlier and laterminor releases; for example, a program compiled with the 1.3 release is compatible withrelease 1.8 and vice versa. Major releases occur when one or more interfaces are changedor extended, or when new interfaces are added.</p><p>It's usually best to follow a similar naming scheme when installing CII so thatprograms compiled with one major release can be recompiled even after a subsequent majorrelease has been installed. The minor release number can be omitted. On UNIX, for example,this convention can be accomplished by installing the interfaces in, say, <code>/usr/local/lib/cii/</code><em>X</em><code>/include</code>,where <em>X</em> is the major release number, and installing the library, <code>libcii.a</code>,in <code>/usr/local/lib/cii/</code><em>X</em><code>/libcii.a</code>.</p><p>At UNIX sites with multiple platforms (architectures and OSes) and a single <code>/usr/local</code>hierarchy, the library can be installed in a platform-specific location below <code>/usr/local/cii/</code><em>X</em>,e.g., <code>/usr/local/lib/cii/</code><em>X</em><code>/alpha-osf/libcii.a</code>. Theinterfaces are machine independent and thus don't need platform-specific locations.Similar conventions can be used on Windows 95/NT.</p><p>Following this scheme permits the actual installation locations to be confined tospecifying prefixes, like <code>/usr/local/lib/cii/</code><em>X</em><code>/include</code>and <code>/usr/local/lib/cii/</code><em>X</em><code>/</code>, in makefiles; programs caninclude interfaces by giving just the names of their header files.</p><p>On UNIX systems, it's also useful to plant release-independent symbol link to thelatest CII release, e.g., make <code>/usr/local/include/cii</code> point to <code>/usr/local/lib/cii/</code><em>X</em><code>/include</code>and <code>/usr/local/lib/libcii.a</code> point to <code>/usr/local/lib/cii/</code><em>X</em><code>/libcii.a</code>.</p><p><strong>NB</strong>: If you use several compilers, you may need compiler-specificvariants of <code>libcii.a</code>, and thus use platform names that denote a specificarchitecture, OS, <strong>and</strong> compiler. For example, the Text interface usessmall structures and passes them by value, and, on some platforms, one C compiler mightgenerate code for <code>src/text.c</code> that is incompatible with another compiler. Thisproblem is not specific to CII; it can occur with any library.</p><p>The installation makefile is designed so that CII can be installed from a read-onlyfile system or directory, which is common in networked environments, so the distributioncan be unloaded on a central file server. If you're installing CII on a UNIX system,continue with the next section. If you're installing CII on a Windows NT 4.0 or Windows 95system, read the next section first, then follow the <a HREF="#win32">Windows NT/95instructions</a>.</p><h2><a NAME="unix">Installation on UNIX</a></h2><p>The CII components (include files and the library) are installed in a single <em>builddirectory</em>. On multi-platform systems supported by a central file server, it's commonto store the build directory in a location specific to the platform and to the version ofCII, as suggested above. For example, installation on a UNIX system involves the followingsteps. Below, the build directory is referred to as <code>BUILDDIR</code>, and thecommands shown assume the distribution directory is the current working directory.If you want to build in the distribution directory, leave <code>BUILDDIR</code>undefined and start at step 3.<ol> <li>Create the build directory, using a version- and platform-specific naming convention as suggested above, and record the name of this directory in the <code>BUILDDIR</code> environment variable:<blockquote> <pre>% setenv BUILDDIR /usr/local/lib/cii/1/alpha-osf/% mkdir -p $BUILDDIR</pre> </blockquote> <p>The trailing slash is required, because <code>BUILDDIR</code> is concatenated with file names in the <code>makefile</code>, e.g., <code>$(BUILDDIR)atom$O</code>. Here and below, commands assume the C shell. Also, you'll need a version of <code>mkdir</code> that supports the <code>-p</code> option, which creates intermediate directories as necessary.</p> </li> <li>Create the include directory in the build directory, and copy the include files:<blockquote> <pre>% mkdir ${BUILDDIR}include% cp -p include/*.h ${BUILDDIR}include</pre> </blockquote> <p>Some users create a symbolic link to the include directory in the distribution instead of making repeated copies of the include files. For example, at Princeton, the distributions are stored under <code>/proj/pkg/cii</code>, so the include files are "installed" by creating one symbolic link:</p> <blockquote> <pre>% ln -s /proj/pkg/cii/1.1/include ${BUILDDIR}include</pre> </blockquote> </li> <li>Build everything using the appropriate make command for your environment:<blockquote> <table BORDER="0" WIDTH="100%" CELLPADDING="0" CELLSPACING="2"> <tr> <td>ALPHA OSF/1 V3.2A:</td> <td><code>% make CC='cc -std1 -Dalpha' AS='as -Dalpha'</code></td> </tr> <tr> <td>MIPS IRIX 6.2:</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -