2

I've checked a number of similar questions on stackoverflow but haven't found an answer yet.

I am trying to build Ruby from source as describe here: https://www.ruby-lang.org/en/installation/#building-from-source

Here what i am getting:

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

Updated:

The system is brand new and i am using a cloud image of Ubuntu 13.10, Downloaded from http://uec-images.ubuntu.com/saucy/current/saucy-server-cloudimg-amd64-disk1.img

I made this cloud virtual machine with open stack software.

And i installed gcc via this command:

sudo apt-get install gcc

Current version of 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)

Edited:

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)}

Edit:

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

Here is Updated 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
12
  • Not only your compiler, but your entire system environment, seems to be broken. How did your system get into its current state? Mar 7, 2014 at 13:53
  • Question edited as per your concern.... Mar 7, 2014 at 13:58
  • That looks like a problem with the gcc installation. Did you update the system? Mar 7, 2014 at 14:00
  • I ran sudo apt-get update and i post output of screen to question. Mar 7, 2014 at 14:05
  • 2
    Yeah, I think your cloud image is hopelessly broken. I suggest you file a bug on launchpad, and in the meantime, install Ubuntu yourself. Mar 7, 2014 at 14:06

1 Answer 1

2

There are two obvious problems in configure.log:

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

-march should be selecting a specific architecture, e.g. -march=i686 or -march=x86-64

gcc -V is a way of selecting a specific gcc version when you have more than one, that's a decoy here though: configure is iterating through a set of options (--version -v -V etc.) to make sure it can log the version of the C compiler, be it gcc or something else.

Check your CFLAGS and CC environment variables,

echo CFLAGS=$CFLAGS
echo CC=$CC

the output of

gcc -dumpmachine
gcc -v

One possibility is a suspect specs file overriding the compiler defaults, so run (if you can)

gcc -dumpspecs

and include the *cc1_cpu: paragraph.

If you cannot run that, then I concur with Michael Hampton, something is very badly broken.

Ok, gcc -v says "Using built-in specs.", that means you don't have a broken specs file, you might have a broken compiler, or something up with your environment. You might be able to fix this by setting CFLAGS to include -march:

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

(If that works then try -march=native -mtune=native )

Its possible that -march=native detection with local_cpu_detect() (gcc internal) is malfunctioning, though I really can't see how that happens (gcc/config/i386/driver-i386.c). This calls cpuid and other possibly restricted instructions (any chance your VM has some additional security features in place?) I'm not familiar with any changes that the "Ubuntua/Linaro" gcc may have made though.

(Linaro provide cross-development tools, but your gcc is not a cross-compiler, it's built with --target=x86_64-linux-gnu)


Normally, if you pass -march=native you can see what it detects:

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 [...]

The ruby-2.1.1 configure script does use -march, but only to detect an atomic builtin (__sync_val_compare_and_swap), it never gets that far anyway.

6
  • gcc -dump-machine gcc: error: missing argument to ‘-march=’ gcc: fatal error: no input files compilation terminated. Mar 7, 2014 at 14:14
  • How to check CFLAGS and CC, I am not expert of C laungage... Mar 7, 2014 at 14:17
  • sorry it's -dumpmachine, I had an extra -. Mar 7, 2014 at 14:49
  • I edited my question with output of all requested commands... Mar 7, 2014 at 15:01
  • I did export CFLAGS="-march=x86-64 -mtune=x86-64" and again received error and edited my question... Mar 7, 2014 at 19:24

Not the answer you're looking for? Browse other questions tagged .