web-dev-qa-db-ja.com

構成:エラー:Cコンパイラはビルド中に実行可能ファイルを作成できませんRubyソースから

Stackoverflowで同様の質問をいくつか確認しましたが、まだ回答が見つかりません。

ここで説明するように、Rubyソースからビルドしようとしています: https://www.Ruby-lang.org/en/installation/#building-from-source

ここで私が得ているもの:

ubuntu@saucy1:~/Ruby-2.1.1$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking Host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/ubuntu/Ruby-2.1.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

更新しました:

システムは新品で、Ubuntu 13.10のクラウドイメージを使用しています。ダウンロードは http://uec-images.ubuntu.com/saucy/current/saucy-server-cloudimg-AMD64-disk1.img

このクラウド仮想マシンをオープンスタックソフトウェアで作成しました。

そして、私はこのコマンドでgccをインストールしました:

Sudo apt-get install gcc

Gccの現在のバージョン:

#gcc -v

Using built-in specs.
gcc: error: missing argument to ‘-march=’
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-10ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,Java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-Java-awt=gtk --enable-gtk-cairo --with-Java-home=/usr/lib/jvm/Java-1.5.0-gcj-4.8-AMD64/jre --enable-Java-home --with-jvm-root-dir=/usr/lib/jvm/Java-1.5.0-gcj-4.8-AMD64 --with-jvm-jar-dir=/usr/lib/jvm-exports/Java-1.5.0-gcj-4.8-AMD64 --with-Arch-directory=AMD64 --with-ecj-jar=/usr/share/Java/Eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-Arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --Host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)

編集:

ubuntu@saucy1:~$ echo CFLAGS=$CFLAGS
CFLAGS=

ubuntu@saucy1:~$ echo CC=$CC
CC=

ubuntu@saucy1:~$ gcc -dumpmachine
x86_64-linux-gnu

ubuntu@saucy1:~$ gcc -dumpspecs
*cc1_cpu:
%{march=native:%>march=native %:local_cpu_detect(Arch)   %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)}} %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}

編集:

ubuntu@saucy1:~/Ruby-2.1.1$ ./configure CFLAGS="-march=x86-64 -mtune=x86-64"
checking build system type... x86_64-unknown-linux-gnu
checking Host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... no
checking for gcc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/home/ubuntu/Ruby-2.1.1':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

更新された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 configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure CFLAGS=-march=native -mtune=native

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

hostname = saucy1
uname -m = x86_64
uname -r = 3.11.0-15-generic
uname -s = Linux
uname -v = #25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014

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

/bin/Arch              = unknown
/usr/bin/Arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games


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

configure:2904: checking build system type
configure:2918: result: x86_64-unknown-linux-gnu
configure:3018: checking Host system type
configure:3031: result: x86_64-unknown-linux-gnu
configure:3051: checking target system type
configure:3064: result: x86_64-unknown-linux-gnu
configure:3544: checking for gcc
configure:3560: found /usr/bin/gcc
configure:3571: result: gcc
configure:3800: checking for C compiler version
configure:3809: gcc --version >&5
gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc: error: missing argument to '-march='
configure:3820: $? = 0
configure:3809: gcc -v >&5
Using built-in specs.
gcc: error: missing argument to '-march='
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-10ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,Java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-Java-awt=gtk --enable-gtk-cairo --with-Java-home=/usr/lib/jvm/Java-1.5.0-gcj-4.8-AMD64/jre --enable-Java-home --with-jvm-root-dir=/usr/lib/jvm/Java-1.5.0-gcj-4.8-AMD64 --with-jvm-jar-dir=/usr/lib/jvm-exports/Java-1.5.0-gcj-4.8-AMD64 --with-Arch-directory=AMD64 --with-ecj-jar=/usr/share/Java/Eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-Arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --Host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)
configure:3820: $? = 0
configure:3809: gcc -V >&5
gcc: error: missing argument to '-march='
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3820: $? = 4
configure:3809: gcc -qversion >&5
gcc: error: missing argument to '-march='
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3820: $? = 4
configure:3840: checking whether the C compiler works
configure:3862: gcc -march=native -mtune=native   conftest.c  >&5
configure:3866: $? = 0
configure:3914: result: yes
configure:3917: checking for C compiler default output file name
configure:3919: result: a.out
configure:3925: checking for suffix of executables
configure:3932: gcc -o conftest -march=native -mtune=native   conftest.c  >&5
configure:3936: $? = 0
configure:3958: result:
configure:3980: checking whether we are cross compiling
configure:3988: gcc -o conftest -march=native -mtune=native   conftest.c  >&5
configure:3992: $? = 0
configure:3999: ./conftest
configure:4003: $? = 0
configure:4018: result: no
configure:4023: checking for suffix of object files
configure:4045: gcc -c -march=native -mtune=native  conftest.c >&5
configure:4049: $? = 0
configure:4070: result: o
configure:4074: checking whether we are using the GNU C compiler
configure:4093: gcc -c -march=native -mtune=native  conftest.c >&5
configure:4093: $? = 0
configure:4102: result: yes
configure:4111: checking whether gcc accepts -g
configure:4131: gcc -c -g  conftest.c >&5
gcc: error: missing argument to '-march='
configure:4131: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4146: gcc -c   conftest.c >&5
gcc: error: missing argument to '-march='
configure:4146: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4162: gcc -c -g  conftest.c >&5
gcc: error: missing argument to '-march='
configure:4162: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4172: result: no
configure:4189: checking for gcc option to accept ISO C89
configure:4252: gcc  -c -march=native -mtune=native  conftest.c >&5
configure:4252: $? = 0
configure:4265: result: none needed
configure:4343: checking for g++
configure:4359: found /usr/bin/g++
configure:4370: result: g++
configure:4397: checking for C++ compiler version
configure:4406: g++ --version >&5
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++: error: missing argument to '-march='
configure:4417: $? = 0
configure:4406: g++ -v >&5
Using built-in specs.
g++: error: missing argument to '-march='
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-10ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,Java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-Java-awt=gtk --enable-gtk-cairo --with-Java-home=/usr/lib/jvm/Java-1.5.0-gcj-4.8-AMD64/jre --enable-Java-home --with-jvm-root-dir=/usr/lib/jvm/Java-1.5.0-gcj-4.8-AMD64 --with-jvm-jar-dir=/usr/lib/jvm-exports/Java-1.5.0-gcj-4.8-AMD64 --with-Arch-directory=AMD64 --with-ecj-jar=/usr/share/Java/Eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-Arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --Host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)
configure:4417: $? = 0
configure:4406: g++ -V >&5
g++: error: missing argument to '-march='
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:4417: $? = 4
configure:4406: g++ -qversion >&5
g++: error: missing argument to '-march='
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:4417: $? = 4
configure:4421: checking whether we are using the GNU C++ compiler
configure:4440: g++ -c   conftest.cpp >&5
g++: error: missing argument to '-march='
configure:4440: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
| #ifndef __GNUC__
|        choke me
| #endif
|
|   ;
|   return 0;
| }
configure:4449: result: no
configure:4458: checking whether g++ accepts -g
configure:4478: g++ -c -g  conftest.cpp >&5
g++: error: missing argument to '-march='
configure:4478: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4493: g++ -c   conftest.cpp >&5
g++: error: missing argument to '-march='
configure:4493: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4509: g++ -c -g  conftest.cpp >&5
g++: error: missing argument to '-march='
configure:4509: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4519: result: no
configure:4548: checking how to run the C preprocessor
configure:4579: gcc -E  conftest.c
gcc: error: missing argument to '-march='
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4579: gcc -E  conftest.c
gcc: error: missing argument to '-march='
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4579: gcc -E -traditional-cpp  conftest.c
gcc: error: missing argument to '-march='
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4579: gcc -E -traditional-cpp  conftest.c
gcc: error: missing argument to '-march='
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4579: /lib/cpp  conftest.c
cpp: error: missing argument to '-march='
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4579: /lib/cpp  conftest.c
cpp: error: missing argument to '-march='
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4618: result: /lib/cpp
configure:4638: /lib/cpp  conftest.c
cpp: error: missing argument to '-march='
configure:4638: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4638: /lib/cpp  conftest.c
cpp: error: missing argument to '-march='
configure:4638: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4668: error: in `/home/ubuntu/Ruby-2.1.1':
configure:4670: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

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

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=no
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-march=native -mtune=native'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_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-unknown-linux-gnu
ac_cv_objext=o
ac_cv_prog_CPP=/lib/cpp
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=no
ac_cv_prog_cxx_g=no
ac_cv_target=x86_64-unknown-linux-gnu

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

ALLOCA=''
AR=''
ARCHFILE=''
Arch_FLAG=''
AS=''
ASFLAGS=''
BASERUBY='echo executable Host Ruby is required.  use --with-baseruby option.; false'
BTESTRUBY=''
BUILTIN_ENCOBJS=''
BUILTIN_TRANSOBJS=''
BUILTIN_TRANSSRCS=''
CAPITARGET=''
CC='gcc'
CCDLFLAGS=''
CC_VERSION=''
CFLAGS='-march=native -mtune=native'
CHDIR=''
COMMON_HEADERS=''
COMMON_LIBS=''
COMMON_MACROS=''
COUTFLAG=''
CP=''
CPP='/lib/cpp'
CPPFLAGS=''
CPPOUTFILE=''
CROSS_COMPILING=''
CXX='g++'
CXXFLAGS=''
DEFS=''
DLDFLAGS=''
DLDLIBS=''
DLEXT2=''
DLEXT=''
DLLWRAP=''
DLNOBJ=''
DOT=''
DOXYGEN=''
DTRACE=''
DTRACE_EXT=''
DTRACE_GLOMMED_OBJ=''
DTRACE_OBJ=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_SHARED=''
ENCOBJS=''
EXECUTABLE_EXTS=''
EXEEXT=''
EXPORT_PREFIX=''
EXTDLDFLAGS=''
EXTLDFLAGS=''
EXTOBJS=''
EXTOUT=''
EXTSTATIC=''
GCC='yes'
GNU_LD=''
GREP=''
INSTALLDOC=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LD=''
LDFLAGS=''
LDSHARED=''
LDSHAREDXX=''
LIBEXT=''
LIBOBJS=''
LIBPATHENV=''
LIBPATHFLAG=''
LIBRUBY=''
LIBRUBYARG=''
LIBRUBYARG_SHARED=''
LIBRUBYARG_STATIC=''
LIBRUBY_A=''
LIBRUBY_ALIASES=''
LIBRUBY_A_OBJS=''
LIBRUBY_DLDFLAGS=''
LIBRUBY_LDSHARED=''
LIBRUBY_RELATIVE=''
LIBRUBY_SO=''
LIBS=''
LINK_SO=''
LN_S=''
LTLIBOBJS=''
MAINLIBS=''
MAJOR='2'
MAKEDIRS=''
MAKEFILES=''
MANTYPE=''
MINIOBJS=''
MINIRUBY=''
MINOR='1'
MKDIR_P=''
NACL_SDK_ROOT=''
NACL_SDK_VARIANT=''
NACL_TOOLCHAIN=''
NM=''
NROFF=''
NULLCMD=''
OBJCOPY=''
OBJDUMP=''
OBJEXT='o'
OUTFLAG=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG=''
PLATFORM_DIR=''
POSTLINK=''
PREP=''
PYTHON=''
RANLIB=''
RDOCTARGET=''
RI_BASE_NAME=''
RM=''
RMALL=''
RMDIR=''
RMDIRS=''
RPATHFLAG=''
RUBYW_BASE_NAME='rubyw'
RUBYW_INSTALL_NAME=''
Ruby_BASE_NAME='Ruby'
Ruby_EXEC_PREFIX=''
Ruby_INSTALL_NAME=''
Ruby_LIB_VERSION=''
Ruby_LIB_VERSION_STYLE=''
Ruby_PROGRAM_VERSION='2.1.1'
Ruby_RELEASE_DATE='2014-02-24'
Ruby_SEARCH_PATH=''
Ruby_SO_NAME=''
Ruby_VERSION_NAME='${Ruby_BASE_NAME}-${Ruby_version}'
RUNRUBY=''
RUNRUBY_COMMAND=''
SET_MAKE=''
Shell='/bin/bash'
SOLIBS=''
STATIC=''
STRIP=''
SYMBOL_PREFIX=''
TEENY='0'
TEST_RUNNABLE=''
THREAD_MODEL=''
TRY_LINK=''
UNIVERSAL_ARCHNAMES=''
UNIVERSAL_INTS=''
USE_RUBYGEMS=''
WERRORFLAG=''
WINDRES=''
XCFLAGS=''
XLDFLAGS=''
XRUBY=''
XRUBY_LIBDIR=''
XRUBY_RUBYHDRDIR=''
XRUBY_RUBYLIBDIR=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
ac_ct_OBJCOPY=''
ac_ct_OBJDUMP=''
Arch=''
archincludedir=''
archlibdir=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
cflags=''
codesign=''
configure_args=''
cppflags=''
cxxflags=' ${optflags} ${debugflags} ${warnflags}'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
debugflags=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec=''
exec_prefix='NONE'
Host='x86_64-unknown-linux-gnu'
Host_alias=''
Host_cpu='x86_64'
Host_os='linux-gnu'
Host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libdirname=''
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
optflags=''
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s&^&&'
psdir='${docdir}'
ridir=''
Ruby_pc=''
Ruby_version=''
rubyarchdir=''
rubyarchhdrdir=''
rubyarchprefix=''
rubyhdrdir=''
rubylibdir=''
rubylibprefix=''
rubysitearchprefix=''
rubyw_install_name=''
sbindir='${exec_prefix}/sbin'
setup=''
sharedstatedir='${prefix}/com'
sitearch=''
sitearchdir=''
sitearchhdrdir=''
sitearchincludedir=''
sitearchlibdir=''
sitedir=''
sitehdrdir=''
sitelibdir=''
strict_warnflags=''
sysconfdir='${prefix}/etc'
target='x86_64-unknown-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux'
target_vendor='unknown'
try_header=''
vendorarchdir=''
vendorarchhdrdir=''
vendordir=''
vendorhdrdir=''
vendorlibdir=''
warnflags=''

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

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define CANONICALIZATION_FOR_MATHN 1

configure: exit 1
2
Pradeep Gupta

configure.logには2つの明らかな問題があります。

gcc: error: missing argument to '-march='
gcc: error: unrecognized command line option '-V'

-marchは、特定のアーキテクチャを選択する必要があります。 -march=i686または-march=x86-64

gcc -Vは、複数のバージョンがある場合に特定のgccバージョンを選択する方法です。これはおとりですが、configureは一連のオプション(--version -v -Vなど)を使用して反復し、Cコンパイラのバージョンをログに記録できることを確認します。それはgccか何かです。

CFLAGSおよびCC環境変数を確認します。

echo CFLAGS=$CFLAGS
echo CC=$CC

の出力

gcc -dumpmachine
gcc -v

1つの可能性は、コンパイラーのデフォルトをオーバーライドする疑わしいspecsファイルです。実行できる場合は、実行してください。

gcc -dumpspecs

*cc1_cpu:段落を含めます。

あなたがそれを実行できない場合、私はマイケル・ハンプトンに同意します、何かが非常にひどく壊れています。

わかりました、gcc -vは「組み込みの仕様を使用しています。 "と言っています。つまり、specsファイルが壊れていないか、コンパイラが壊れているか、環境に問題がある可能性があります。あなた可能性があります-marchを含めるようにCFLAGSを設定することでこれを修正できます:

export CFLAGS="-march=x86-64 -mtune=x86-64"

(それが機能する場合は、-march=native -mtune=nativeを試してください)

local_cpu_detect()(gcc内部)を使用した-march=native検出が誤動作している可能性がありますが、実際にはそれがどのように発生するかはわかりません(gcc/config/i386/driver-i386.c)。これはcpuidと他の制限されている可能性のある命令を呼び出します(万が一あなたのVMにいくつかの追加のセキュリティ機能が備わっていますか?)。 "Ubuntua/Linaro 「gccが作ったのかもしれないけど。

(Linaroはクロス開発ツールを提供しますが、gccはクロスコンパイラではなく、--target=x86_64-linux-gnuでビルドされています)


通常、-march=nativeを渡すと、検出内容を確認できます。

gcc -v -march=native -o x hello.c 2>&1 | less
...
COLLECT_GCC_OPTIONS='-v' '-march=native' '-o' 'x'
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.3/cc1 -quiet -v hello.c -march=core2 [...]

Ruby-2.1.1のconfigureスクリプトdoes-marchを使用しますが、アトミックな組み込み(__sync_val_compare_and_swap)を検出するためだけであり、とにかくそれほど遠くまで到達することはありません。

2
mr.spuratic