【问题标题】:Compiling GDC on Windows -- where to get GMP and MPFR dependencies?在 Windows 上编译 GDC——从哪里获得 GMP 和 MPFR 依赖项?
【发布时间】:2011-03-02 20:02:16
【问题描述】:

我正在尝试在 Windows 7 上使用 MinGW 的 MSYS compile GDC (v2)

当我到达这一步时:

$ ../configure --enable-languages=d --disable-shared --disable-bootstrap

我明白了:

checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.

尝试使用 --with-gmp 和/或 --with-mpfr 选项来指定它们的位置。

这些库的源代码的副本可以在它们各自的地方找到 托管网站以及ftp://gcc.gnu.org/pub/gcc/infrastructure/。 另请参阅http://gcc.gnu.org/install/prerequisites.html 了解更多信息。 如果您从供应商分发包中获得 GMP 和/或 MPFR,请制作 确保您已经安装了库和头文件。 它们可能位于不同的包中。

这让我回顾了instructions,它指出它需要这些库:

  • libgmp3-dev
  • libmpfr-dev
  • libmpc 开发

所以现在的问题是,我在哪里可以找到这些头文件和/或库?我到处搜索 libgmp3-dev,但找不到任何适用于 Windows 的东西。 (我还在学习*nix,所以对任何东西都不太熟悉。)

谢谢!


更新

于是我尝试make MPFR(我什至不知道它是否是正确的版本),我得到了这个错误:

$ make install
Making install in tests
[...]
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
 /bin/sh ./libtool   --mode=install /bin/install -c   libmpfr.la '/usr/local/lib'
libtool: install: /bin/install -c .libs/libmpfr.lai /usr/local/lib/libmpfr.la
libtool: install: /bin/install -c .libs/libmpfr.a /usr/local/lib/libmpfr.a
libtool: install: chmod 644 /usr/local/lib/libmpfr.a
libtool: install: ranlib /usr/local/lib/libmpfr.a
/bin/sh: /home/Home: No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 127
make[2]: Leaving directory `/home/Home User/mpfr-2.4.2'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/Home User/mpfr-2.4.2'
make: *** [install-recursive] Error 1

有什么想法吗?

【问题讨论】:

  • 查看错误消息中的链接,了解从何处获取这些库。您可能需要从源代码构建它们,但这很容易。您链接的说明页面似乎已过期(建议的版本比错误消息要求的版本旧)。
  • 呃...这不像是我错过了错误消息中的链接;就是这个版本不是我需要的(libgmp 的第 3 版)。

标签: gmp msys d gdc


【解决方案1】:

【讨论】:

  • @Andrej:天哪!非常感谢!! :D
  • @Mehrdad:祝 GDC 在 Windows 上工作顺利。经过多次尝试,我没有运气。我可以构建 GDC,但 GDC 无法为我构建一个简单的项目。
  • @Andrej:是的,我想我会需要它...I can't even get it to build
  • @Mehrdad:我将在今天晚些时候尝试发布有关编译 GDC 的完整说明。我认为您不需要使用 TDM 补丁,因为 MinGW 团队已经开始在 GCC 4.5.3+ 上工作,并且他们拥有可以在 Windows 上编译的修改后的源代码。但无论如何,要在 Windows 上使用 GNU Patch,请使用:patch -p0
  • @Mehrdad:我可以发布构建说明,但无法让 GDC 编译简单的 .d 文件。似乎有一些未定义的引用应该包含在 Phobos lib 文件中,但它们不是。我已经在 GDC 问题跟踪器中发布了有关它的信息。你还需要这些说明吗?
【解决方案2】:

http://gmplib.org/

http://www.mpfr.org/

只需下载源压缩包。至于构建这些,我不记得细节(说明应该很清楚),但我知道您可以将这些 GMP 和 MPFR 放在带有 GCC 的源代码树中,并且 GCC 构建过程将自动负责构建这些。这可能比为它们构建/安装/设置环境变量作为一个离散步骤更容易。

【讨论】:

  • 感谢您提供的链接,但我已经做了很多谷歌搜索,但在任何这些标准站点中都找不到我需要的版本。你有 libgmp-3 的链接吗? (更高或更早的版本似乎不起作用,这就是我问这个问题的原因。)
【解决方案3】:

我总是用它在 Windows 上构建 gdc:http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php

【讨论】:

    【解决方案4】:

    您发布的错误消息包含查找库的链接。您可能需要下载它们的源代码并编译它们,但它们都很容易构建。

    【讨论】:

    • 呃,问题是,我查看了链接,但它们没有正确版本的库——我需要 libgmp-3-dev,它不在那些页面上。 (我没有那么愚蠢地没有注意到错误消息中的链接,哈哈。;)
    • @Mehrdad:您不需要 GMP 版本 3;你需要4.1或更高版本,这是链接的。第一个链接包含错误消息所需的 GMP 和 MPFR 版本的下载。我认为说你需要 GMP 3 的说明已经过时了。
    • 我在第 4 版中尝试过,但我记得遇到了一些错误。我会再试一次,但我认为它不会起作用......
    • 我有点困惑——我需要make图书馆吗?我在 GMP 中没有看到任何 include 文件夹,不确定如何在 MSYS 中“安装”它...(现在我刚刚执行了 make
    • @Mehrdad:查看压缩包中的INSTALL 文件。您通常需要 ./configure; make; make install 为每个这些包,但您将需要 configure 的选项来设置前缀等。
    猜你喜欢
    • 2019-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多