cómo arreglar configure: error: el compilador de C no puede crear ejecutables


16

usado

./configure DFLAGS="-03"

y este es el config.log

checking build system type... i686-pc-linux-gnu  
checking host system type... i686-pc-linux-gnu  
checking target system type... i686-pc-linux-gnu  
checking for a BSD-compatible install... /usr/bin/install -c  
checking whether build environment is sane... yes  
checking for a thread-safe mkdir -p... /bin/mkdir -p  
checking for gawk... gawk  
checking whether make sets $(MAKE)... yes  
checking whether make supports nested variables... yes  
checking whether to enable maintainer-specific portions of Makefiles... no  
checking for style of include used by make... GNU  
checking for gcc... gcc  
checking whether the C compiler works... no  
configure: error: in `/home/mike/cpuminer-2.4.2':  
configure: error: C compiler cannot create executables  

mi sistema es ubuntu 14.04 y los detalles del sistema dicen que el sistema operativo es de 32 bits. cualquier ayuda sería excelente ya que el compilador falla cada vez que intento usarlo, no solo con esta instalación.

salida 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 cpuminer configure 2.4.2, which was  
generated by GNU Autoconf 2.69.  Invocation command line was  

  $ ./configure CFLAGS=-03  

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

hostname = mike-Dell-DM051  
uname -m = i686  
uname -r = 3.13.0-57-generic  
uname -s = Linux  
uname -v = #95-Ubuntu SMP Fri Jun 19 09:27:48 UTC 2015  

/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/game  

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

configure:2336: checking build system type  
configure:2350: result: i686-pc-linux-gnu  
configure:2370: checking host system type  
configure:2383: result: i686-pc-linux-gnu  
configure:2403: checking target system type  
configure:2416: result: i686-pc-linux-gnu  
configure:2460: checking for a BSD-compatible install  
configure:2528: result: /usr/bin/install -c  
configure:2539: checking whether build environment is sane  
configure:2594: result: yes  
configure:2745: checking for a thread-safe mkdir -p  
configure:2784: result: /bin/mkdir -p  
configure:2791: checking for gawk  
configure:2807: found /usr/bin/gawk  
configure:2818: result: gawk  
configure:2829: checking whether make sets $(MAKE)  
configure:2851: result: yes  
configure:2880: checking whether make supports nested variables  
configure:2897: result: yes  
configure:3026: checking whether to enable maintainer-specific portions of Make$  
configure:3035: result: no  
configure:3061: checking for style of include used by make  
configure:3089: result: GNU  
configure:3160: checking for gcc  
configure:3176: found /usr/bin/gcc  
configure:3187: result: gcc  
configure:3416: checking for C compiler version  
configure:3425: gcc --version >&5  
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4  
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.  

configure:3436: $? = 0  
configure:3425: gcc -v >&5  
Using built-in specs.  
COLLECT_GCC=gcc  
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper  
Target: i686-linux-gnu  
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~1$  
Thread model: posix  
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)  
configure:3436: $? = 0  
configure:3425: gcc -V >&5  
gcc: error: unrecognized command line option '-qversion'  
gcc: fatal error: no input files  
compilation terminated.  
configure:3436: $? = 4  
configure:3456: checking whether the C compiler works  
configure:3478: gcc -03   conftest.c  >&5  
gcc: error: unrecognized command line option '-03'  
configure:3482: $? = 1  
configure:3520: result: no  
configure: failed program was:  
| /* confdefs.h */  
| #define PACKAGE_NAME "cpuminer"  
| #define PACKAGE_TARNAME "cpuminer"  
| #define PACKAGE_VERSION "2.4.2"  
| #define PACKAGE_STRING "cpuminer 2.4.2"  
| #define PACKAGE_BUGREPORT ""  
| #define PACKAGE_URL ""| #define PACKAGE "cpuminer"  
| #define VERSION "2.4.2"  
| /* end confdefs.h.  */  
|  
| int  
| main ()  
| {  
|  
|   ;  
|   return 0;  
| }  
configure:3525: error: in `/home/mike/cpuminer-2.4.2':  
configure:3527: error: C compiler cannot create executables  
See `config.log' for more details  

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

ac_cv_build=i686-pc-linux-gnu  
ac_cv_env_CCASFLAGS_set=  
ac_cv_env_CCASFLAGS_value=  
ac_cv_env_CCAS_set=  
ac_cv_env_CCAS_value=  
ac_cv_env_CC_set=  
ac_cv_env_CC_value=  
ac_cv_env_CFLAGS_set=set  
ac_cv_env_CFLAGS_value=-03  
ac_cv_env_CPPFLAGS_set=  
ac_cv_env_CPPFLAGS_value=  
ac_cv_env_CPP_set=  
ac_cv_env_CPP_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=i686-pc-linux-gnu  
ac_cv_path_install='/usr/bin/install -c'ac_cv_path_mkdir=/bin/mkdir  
ac_cv_prog_AWK=gawk  
ac_cv_prog_ac_ct_CC=gcc  
ac_cv_prog_make_make_set=yes  
ac_cv_target=i686-pc-linux-gnu  
am_cv_make_support_nested_variables=yes  

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

ACLOCAL='${SHELL} /home/mike/cpuminer-2.4.2/missing aclocal-1.14'  
ALLOCA=''    
AMDEPBACKSLASH='\'  
AMDEP_FALSE='#'  
AMDEP_TRUE=''  
AMTAR='$${TAR-tar}'  
AM_BACKSLASH='\'  
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'  
AM_DEFAULT_VERBOSITY='1'  
AM_V='$(V)'  
ARCH_ARM_FALSE=''ARCH_ARM_TRUE=''  
ARCH_PPC_FALSE=''  
ARCH_PPC_TRUE=''  
ARCH_x86_64_FALSE=''  
ARCH_x86_64_TRUE=''  
ARCH_x86_FALSE=''  
ARCH_x86_TRUE=''  
AUTOCONF='${SHELL} /home/mike/cpuminer-2.4.2/missing autoconf'  
AUTOHEADER='${SHELL} /home/mike/cpuminer-2.4.2/missing autoheader'  
AUTOMAKE='${SHELL} /home/mike/cpuminer-2.4.2/missing automake-1.14'  
AWK='gawk'  
CC='gcc'  
CCAS=''  
CCASDEPMODE=''  
CCASFLAGS=''  
CCDEPMODE=''  
CFLAGS='-03'  
CPP=''  
CPPFLAGS=''  
CYGPATH_W='echo'  
DEFS=''  
DEPDIR='.deps'  
ECHO_C=''  
ECHO_N='-n'  
ECHO_T=''  
EGREP=''  
EXEEXT=''  
GREP=''  
HAVE_WINDOWS_FALSE=''  
HAVE_WINDOWS_TRUE=''  
INSTALL_DATA='${INSTALL} -m 644'  
INSTALL_PROGRAM='${INSTALL}'  
INSTALL_SCRIPT='${INSTALL}'  
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'  
JANSSON_LIBS=''  
LDFLAGS=''  
LIBCURL=''  
LIBCURL_CPPFLAGS=''  
LIBOBJS=''  
LIBS=''  
LTLIBOBJS=''  
MAINT='#'  
MAINTAINER_MODE_FALSE=''  
MAINTAINER_MODE_TRUE='#'MAKEINFO='${SHELL} /home/mike/cpuminer-2.4.2/missing makeinfo'  
MKDIR_P='/bin/mkdir -p'  
OBJEXT=''  
PACKAGE='cpuminer'  
PACKAGE_BUGREPORT=''  
PACKAGE_NAME='cpuminer'  
PACKAGE_STRING='cpuminer 2.4.2'  
PACKAGE_TARNAME='cpuminer'  
PACKAGE_URL=''  
PACKAGE_VERSION='2.4.2'  
PATH_SEPARATOR=':'  
PTHREAD_FLAGS=''  
PTHREAD_LIBS=''  
RANLIB=''  
SET_MAKE=''  
SHELL='/bin/bash'  
STRIP=''  
USE_ASM_FALSE=''  
USE_ASM_TRUE=''  
VERSION='2.4.2'  
WANT_JANSSON_FALSE=''  
WANT_JANSSON_TRUE=''  
S2_LIBS=''  
_libcurl_config=''  
ac_ct_CC='gcc'  
am__EXEEXT_FALSE=''  
am__EXEEXT_TRUE=''  
am__fastdepCCAS_FALSE=''  
am__fastdepCCAS_TRUE=''  
am__fastdepCC_FALSE=''  
am__fastdepCC_TRUE=''  
am__include='include'  
am__isrc=''  
am__leading_dot='.'  
am__nodep='_no'  
am__quote=''  
am__tar='$${TAR-tar} chof - "$$tardir"'  
am__untar='$${TAR-tar} xf -'  
bindir='${exec_prefix}/bin'  
build='i686-pc-linux-gnu'  
build_alias=''  
build_cpu='i686'  
build_os='linux-gnu'  
build_vendor='pc'htmldir='${docdir}'  
includedir='${prefix}/include'  
infodir='${datarootdir}/info'  
install_sh='${SHELL} /home/mike/cpuminer-2.4.2/install-sh'  
libdir='${exec_prefix}/lib'  
libexecdir='${exec_prefix}/libexec'  
localedir='${datarootdir}/locale'  
localstatedir='${prefix}/var'  
mandir='${datarootdir}/man'  
mkdir_p='$(MKDIR_P)'  
oldincludedir='/usr/include'  
pdfdir='${docdir}'  
sbindir='${exec_prefix}/sbin'  
sharedstatedir='${prefix}/com'  
sysconfdir='${prefix}/etc'  
target='i686-pc-linux-gnu'  
target_alias=''  
target_cpu='i686'  
target_os='linux-gnu'  
target_vendor='pc'  

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

/* confdefs.h */  
#define PACKAGE_NAME "cpuminer"  
#define PACKAGE_TARNAME "cpuminer"  
#define PACKAGE_VERSION "2.4.2"  
#define PACKAGE_STRING "cpuminer 2.4.2"  
#define PACKAGE_BUGREPORT ""  
#define PACKAGE_URL ""  
#define PACKAGE "cpuminer"  
#define VERSION "2.4.2"  

configure: exit 77  

¿Está seguro de que posee el directorio cpuminer-2.4.2?
ubfan1

Pruebe el comando entre comillas para aislar problemas de permisos --- "echo" void main () {printf (\ "hello world \ n \");} "| gcc -xc - -o / tmp / hello; / tmp / hello "... una vez que lo ejecutes deberías ver" hello world "impreso en la consola
Arul Selvan

Utilicé git para obtener los archivos y se creó el directorio, no utilicé el superusuario con git, solo git, el directorio se creó dentro de mi directorio de inicio, así que creo que soy el propietario del directorio.
Mike O

sí, después de ejecutar echo "void main () {printf (\" hello world \ n \ ");}" | gcc -xc - -o / tmp / hello; / tmp / hello me sale hello world
Mike O

comprobar los permisos en el directorio y que es mío .....
Mike O

Respuestas:


24

Supongo que tiene instalado el compilador básico de C, pero no los encabezados de la biblioteca estándar. Tratar:

sudo apt install libc6-dev

[Editar: esto produce síntomas similares, pero no fue el caso aquí. Las respuestas de CFLAGS parecen ser correctas].


libc6-dev ya es la versión más nueva.
Mike O

En ese caso, mire el archivo config.log, que debería tener información sobre lo que salió mal.
Colin Watson

la salida de config.log está en la parte superior de la publicación original
Mike O

mi mal, pensé que había pegado config.log originalmente, se agrega ahora .......
Mike O

19

De la config.log:

configure:3478: gcc -03   conftest.c  >&5  
gcc: error: unrecognized command line option '-03'  

La opción es -O3con la letra O, no con el número 0(cero). Por lo tanto, debe ejecutar, como se indica en el archivo README:

./configure CFLAGS="-O3"

4

Parece que sus CFLAGS tienen un cero en lugar de O mayúscula. Eso no es válido y hace que la compilación falle. Puede solucionarlo, pero en realidad, busque una versión posterior del paquete que se ha solucionado.


probé la versión más nueva primero y falló, así que la eliminé y probé esta versión y falló, así que pensé que había algún otro problema. gracias por la solución
Mike O

3

Estaba teniendo exactamente el mismo problema al intentar instalar tivodecode en una compilación base de Linux Mint 17.3. Probé el:

./configure DFLAGS="-O3"

comando pero sin efecto. Entonces intenté:

sudo apt install libc6-dev

para instalar los últimos encabezados C. Intenté el ./configurecomando nuevamente sin variables y todo salió bien. Los comandos makey make installtambién se completaron con éxito. Mi recomendación es asegurarse de que estén instalados los últimos encabezados C y luego ejecutar su ./configurecomando.


-1

Yo tuve el mismo problema.

Lo resolví escribiendo los siguientes comandos en un terminal:

sudo apt-get install --reinstalar build-essential

sudo apt-get install --reinstalar gcc

sudo dpkg-reconfigure build-essential

sudo dpkg-reconfigure gcc

Después no tuve ningún problema.


¿Estás seguro de que era el mismo problema? Es extraño que un problema proveniente de un parámetro incorrecto (-03 intead de -O3, en este caso) se pueda resolver mediante la reinstalación / reconfiguración.
Marc Vanhoomissen

-1

Tratar

    CFLAGS="-march=native"

Esto es de la página cpuminer-multi github

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.