【问题标题】:Installing fftw--Unable to guess build type安装 fftw--无法猜测构建类型
【发布时间】:2025-12-08 16:20:05
【问题描述】:

我正在尝试安装 FFTW,当我到达 ./configure --enable-mpi --enable-type-prefix --enable-float 命令并运行它时,这是我得到的错误。我该如何克服呢?如果有帮助,我会在 Windows 10 上使用 Cygwin。

$ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking type prefix for installed files... (none) checking for vendor's cc to be used instead of gcc... checking for cc... cc checking for C compiler default output... 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 cc accepts -g... yes checking for cc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of cc... gcc3 checking whether we are using gcc 2.90 or later... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... (cached) yes checking for ranlib... ranlib checking whether ln -s works... yes checking build system type... ./config.guess: unable to guess system type

This script, last modified 2003-02-22, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from

    ftp://ftp.gnu.org/pub/gnu/config/

If the version you run (./config.guess) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system.

config.guess timestamp = 2003-02-22

uname -m = x86_64 uname -r = 3.1.2(0.340/5/3) uname -s = CYGWIN_NT-10.0 uname -v = 2019-12-21 15:25

/usr/bin/uname -p = unknown /bin/uname -X     =

hostinfo               = /bin/universe          = /usr/bin/arch -k    
= /bin/arch              = x86_64 /usr/bin/oslevel       = /usr/convex/getsysinfo =

UNAME_MACHINE = x86_64 UNAME_RELEASE = 3.1.2(0.340/5/3) UNAME_SYSTEM 
= CYGWIN_NT-10.0 UNAME_VERSION = 2019-12-21 15:25 configure: error: cannot guess build type; you must specify one

configure: error: cannot guess build type; you must specify one

我现在得到错误:

我现在得到错误:

> mpicc    main.o  run.o  predict.o begrun.o endrun.o global.o
> timestep.o  init.o restart.o  io.o accel.o   read_ic.o  ngb.o system.o
> allocate.o  density.o gravtree.o hydra.o  driftfac.o domain.o 
> allvars.o potential.o forcetree.o   peano.o gravtree_forcetest.o
> pm_periodic.o pm_nonperiodic.o longrange.o   -g  -L/usr/lib 
> -L/usr/local/lib -lgsl -lgslcblas -lm -L/usr/local/lib -lsrfftw_mpi -lsfftw_mpi -lsrfftw -lsfftw    -o  Gadget2 /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld:
> cannot find -lsrfftw_mpi
> /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld:
> cannot find -lsfftw_mpi collect2: error: ld returned 1 exit status
> make: *** [Makefile:243: Gadget2] Error 1

【问题讨论】:

  • fftw3 包已经在 Cygwin 中可用。为什么需要 mpi 版本?
  • 一般来说,构建 Cygwin 包的通常做法是在 autoreconf 之前运行 configure 。如果您查看 fftw3 的 Cygwin 源包,当前的 Cygwin 包就是以这种方式构建的。
  • 嗨,我正在按照说明使用 Cygwin 运行 Gadget2 代码。我无法克服错误。
  • Gadget2 似乎已老化。它来自 2005 年,需要 fftw 版本 2。在自己的网站上FFTW 2.1.5 is the stable release of FFTW2, last updated in 1999. FFTW 2.1.5 is obsolete, but because its API is incompatible with that of version 3.x, we continue to distribute it for those users who require backwards compatibility.
  • 我尝试使用该版本,但仍然卡在该错误上:(

标签: linux cygwin fftw


【解决方案1】:

fftw-2.1.5 太旧了,需要建议才能在最近的 Cygwin 下正确配置。

$ ./configure --enable-mpi --enable-type-prefix --enable-float  --build=x86_64-pc-cygwin

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
....
config.status: creating mpi/Makefile
config.status: creating fftw.spec
config.status: creating fftw/config.h
config.status: creating fftw/fftw.h
config.status: executing depfiles commands

我不会打赌你会用 MPI 和 HDF5 干净地运行,因为它们也比在 Gadget2 上测试的那些更新

【讨论】: