在64位Windows 7(msys2 / mingw64)上构建GMP 6.1.0:由于mp

编程入门 行业动态 更新时间:2024-10-11 05:29:22
在64位Windows 7(msys2 / mingw64)上构建GMP 6.1.0:由于mp_limb_t不是64位,配置失败(Building GMP 6.1.0 on 64 bit Windows 7 (msys2/mingw64): configure fails due to mp_limb_t is not 64 bits)

我尝试在我的Windows 7 64位计算机上构建GMP,因此我运行config.guess并获得k10-pc-msys 。 (我使用msys2和mingw64)

然后我跑了

./configure --prefix=/c/gmp-6.1.0 --build=k10-pc-msys --enable-cxx

但这退出了这个错误

checking size of mp_limb_t... 4 configure: error: Oops, mp_limb_t is 32 bits, but the assembler code in this configuration expects 64 bits.

所以我再次使用额外的ABI=64运行配置(考虑强制mp_limb_t为64位),但这结束时出现了同样的错误。 在此之后我尝试添加CC="g++" (思考--enable-cxx需要g++ ),但我又一次得到了这个错误。

我搜索了很多关于这一点,并发现一个问题报告给GitHub上的juliaLang看起来接近我的问题,但解决方案似乎不适合我,因为我没有使用Julia。

有谁知道这个错误,并找到了解决方法吗?

注意 :我看到msys2已经安装,我可以使用它。 但是我的程序的运行时间只增加了大约70%,只是从msys2安装了GMP构建NTL。 我认为这是因为它不是为我的计算机构建的,所以它根本没有优化。

编辑 :即使没有任何设置(只是./configure --prefix=/c/gmp-6.1.0 )确实退出并出现相同的错误。

背景 :我想使用NTL的线程安全构建。 但是为了构建NTL线程安全,我必须使用GMP。

I try to build GMP on my Windows 7 64 bit computer, so I run the config.guess and get k10-pc-msys. (I use msys2 and mingw64)

Then I ran

./configure --prefix=/c/gmp-6.1.0 --build=k10-pc-msys --enable-cxx

But this quits with this error

checking size of mp_limb_t... 4 configure: error: Oops, mp_limb_t is 32 bits, but the assembler code in this configuration expects 64 bits.

So I ran the config again with an additional ABI=64 (thinking to force mp_limb_t to be 64 bit), but this ends in the same error. After this I tried to add CC="g++" (thinking --enable-cxx needs g++), but once again I get this error.

I googled a lot about this and found one issue reported to juliaLang on GitHub that looks close to my problem, but the solution seems not to work for me, since I'm not using Julia.

Does anyone know this error and found a way to fix it?

Notice: I see that msys2 already has installed and I can use it. But the runtime of my program increased by about 70% only from building NTL with the installed GMP from msys2. I think this is because it was not build for my computer so it is not optimized at all.

Edit: Even without any settings (just ./configure --prefix=/c/gmp-6.1.0) does quit with the same error.

Background: I want to use the thread safe build of NTL. But to build NTL thread safe, I have to use GMP.

最满意答案

这可以通过在configure命令中添加--host=x86_64-w64-mingw32来解决。 通常建议使用此软件来构建使用Autotools或某种形式的Windows 64位配置脚本的软件。

您可以在MinGW-w64 wiki上阅读此页面以了解有关这些内容的更多信息。

This is solved by adding --host=x86_64-w64-mingw32 to the configure command. This is generally recommended to build software that uses Autotools or some form of configure script for Windows 64-bit.

You can read this page on the MinGW-w64 wiki to learn more about these things.

更多推荐

本文发布于:2023-07-30 14:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1338836.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Windows   mp   GMP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!