pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.76k stars 1.21k forks source link

C compiler cannot create executable - Ubuntu 13.04 Nightly build #15

Closed m3talsmith closed 11 years ago

m3talsmith commented 11 years ago

When compiling from a clone with the recommended CFLAGS I get the following output:

cpuminer [master] % ./configure CFLAGS="-03"                
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 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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... 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/m3talsmith/src/mining/cpuminer':
configure: error: C compiler cannot create executables
See `config.log' for more details

I also attempted compile it with some CFLAGS I found on the bitcoin forum, but I think I ran into the macro expansion error you were having with OSX:

cpuminer [master] % ./configure CFLAGS="-mtune=amdfam10 -O3 -ffast-math -mabm -msse4a -pipe"
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 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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... 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... 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... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc -std=gnu99 needs -traditional... no
checking whether gcc -std=gnu99 and cc understand -c and -o together... yes
checking dependency style of gcc -std=gnu99... gcc3
checking for ranlib... ranlib
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for sys/sysctl.h... yes
checking whether be32dec is declared... no
checking whether le32dec is declared... no
checking whether be32enc is declared... no
checking whether le32enc is declared... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for getopt_long... yes
checking whether we can compile AVX code... yes
checking whether we can compile XOP code... yes
checking for json_loads in -ljansson... yes
checking for pthread_create in -lpthread... yes
./configure: line 5502: syntax error near unexpected token `,'
./configure: line 5502: `LIBCURL_CHECK_CONFIG(, 7.10.1, ,'

My CPU is an AMD Phenom II X6 1075T (6 core of course). I'm running the latest nightly build of Ubuntu 13.04 as of 2013/04/05. Log here: https://gist.github.com/m3talsmith/5322557 .

I'm always tentative to use something I can't compile. Thanks for looking into this.

pooler commented 11 years ago

First problem: it should be -O3, not -03 (big O, not zero). Second problem: building from tarball should solve it.

m3talsmith commented 11 years ago

The only time I used an O3 is on the second attempt of CFLAGS; my bad. When I corrected it I come up with the same error as before. I'll try the tarball now.

Update I got what you said backwards. I tried with the -O3 on the tarball and it works fine. It still fails on the git clone though (the macro issue I'm guessing).

pooler commented 11 years ago

The problem with building directly from the git repo is that in some distros the libcurl development package misses libcurl.m4, which is needed to run autotools correctly. If this macro is missing, autotools generate a buggy configure script. Not that big of a problem though, as users are supposed to build from tarball anyway.

diveyez commented 6 years ago

https://github.com/diveyez/cpuminer/blob/master/build.sh