How to compile GMP from source?
Markus Heiler
shevegen at gmail.com
Mon May 28 20:07:23 CEST 2012
Hi,
I finally wrote this email because I cant seem to find information
how to continue. GMP is one of the programs that I fail to
compile from source. Usually, C and C++ projects are no
problem to compile, so something may be odd with my system
or GMP requirement. (BTW issue reporting is so much nicer
on something like github than having to use a mailing list ...)
Here is information.
First, my environment:
================================================================================
GCC Version: 4.6.3
Glibc Version: ldd (GNU libc) 2.14.1
CFLAGS in use:
Binutils Version: GNU ld (GNU Binutils) 2.22
================================================================================
To explain this, I tried both with CFLAGS and without them. The result
is twice the same, so the
CFLAGS can not have been the problem.
The configure command to GMP I use is this here:
"./configure --prefix=/usr"
The GMP version I try to compile is 5.0.5.
The error I recieve output on my terminal is this:
------------------------------------------------------------------------------------------
checking build system type... k10-unknown-linux-gnu
checking host system type... k10-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... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=32
checking compiler gcc ... yes
checking compiler gcc has sizeof(long)==4... no
checking compiler icc ... no
checking whether cc is gcc... yes
checking compiler cc ... yes
checking compiler cc has sizeof(long)==4... no
configure: error: could not find a working compiler, see config.log for details
------------------------------------------------------------------------------------------
The config.log I will paste here now (sorry it is a bit long)
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU MP configure 5.0.5, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --prefix=/usr
## --------- ##
## Platform. ##
## --------- ##
hostname = new-host
uname -m = x86_64
uname -r = 3.3.6-server-2.mga2
uname -s = Linux
uname -v = #1 SMP Thu May 17 16:38:45 UTC 2012
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = x86_64
/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/bin
PATH: /System/Executables
PATH: /bin
PATH: /sbin
PATH: /usr/sbin
PATH: /opt/bin
PATH: /windows
PATH: /usr/local/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:3024: checking build system type
configure:3038: result: k10-unknown-linux-gnu
configure:3058: checking host system type
configure:3071: result: k10-unknown-linux-gnu
configure:3108: checking for a BSD-compatible install
configure:3176: result: /usr/bin/install -c
configure:3187: checking whether build environment is sane
configure:3237: result: yes
configure:3378: checking for a thread-safe mkdir -p
configure:3417: result: /bin/mkdir -p
configure:3430: checking for gawk
configure:3446: found /usr/bin/gawk
configure:3457: result: gawk
configure:3468: checking whether make sets $(MAKE)
configure:3490: result: yes
configure:3573: checking whether to enable maintainer-specific
portions of Makefiles
configure:3582: result: no
User:
ABI=32
CC=
CFLAGS=
CPPFLAGS=(unset)
MPN_PATH=
GMP:
abilist=64 32
cclist=gcc icc cc
configure:5383: gcc 2>&1 | grep xlc >/dev/null
configure:5386: $? = 1
configure:5440: checking compiler gcc
Test compile:
configure:5454: gcc conftest.c >&5
configure:5457: $? = 0
configure:5462: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5465: $? = 0
Test compile: function pointer return
configure:5508: gcc conftest.c >&5
configure:5511: $? = 0
configure:5516: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5519: $? = 0
Test compile: cmov instruction
configure:5564: gcc conftest.c >&5
configure:5567: $? = 0
configure:5572: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5575: $? = 0
Test compile: double -> ulong conversion
configure:5621: gcc conftest.c >&5
configure:5624: $? = 0
configure:5629: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5632: $? = 0
Test compile: double negation
configure:5676: gcc conftest.c >&5
configure:5679: $? = 0
configure:5684: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5687: $? = 0
Test compile: double -> float conversion
configure:5732: gcc conftest.c >&5
configure:5735: $? = 0
configure:5740: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5743: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:5817: gcc conftest.c >&5
configure:5820: $? = 0
configure:5825: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5828: $? = 0
Test compile: __builtin_alloca availability
configure:5868: gcc conftest.c >&5
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../lib64/crt1.o:
In function `_start':
/home/iurt/rpm/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64/elf/start.S:109:
undefined reference to `main'
collect2: ld returned 1 exit status
configure:5871: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:5992: gcc conftest.c >&5
configure:5995: $? = 0
configure:6000: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6003: $? = 0
Test compile: long long reliability test 1
configure:6056: gcc conftest.c >&5
configure:6059: $? = 0
configure:6064: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6067: $? = 0
Test compile: long long reliability test 2
configure:6116: gcc conftest.c >&5
configure:6119: $? = 0
configure:6124: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6127: $? = 0
Test compile: mpn_lshift_com optimization
configure:6215: gcc conftest.c >&5
configure:6218: $? = 0
configure:6223: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6226: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:6323: gcc conftest.c >&5
configure:6326: $? = 0
configure:6331: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6334: $? = 0
configure:6480: result: yes
configure: testlist sizeof-long-4
configure:6655: checking compiler gcc has sizeof(long)==4
configure:6668: gcc -c conftest.c >&5
conftest.c: In function 'main':
conftest.c:4:14: error: size of array 'test_array' is negative
configure:6671: $? = 1
configure:6676: result: no
configure:5361: icc -c conftest.c >&5
./configure: line 5362: icc: command not found
configure:5364: $? = 127
configure:5383: icc 2>&1 | grep xlc >/dev/null
configure:5386: $? = 1
configure:5440: checking compiler icc
Test compile:
configure:5454: icc conftest.c >&5
./configure: line 5455: icc: command not found
configure:5457: $? = 127
failed program was:
int main () { return 0; }
configure:6480: result: no
configure:5361: cc -c conftest.c >&5
configure:5364: $? = 0
configure:5367: checking whether cc is gcc
configure:5369: result: yes
configure:5383: cc 2>&1 | grep xlc >/dev/null
configure:5386: $? = 1
configure:5440: checking compiler cc
Test compile:
configure:5454: cc conftest.c >&5
configure:5457: $? = 0
configure:5462: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5465: $? = 0
Test compile: function pointer return
configure:5508: cc conftest.c >&5
configure:5511: $? = 0
configure:5516: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5519: $? = 0
Test compile: cmov instruction
configure:5564: cc conftest.c >&5
configure:5567: $? = 0
configure:5572: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5575: $? = 0
Test compile: double -> ulong conversion
configure:5621: cc conftest.c >&5
configure:5624: $? = 0
configure:5629: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5632: $? = 0
Test compile: double negation
configure:5676: cc conftest.c >&5
configure:5679: $? = 0
configure:5684: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5687: $? = 0
Test compile: double -> float conversion
configure:5732: cc conftest.c >&5
configure:5735: $? = 0
configure:5740: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5743: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:5817: cc conftest.c >&5
configure:5820: $? = 0
configure:5825: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5828: $? = 0
Test compile: __builtin_alloca availability
configure:5868: cc conftest.c >&5
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../lib64/crt1.o:
In function `_start':
/home/iurt/rpm/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64/elf/start.S:109:
undefined reference to `main'
collect2: ld returned 1 exit status
configure:5871: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:5992: cc conftest.c >&5
configure:5995: $? = 0
configure:6000: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6003: $? = 0
Test compile: long long reliability test 1
configure:6056: cc conftest.c >&5
configure:6059: $? = 0
configure:6064: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6067: $? = 0
Test compile: long long reliability test 2
configure:6116: cc conftest.c >&5
configure:6119: $? = 0
configure:6124: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6127: $? = 0
Test compile: mpn_lshift_com optimization
configure:6215: cc conftest.c >&5
configure:6218: $? = 0
configure:6223: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6226: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:6323: cc conftest.c >&5
configure:6326: $? = 0
configure:6331: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6334: $? = 0
configure:6480: result: yes
configure: testlist sizeof-long-4
configure:6655: checking compiler cc has sizeof(long)==4
configure:6668: cc -c conftest.c >&5
conftest.c: In function 'main':
conftest.c:4:14: error: size of array 'test_array' is negative
configure:6671: $? = 1
configure:6676: result: no
configure:6718: error: could not find a working compiler, see
config.log for details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=k10-unknown-linux-gnu
ac_cv_env_ABI_set=set
ac_cv_env_ABI_value=32
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_BUILD_set=
ac_cv_env_CC_FOR_BUILD_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_FOR_BUILD_set=
ac_cv_env_CPP_FOR_BUILD_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value=' -fPIC '
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-lpthread
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_M4_set=
ac_cv_env_M4_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_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=k10-unknown-linux-gnu
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ABI='32'
ACLOCAL='${SHELL} /Depot/Temp/gmp-5.0.5/missing --run aclocal-1.11'
AMTAR='${SHELL} /Depot/Temp/gmp-5.0.5/missing --run tar'
ANSI2KNR=''
AR=''
AS=''
ASMFLAGS=''
AUTOCONF='${SHELL} /Depot/Temp/gmp-5.0.5/missing --run autoconf'
AUTOHEADER='${SHELL} /Depot/Temp/gmp-5.0.5/missing --run autoheader'
AUTOMAKE='${SHELL} /Depot/Temp/gmp-5.0.5/missing --run automake-1.11'
AWK='gawk'
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
CC=''
CCAS=''
CC_FOR_BUILD=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CPP_FOR_BUILD=''
CXX=''
CXXCPP=''
CXXFLAGS=' -fPIC '
CYGPATH_W='echo'
DEFN_LONG_LONG_LIMB=''
DEFS=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_STATIC_FALSE=''
ENABLE_STATIC_TRUE=''
EXEEXT=''
EXEEXT_FOR_BUILD=''
FGREP=''
GMP_LDFLAGS=''
GMP_LIMB_BITS=''
GMP_NAIL_BITS='0'
GREP=''
HAVE_CLOCK_01=''
HAVE_CPUTIME_01=''
HAVE_GETRUSAGE_01=''
HAVE_GETTIMEOFDAY_01=''
HAVE_HOST_CPU_FAMILY_power='0'
HAVE_HOST_CPU_FAMILY_powerpc='0'
HAVE_SIGACTION_01=''
HAVE_SIGALTSTACK_01=''
HAVE_SIGSTACK_01=''
HAVE_STACK_T_01=''
HAVE_SYS_RESOURCE_H_01=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS='-lpthread'
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LIBCURSES=''
LIBGMPXX_LDFLAGS=''
LIBGMP_DLL=''
LIBGMP_LDFLAGS=''
LIBM=''
LIBM_FOR_BUILD=''
LIBOBJS=''
LIBREADLINE=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
M4=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /Depot/Temp/gmp-5.0.5/missing --run makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/bin/mkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='gmp'
PACKAGE_BUGREPORT='gmp-bugs at gmplib.org, see
http://gmplib.org/manual/Reporting-Bugs.html'
PACKAGE_NAME='GNU MP'
PACKAGE_STRING='GNU MP 5.0.5'
PACKAGE_TARNAME='gmp'
PACKAGE_URL='http://www.gnu.org/software/gmp/'
PACKAGE_VERSION='5.0.5'
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
SPEED_CYCLECOUNTER_OBJ='pentium.lo'
STRIP=''
TAL_OBJECT=''
TUNE_SQR_OBJ=''
U=''
U_FOR_BUILD=''
VERSION='5.0.5'
WANT_CXX_FALSE=''
WANT_CXX_TRUE=''
WANT_MPBSD_FALSE=''
WANT_MPBSD_TRUE='#'
WITH_READLINE_01=''
YACC=''
YFLAGS=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__isrc=''
am__leading_dot='.'
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='k10-unknown-linux-gnu'
build_alias=''
build_cpu='k10'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
gmp_srclinks=''
host='k10-unknown-linux-gnu'
host_alias=''
host_cpu='k10'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Depot/Temp/gmp-5.0.5/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='/bin/mkdir -p'
mpn_objects=''
mpn_objs_in_libgmp=''
mpn_objs_in_libmp=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
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 "GNU MP"
#define PACKAGE_TARNAME "gmp"
#define PACKAGE_VERSION "5.0.5"
#define PACKAGE_STRING "GNU MP 5.0.5"
#define PACKAGE_BUGREPORT "gmp-bugs at gmplib.org, see
http://gmplib.org/manual/Reporting-Bugs.html"
#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
#define PACKAGE "gmp"
#define VERSION "5.0.5"
#define WANT_FFT 1
#define HAVE_HOST_CPU_k10 1
configure: exit 1
More information about the gmp-discuss
mailing list