【问题标题】:Error in Compiling FFTW = configure: error: C compiler cannot create executables编译 FFTW 时出错 = 配置:错误:C 编译器无法创建可执行文件
【发布时间】:2014-04-12 01:42:34
【问题描述】:

我正在尝试使用以下说明编译 FFTW:

Download FFTW from http://www.fftw.org/download.html

Unzip and navigate to the appropriate folder.

In order to have a universal (32 + 64bit binary), you will build FFTW four 
separate times (twice for 32 vs. 64 and twice for float vs. double precision) 
and then combine the 32 and 64bit libraries into two fat/universal libraries.

In Terminal, type:
./configure CFLAGS="arch i686"
make
./configure --enable-float CFLAGS="arch i686"
make
mkdir .libs/32
cp libfftw3.a 32/libfftw3.a
cp libfftw3f.a 32/libfftw3f.a
./configure CFLAGS="arch x86_64"
make
./configure --enable-float CFLAGS="arch x86_64"
make
sudo make install
mkdir .libs/64
lipo -create .libs/32/libfftw3.a .libs/64/libfftw3.a -output libfftw3.a
lipo -create .libs/32/libfftw3f.a .libs/64/libfftw3f.a -output libfftw3f.a
cp libfftw3.a /usr/local/lib/libfftw3.a
cp libfftw3f.a /usr/local/lib/libfftw3f.a
To test if the created libraries at fat, type: lipo -info libraryname.a

但是,当我尝试输入第一个终端命令 (./configure) 时,我收到以下错误:

configure: error: C compiler cannot create executables

这是我第一次尝试编译任何东西,所以任何关于特定错误的帮助,甚至只是我理解终端命令和一般编译的资源,将不胜感激!我真的很想学习这些东西,但我什至不知道如何有效地学习它!提前致谢!

这里是 config.log:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by fftw configure 3.3.3, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure CFLAGS=arch i686

## --------- ##
## Platform. ##
## --------- ##

hostname = Davids-Macbook-Pro.local
uname -m = x86_64
uname -r = 12.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64

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

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3
Primary memory available: 8.00 gigabytes
Default processor set: 127 tasks, 865 threads, 4 processors
Load average: 2.04, Mach factor: 2.13
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/David/Library/Enthought/Canopy_64bit/User/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/local/git/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2742: checking for a BSD-compatible install
configure:2810: result: /usr/bin/install -c
configure:2821: checking whether build environment is sane
configure:2871: result: yes
configure:3012: checking for a thread-safe mkdir -p
configure:3051: result: ./install-sh -c -d
configure:3064: checking for gawk
configure:3094: result: no
configure:3064: checking for mawk
configure:3094: result: no
configure:3064: checking for nawk
configure:3094: result: no
configure:3064: checking for awk
configure:3080: found /usr/bin/awk
configure:3091: result: awk
configure:3102: checking whether make sets $(MAKE)
configure:3124: result: yes
configure:3208: checking whether to enable maintainer-specific portions of Makefiles
configure:3217: result: no
configure:3265: checking build system type
configure:3279: result: x86_64-apple-darwin12.5.0
configure:3299: checking host system type
configure:3312: result: x86_64-apple-darwin12.5.0
configure:3750: checking for gcc
configure:3766: found /usr/bin/gcc
configure:3777: result: gcc
configure:4006: checking for C compiler version
configure:4015: gcc --version >&5
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
configure:4026: $? = 0
configure:4015: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
configure:4026: $? = 0
configure:4015: gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:4026: $? = 1
configure:4015: gcc -qversion >&5
clang: error: no input files
configure:4026: $? = 1
configure:4046: checking whether the C compiler works
configure:4068: gcc arch i686   conftest.c  >&5
clang: error: no such file or directory: 'arch'
clang: error: no such file or directory: 'i686'
configure:4072: $? = 1
configure:4110: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "fftw"
| #define PACKAGE_TARNAME "fftw"
| #define PACKAGE_VERSION "3.3.3"
| #define PACKAGE_STRING "fftw 3.3.3"
| #define PACKAGE_BUGREPORT "fftw@fftw.org"
| #define PACKAGE_URL ""
| #define PACKAGE "fftw"
| #define VERSION "3.3.3"
| #define FFTW_ENABLE_ALLOCA 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4115: error: in `/Users/David/documents/ISSE Source/fftw-3.3.3':
configure:4117: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-apple-darwin12.5.0
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='arch i686'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_MPICC_set=
ac_cv_env_MPICC_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-apple-darwin12.5.0
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} "/Users/David/documents/ISSE Source/fftw-3.3.3/missing" --run aclocal-1.11'
ALLOCA=''
ALTIVEC_CFLAGS=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AR=''
AS=''
AUTOCONF='${SHELL} "/Users/David/documents/ISSE Source/fftw-3.3.3/missing" --run autoconf'
AUTOHEADER='${SHELL} "/Users/David/documents/ISSE Source/fftw-3.3.3/missing" --run autoheader'
AUTOMAKE='${SHELL} "/Users/David/documents/ISSE Source/fftw-3.3.3/missing" --run automake-1.11'
AVX_CFLAGS=''
AWK='awk'
CC='gcc'
CCDEPMODE=''
CFLAGS='arch i686'
CHECK_PL_OPTS=''
COMBINED_THREADS_FALSE=''
COMBINED_THREADS_TRUE=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
C_FFTW_R2R_KIND=''
C_MPI_FINT=''
DEFS=''
DEPDIR=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS=''
FGREP=''
FLIBS=''
GREP=''
HAVE_ALTIVEC_FALSE=''
HAVE_ALTIVEC_TRUE='#'
HAVE_AVX_FALSE=''
HAVE_AVX_TRUE='#'
HAVE_NEON_FALSE=''
HAVE_NEON_TRUE='#'
HAVE_SSE2_FALSE=''
HAVE_SSE2_TRUE='#'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LDOUBLE_FALSE=''
LDOUBLE_TRUE='#'
LIBOBJS=''
LIBQUADMATH=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} "/Users/David/documents/ISSE Source/fftw-3.3.3/missing" --run makeinfo'
MANIFEST_TOOL=''
MKDIR_P='./install-sh -c -d'
MPICC=''
MPILIBS=''
MPIRUN=''
MPI_FALSE=''
MPI_TRUE=''
NEON_CFLAGS=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OCAMLBUILD=''
OPENMP_CFLAGS=''
OPENMP_FALSE=''
OPENMP_TRUE=''
OTOOL64=''
OTOOL=''
PACKAGE='fftw'
PACKAGE_BUGREPORT='fftw@fftw.org'
PACKAGE_NAME='fftw'
PACKAGE_STRING='fftw 3.3.3'
PACKAGE_TARNAME='fftw'
PACKAGE_URL=''
PACKAGE_VERSION='3.3.3'
PATH_SEPARATOR=':'
POW_LIB=''
PRECISION='d'
PREC_SUFFIX=''
PTHREAD_CC=''
PTHREAD_CFLAGS=''
PTHREAD_LIBS=''
QUAD_FALSE=''
QUAD_TRUE='#'
RANLIB=''
SED=''
SET_MAKE=''
SHARED_VERSION_INFO='6:2:3'
SHELL='/bin/sh'
SINGLE_FALSE=''
SINGLE_TRUE='#'
SMP_FALSE=''
SMP_TRUE=''
SSE2_CFLAGS=''
STACK_ALIGN_CFLAGS=''
STRIP=''
THREADLIBS=''
THREADS_FALSE=''
THREADS_TRUE=''
VERSION='3.3.3'
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
ac_ct_F77=''
acx_pthread_config=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin12.5.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin12.5.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-apple-darwin12.5.0'
host_alias=''
host_cpu='x86_64'
host_os='darwin12.5.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} '\''/Users/David/documents/ISSE Source/fftw-3.3.3/install-sh'\'''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/./install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "fftw"
#define PACKAGE_TARNAME "fftw"
#define PACKAGE_VERSION "3.3.3"
#define PACKAGE_STRING "fftw 3.3.3"
#define PACKAGE_BUGREPORT "fftw@fftw.org"
#define PACKAGE_URL ""
#define PACKAGE "fftw"
#define VERSION "3.3.3"
#define FFTW_ENABLE_ALLOCA 1

configure: exit 77

【问题讨论】:

  • 你有config.log吗?这是 Mac 吗?
  • 是的,我使用的是运行 OSX 10.8.5 的 Macbook pro。我将使用 config.log 更新原始帖子

标签: compilation configure fftw


【解决方案1】:

我不知道您从哪里获得您在问题中发布的文档,但它有一个错字。具体来说,CFLAGS 变量在每个 ./configure 行中都是错误的。他们应该是

./configure CFLAGS="-arch i686"
./configure --enable-float CFLAGS="-arch i686"
./configure --enable-float CFLAGS="-arch x86_64"

文档中缺少 - 并导致 gcc 失败,因为它在第一次运行时无法分别理解 archi686 选项。


请注意,如果您不需要 FFTW 的通用二进制文件,安装它的命令很简单

$ ./configure
$ make
$ sudo make install

【讨论】:

    猜你喜欢
    • 2013-09-24
    • 2012-05-08
    • 1970-01-01
    • 2021-06-28
    • 2021-04-23
    • 2019-02-03
    • 1970-01-01
    • 2020-01-21
    • 2018-08-02
    相关资源
    最近更新 更多