Bill Allombert on Thu, 20 May 2004 21:40:21 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Splitting get-kernel from get-archos |
Hello PARI developers, Architectures that support both 32bit and 64bit applications are more and more common. Unfortunately assembly kernel are keyed to a particular wordsize, and PARI need the compiler to get the wordsize. So I propose we extract get_kernel from get_archos so that we can run get_kernel after get_cc. This will allow Configure to pick different kernel dependending of the word size. Currently sparcv9 in 64bit mode do not work unless you told Configure to use the portable kernel. The same will happen on amd64 usei which should ix86 kernel in 32bit mode and x86-64 in 64bit mode, and ppc64 (should probably use portable kernel in 64bit mode) The attached patch fix that. Unfortunately, for obvious reason, in interactive mode, the order of question is changed. Once this issue is handled, I plan to commit the x86_64 support. Cheers, Bill
Index: Configure =================================================================== RCS file: /home/cvs/pari/Configure,v retrieving revision 1.131 diff -u -r1.131 Configure --- Configure 30 Jan 2004 14:43:01 -0000 1.131 +++ Configure 19 May 2004 22:02:57 -0000 @@ -51,15 +51,16 @@ if test -z "$zcat" -a -n "$gzip"; then zcat="$gzip -dc"; fi ####################### CONFIGURE - ARCHITECTURE ############################ -. ./get_archos # arch, osname, asmarch, pretty +. ./get_archos # arch, osname ####################### CONFIGURE - COMPILATION ############################# . ./get_cc # $_cc_list (includes 'optimization'), extraflag +. ./get_double_format # doubleformat, sizeof_long, update pretty +. ./get_kernel # asmarch, pretty . ./get_as # AS, ASFLAGS, KERNELCPPFLAGS, gnuas . ./get_ld # $_ld_list . ./get_dlld # $_dlld_list, fix libpari_base . ./get_perl # $_perl_list ####################### CONFIGURE - LIBC #################################### -. ./get_double_format # doubleformat, sizeof_long, update pretty . ./get_libc # $_has_list, update LIBS ####################### CONFIGURE - LIBRARIES ############################### # Looking for libraries: gmp, X11, gnuplot, readline Index: config/get_archos =================================================================== RCS file: /home/cvs/pari/config/get_archos,v retrieving revision 1.14 diff -u -r1.14 get_archos --- config/get_archos 15 Oct 2003 12:34:30 -0000 1.14 +++ config/get_archos 19 May 2004 22:01:06 -0000 @@ -34,85 +34,3 @@ osname=$ans fi -# -# A pretty name for the architecture -# The asm file used (if any) -# -case "$arch" in - sparc) asmarch=sparcv8_micro; pretty=Sparc ;; - sparcv7) asmarch=$arch; pretty=SparcV7 ;; - sparcv8_micro) asmarch=$arch; pretty=MicroSparc ;; - sparcv8_super) asmarch=$arch; pretty=SuperSparc ;; - sparcv9) asmarch=sparcv8_micro; pretty=UltraSparc ;; - i?86) asmarch=ix86 ; pretty=$arch ;; - ia64) asmarch=ia64 ; pretty=Itanium ;; - hppa) asmarch=none ; pretty='HP Precision' - case "$osname-`uname -r`" in - hpux-?.10.*) asmarch=$arch ;; - esac ;; - alpha) asmarch=$arch; pretty=Alpha ;; - ppc) asmarch=$arch; pretty='Power PC' ;; - arm*) asmarch=none; pretty=$arch ;; - mips) asmarch=none; pretty=MIPS ;; - sh3) asmarch=none; pretty=SH-3 ;; - sh5) asmarch=none; pretty=SH-5 ;; - vax) asmarch=none; pretty=VAX ;; - fx2800) asmarch=none; pretty='Alliant FX/2800' ;; - s390) asmarch=none; pretty='S/390' ;; - none) asmarch=none; pretty=unknown ;; - *) asmarch=none; pretty=$arch - echo " Warning ! architecture $arch not tested";; -esac - -# -# Modifications for pretty name and asm file -# -pretty="$pretty running $osname" - -tmp_kern=auto-none -if test -n "$kernel"; then - tmp_kern=$kernel -else - if test "$fastread" != yes; then - cat << EOM -========================================================================== -An optimized Pari kernel is available for these architectures -("none" means that we will use the portable C version of GP/PARI) -("-gmp" means we will use the GMP library (that needs to be installed)) -EOM - rep='none sparcv7 sparcv8_super sparcv8_micro ix86 alpha hppa ppc - none-gmp sparcv7-gmp sparcv8_super-gmp sparcv8_micro-gmp ix86-gmp alpha-gmp hppa-gmp ppc-gmp' - . ./display - echo $n ..."Which of these apply, if any ? $c" - dflt=$asmarch; . ./myread; - tmp_kern=$ans - cat << EOM -========================================================================== -EOM - fi -fi -tmp_kern=`./kernel-name $tmp_kern $asmarch none` -kernlvl0=`echo "$tmp_kern" | sed -e 's/\(.*\)-.*/\1/'` -kernlvl1=`echo "$tmp_kern" | sed -e 's/.*-\(.*\)/\1/'` - -case "$kernlvl0" in - none) prettyk="portable C";; - sparcv7) prettyk=SparcV7;; - sparcv8_super) prettyk=SuperSparc;; - sparcv8_micro) prettyk=MicroSparc;; - ix86) prettyk=ix86;; - ia64) prettyk=ia64;; - hppa) prettyk=HPPA;; - alpha) prettyk=Alpha;; - ppc) prettyk=PPC;; - *) prettyk="$kernlvl0";; -esac - -case "$kernlvl1" in - gmp) prettyk="$prettyk/GMP";; - none) ;; - *) prettyk="$prettyk/$kernlvl1";; -esac - -pretty="$pretty ($prettyk kernel)" -echo "Building for architecture: $pretty" --- /dev/null Wed Jul 2 16:24:28 2003 +++ config/get_kernel Thu May 20 16:49:14 2004 @@ -0,0 +1,88 @@ +# Testing Architectures. Try uname to provide a default, then ask user. +# +case "$arch" in + sparc) asmarch=sparcv8_micro; pretty=Sparc ;; + sparcv7) asmarch=$arch; pretty=SparcV7 ;; + sparcv8_micro) asmarch=$arch; pretty=MicroSparc ;; + sparcv8_super) asmarch=$arch; pretty=SuperSparc ;; + sparcv9) case "$sizeof_long" in + 4) asmarch=sparcv8_micro;; + 8) asmarch=none;; + esac; pretty=UltraSparc ;; + i?86) asmarch=ix86 ; pretty=$arch ;; + ia64) asmarch=ia64 ; pretty=Itanium ;; + hppa) asmarch=none ; pretty='HP Precision' + case "$osname-`uname -r`" in + hpux-?.10.*) asmarch=$arch ;; + esac ;; + alpha) asmarch=$arch; pretty=Alpha ;; + ppc) case "$sizeof_long" in + 4) asmarch=$arch;; + 8) asmarch=none;; + esac; pretty='Power PC' ;; + arm*) asmarch=none; pretty=$arch ;; + mips) asmarch=none; pretty=MIPS ;; + sh3) asmarch=none; pretty=SH-3 ;; + sh5) asmarch=none; pretty=SH-5 ;; + vax) asmarch=none; pretty=VAX ;; + fx2800) asmarch=none; pretty='Alliant FX/2800' ;; + s390) asmarch=none; pretty='S/390' ;; + none) asmarch=none; pretty=unknown ;; + *) asmarch=none; pretty=$arch + echo " Warning ! architecture $arch not tested";; +esac + +# +# Modifications for pretty name and asm file +# +pretty="$pretty running $osname" + +tmp_kern=auto-none +if test -n "$kernel"; then + tmp_kern=$kernel +else + if test "$fastread" != yes; then + cat << EOM +An optimized Pari kernel is available for these architectures +("none" means that we will use the portable C version of GP/PARI) +("-gmp" means we will use the GMP library (that needs to be installed)) +EOM + rep='none sparcv7 sparcv8_super sparcv8_micro ix86 alpha hppa ppc + none-gmp sparcv7-gmp sparcv8_super-gmp sparcv8_micro-gmp ix86-gmp alpha-gmp hppa-gmp ppc-gmp' + . ./display + echo $n ..."Which of these apply, if any ? $c" + dflt=$asmarch; . ./myread; + tmp_kern=$ans + cat << EOM +========================================================================== +EOM + fi +fi +tmp_kern=`./kernel-name $tmp_kern $asmarch none` +kernlvl0=`echo "$tmp_kern" | sed -e 's/\(.*\)-.*/\1/'` +kernlvl1=`echo "$tmp_kern" | sed -e 's/.*-\(.*\)/\1/'` + +case "$kernlvl0" in + none) prettyk="portable C";; + sparcv7) prettyk=SparcV7;; + sparcv8_super) prettyk=SuperSparc;; + sparcv8_micro) prettyk=MicroSparc;; + ix86) prettyk=ix86;; + ia64) prettyk=ia64;; + hppa) prettyk=HPPA;; + alpha) prettyk=Alpha;; + ppc) prettyk=PPC;; + *) prettyk="$kernlvl0";; +esac + +case "$kernlvl1" in + gmp) prettyk="$prettyk/GMP";; + none) ;; + *) prettyk="$prettyk/$kernlvl1";; +esac + +pretty="$pretty ($prettyk kernel)" +echo "Building for architecture: $pretty" +cat << EOM +========================================================================== +EOM