【问题标题】:How do I compile Perl 5.10 with thread support under FreeBSD 7.1?如何在 FreeBSD 7.1 下编译带有线程支持的 Perl 5.10?
【发布时间】:2010-10-23 07:01:01
【问题描述】:

我试图在我的 FreeBSD 7.1 (BSD) 服务器上编译 Perl 5.10,但是当我运行配置脚本并回答问题时,我收到以下错误:

...POSTIX threads should be supported by FreeBSD 7.1 ... but your system is missing the shared libc_r.

通过谷歌搜索找到了安装 gethostnamadr.c 的方法,这很好,除了两件事:

  1. 我不知道把这个文件放在哪里
  2. 如果 Configure 想要查看 libc_r,这如何解决我的问题?

【问题讨论】:

    标签: perl multithreading compilation freebsd


    【解决方案1】:

    要在 FreeBSD 7.* 上启用 Perl 5.10 线程,您只需使用patch 应用以​​下补丁即可。然后,您可以使用 -Dusethreads 构建 perl 或回答 Configure 文件问题以启用线程,一切顺利。我还没有进行任何重要的测试或比较,但是一切都可以正常编译,包括线程库,并且我所有的 Perl 程序都可以正常工作。

    --- hints/freebsd.sh 2008/10/20 04:59:30 1.1
    +++ hints/freebsd.sh 2008/10/20 22:49:29
    @@ -211,6 +211,14 @@
    exit 1
    ;;
    
    + 7.*)
    + # 7.x doesn't install libc_r by default, and Configure
    + # would fail in the code following
    + #
    + # gethostbyaddr_r() appears to have been implemented in 6.x+
    + ldflags="-pthread $ldflags"
    + ;;
    +
    *)
    if [ ! -r "$lc_r" ]; then
    cat <<EOM >&4 
    

    编辑:我忘记了我的参考;在这里查看更多信息:http://www.gossamer-threads.com/lists/perl/porters/232518?nohighlight=1#232518

    【讨论】:

    • 似乎是 Perl 的 freebsd 提示文件中的一个错误。您是否已将此提交回上游到 p5p?
    • 我没有提交它,因为它不是我的解决方案。我很确定 Perl 和 BSD 的人都知道它,因为有一些暗示它将在 7.2 中修复。
    【解决方案2】:

    与 Spolsky 所说的“perl 几乎被遗忘了”相反...... perl 非常活跃。

    您还没有说明您安装了哪个版本的 FreeBSD...但是假设您安装了最少的 FreeBSD 7.1,那么您无法安装线程库或线程库不在库路径中。

    注意 libc 是一个通用的“c”库,而 libc_r 是该文件的线程安全版本。一些 2005 年的谷歌结果表明 libc_r 已被弃用。

    考虑到这一点,您很可能正处于“修订冲突”之中。遗憾的是,FreeBSD 本身并没有提供 perl 的线程安全版本,但是,它们确实打包了 perl 5.10 和几个更​​高版本。我发现这个链接很有用:

    http://www.nabble.com/How---where-to-get-a-Perl-that-has-threads--td22270858.html

    您可能还想尝试安装 FreeBSD 附带的 p5-fork 库

    http://www.nabble.com/How---where-to-get-a-Perl-that-has-threads--td22270858.html

    【讨论】:

    • 我在发布自己的答案后看到了您的回复。感谢您的链接。我还更新了我的问题以反映 BSD 版本号。
    猜你喜欢
    • 2013-02-26
    • 2017-03-16
    • 2015-08-03
    • 1970-01-01
    • 2011-12-23
    • 1970-01-01
    • 2014-01-02
    • 1970-01-01
    • 2020-09-19
    相关资源
    最近更新 更多