perlhpux.html

来自「perl教程」· HTML 代码 · 共 601 行 · 第 1/3 页

HTML
601
字号
<tr><td>creat,<td>fgetpos,<td>fopen,
<tr><td>freopen,<td>fsetpos,<td>fstat,
<tr><td>fstatvfs,<td>fstatvfsdev,<td>ftruncate,
<tr><td>ftw,<td>lockf,<td>lseek,
<tr><td>lstat,<td>mmap,<td>nftw,
<tr><td>open,<td>prealloc,<td>stat,
<tr><td>statvfs,<td>statvfsdev,<td>tmpfile,
<tr><td>truncate,<td>getrlimit,<td>setrlimit</table></p>
<p>Another drawback is only valid for Perl versions before 5.6.0.  This
drawback is that the seek and tell functions (both the builtin version
and POSIX module version) will not perform correctly.</p>
<p>It is strongly recommended that you use this flag when you run
Configure.  If you do not do this, but later answer the question about
large files when Configure asks you, you may get a configuration that
cannot be compiled, or that does not function as expected.</p>
<p>
</p>
<h2><a name="threaded_perl_on_hpux">Threaded Perl on HP-UX</a></h2>
<p>It is possible to compile a version of threaded Perl on any version of
HP-UX before 10.30, but it is strongly suggested that you be running on
HP-UX 11.00 at least.</p>
<p>To compile Perl with threads, add -Dusethreads to the arguments of
Configure.  Verify that the -D_POSIX_C_SOURCE=199506L compiler flag is
automatically added to the list of flags.  Also make sure that -lpthread
is listed before -lc in the list of libraries to link Perl with. The
hints provided for HP-UX during Configure will try very hard to get
this right for you.</p>
<p>HP-UX versions before 10.30 require a separate installation of a POSIX
threads library package. Two examples are the HP DCE package, available
on &quot;HP-UX Hardware Extensions 3.0, Install and Core OS, Release 10.20,
April 1999 (B3920-13941)&quot; or the Freely available PTH package, available
on H.Merijn's site (http://mirrors.develooper.com/hpux/).</p>
<p>If you are going to use the HP DCE package, the library used for threading
is /usr/lib/libcma.sl, but there have been multiple updates of that
library over time. Perl will build with the first version, but it
will not pass the test suite. Older Oracle versions might be a compelling
reason not to update that library, otherwise please find a newer version
in one of the following patches: PHSS_19739, PHSS_20608, or PHSS_23672</p>
<p>reformatted output:</p>
<pre>
  d3:/usr/lib 106 &gt; what libcma-*.1
  libcma-00000.1:
     HP DCE/9000 1.5               Module: libcma.sl (Export)
                                   Date: Apr 29 1996 22:11:24
  libcma-19739.1:
     HP DCE/9000 1.5 PHSS_19739-40 Module: libcma.sl (Export)
                                   Date: Sep  4 1999 01:59:07
  libcma-20608.1:
     HP DCE/9000 1.5 PHSS_20608    Module: libcma.1 (Export)
                                   Date: Dec  8 1999 18:41:23
  libcma-23672.1:
     HP DCE/9000 1.5 PHSS_23672    Module: libcma.1 (Export)
                                   Date: Apr  9 2001 10:01:06
  d3:/usr/lib 107 &gt;</pre>
<p>If you choose for the PTH package, use swinstall to install pth in
the default location (/opt/pth), and then make symbolic links to the
libraries from /usr/lib</p>
<pre>
  <span class="comment"># cd /usr/lib</span>
  <span class="comment"># ln -s /opt/pth/lib/libpth* .</span>
</pre>
<p>For building perl to support Oracle, it needs to be linked with libcl
and libpthread. So even if your perl is an unthreaded build, these
libraries might be required. See &quot;Oracle on HP-UX&quot; below.</p>
<p>
</p>
<h2><a name="64bit_perl_on_hpux">64-bit Perl on HP-UX</a></h2>
<p>Beginning with HP-UX 11.00, programs compiled under HP-UX can take
advantage of the LP64 programming environment (LP64 means Longs and
Pointers are 64 bits wide), in which scalar variables will be able
to hold numbers larger than 2^32 with complete precision.  Perl has
proven to be consistent and reliable in 64bit mode since 5.8.1 on
all HP-UX 11.xx.</p>
<p>As of the date of this document, Perl is fully 64-bit compliant on
HP-UX 11.00 and up for both cc- and gcc builds. If you are about to
build a 64-bit perl with GNU gcc, please read the gcc section carefully.</p>
<p>Should a user have the need for compiling Perl in the LP64 environment,
use the -Duse64bitall flag to Configure.  This will force Perl to be
compiled in a pure LP64 environment (with the +DD64 flag for HP C-ANSI-C,
with no additional options for GNU gcc 64-bit on PA-RISC, and with
-mlp64 for GNU gcc on Itanium).
If you want to compile Perl using gcc, you will have to get a version of
the compiler that supports 64-bit operations.)</p>
<p>You can also use the -Duse64bitint flag to Configure.  Although there
are some minor differences between compiling Perl with this flag versus
the -Duse64bitall flag, they should not be noticeable from a Perl user's
perspective. When configuring -Duse64bitint using a 64bit gcc on a
pa-risc architecture, -Duse64bitint is silently promoted to -Duse64bitall.</p>
<p>In both cases, it is strongly recommended that you use these flags when
you run Configure.  If you do not use do this, but later answer the
questions about 64-bit numbers when Configure asks you, you may get a
configuration that cannot be compiled, or that does not function as
expected.</p>
<p>
</p>
<h2><a name="oracle_on_hpux">Oracle on HP-UX</a></h2>
<p>Using perl to connect to Oracle databases through DBI and DBD::Oracle
has caused a lot of people many headaches. Read README.hpux in the
DBD::Oracle for much more information. The reason to mention it here
is that Oracle requires a perl built with libcl and libpthread, the
latter even when perl is build without threads. Building perl using
all defaults, but still enabling to build DBD::Oracle later on can be
achieved using</p>
<pre>
  Configure -A prepend:libswanted='cl pthread ' ...</pre>
<p>Do not forget the space before the trailing quote.</p>
<p>Also note that this does not (yet) work with all configurations,
it is known to fail with 64-bit versions of GCC.</p>
<p>
</p>
<h2><a name="gdbm_and_threads_on_hpux">GDBM and Threads on HP-UX</a></h2>
<p>If you attempt to compile Perl with threads on an 11.X system and also
link in the GDBM library, then Perl will immediately core dump when it
starts up.  The only workaround at this point is to relink the GDBM
library under 11.X, then relink it into Perl.</p>
<p>
</p>
<h2><a name="nfs_filesystems_and_utime_2__on_hpux">NFS filesystems and <a href="../../lib/Pod/perlfunc.html#item_utime"><code>utime(2)</code></a> on HP-UX</a></h2>
<p>If you are compiling Perl on a remotely-mounted NFS filesystem, the test
io/fs.t may fail on test #18.  This appears to be a bug in HP-UX and no
fix is currently available.</p>
<p>
</p>
<h2><a name="perl_p_and____and_hpux">perl -P and // and HP-UX</a></h2>
<p>If HP-UX Perl is compiled with flags that will cause problems if the
-P flag of Perl (preprocess Perl code with the C preprocessor before
perl sees it) is used.  The problem is that <code>//</code>, being a C++-style
until-end-of-line comment, will disappear along with the remainder
of the line.  This means that common Perl constructs like</p>
<pre>
  <span class="regex">s/foo//</span><span class="operator">;</span>
</pre>
<p>will turn into illegal code</p>
<pre>
  s/foo</pre>
<p>The workaround is to use some other quoting separator than <code>&quot;/&quot;</code>,
like for example <code>&quot;!&quot;</code>:</p>
<pre>
  <span class="regex">s!foo!!</span><span class="operator">;</span>
</pre>
<p>
</p>
<h2><a name="hpux_kernel_parameters__maxdsiz__for_compiling_perl">HP-UX Kernel Parameters (maxdsiz) for Compiling Perl</a></h2>
<p>By default, HP-UX comes configured with a maximum data segment size of
64MB.  This is too small to correctly compile Perl with the maximum
optimization levels.  You can increase the size of the maxdsiz kernel
parameter through the use of SAM.</p>
<p>When using the GUI version of SAM, click on the Kernel Configuration
icon, then the Configurable Parameters icon.  Scroll down and select
the maxdsiz line.  From the Actions menu, select the Modify Configurable
Parameter item.  Insert the new formula into the Formula/Value box.
Then follow the instructions to rebuild your kernel and reboot your
system.</p>
<p>In general, a value of 256MB (or &quot;256*1024*1024&quot;) is sufficient for
Perl to compile at maximum optimization.</p>
<p>
</p>
<hr />
<h1><a name="nss_delete_core_dump_from_op_pwent_or_op_grent">nss_delete core dump from op/pwent or op/grent</a></h1>
<p>You may get a bus error core dump from the op/pwent or op/grent
tests. If compiled with -g you will see a stack trace much like
the following:</p>
<pre>
  <span class="comment">#0  0xc004216c in  () from /usr/lib/libc.2</span>
  <span class="comment">#1  0xc00d7550 in __nss_src_state_destr () from /usr/lib/libc.2</span>
  <span class="comment">#2  0xc00d7768 in __nss_src_state_destr () from /usr/lib/libc.2</span>
  <span class="comment">#3  0xc00d78a8 in nss_delete () from /usr/lib/libc.2</span>
  <span class="comment">#4  0xc01126d8 in endpwent () from /usr/lib/libc.2</span>
  <span class="comment">#5  0xd1950 in Perl_pp_epwent () from ./perl</span>
  <span class="comment">#6  0x94d3c in Perl_runops_standard () from ./perl</span>
  <span class="comment">#7  0x23728 in S_run_body () from ./perl</span>
  <span class="comment">#8  0x23428 in perl_run () from ./perl</span>
  <span class="comment">#9  0x2005c in main () from ./perl</span>
</pre>
<p>The key here is the <code>nss_delete</code> call.  One workaround for this
bug seems to be to create add to the file <em>/etc/nsswitch.conf</em>
(at least) the following lines</p>
<pre>
  group: files
  passwd: files</pre>
<p>Whether you are using NIS does not matter.  Amazingly enough,
the same bug also affects Solaris.</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Jeff Okamoto &lt;<a href="mailto:okamoto@corp.hp.com">okamoto@corp.hp.com</a>&gt;
H.Merijn Brand &lt;<a href="mailto:h.m.brand@xs4all.nl">h.m.brand@xs4all.nl</a>&gt;</p>
<p>With much assistance regarding shared libraries from Marc Sabatella.</p>
<p>
</p>
<hr />
<h1><a name="date">DATE</a></h1>
<p>Version 0.7.6: 2005-12-20</p>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?