Bill Allombert on Sun, 23 May 2004 01:34:13 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Splitting get-kernel from get-archos


On Thu, May 20, 2004 at 09:50:56PM +0200, Bill Allombert wrote:
> On Thu, May 20, 2004 at 04:58:37PM +0200, Bill Allombert wrote:
> > Hello PARI developers,
> > 
> > The attached patch fix that. Unfortunately, for obvious reason, in
> > interactive mode, the order of question is changed.
> 
> The attached patch was slighly bogus. This one is better.
> 
> > Once this issue is handled, I plan to commit the x86_64 support.
> 
> Well, but there is still an issue unresolved: 
> We need to known the sizeof(long) before setting -fPIC on amd64,
> at least according to our current rules about -fPIC).

So here a new patch that split get_dlcflags from get_cc to implement
that... No, it is not pretty.

I took the opportunuity to fix the list of arch that need -fPIC.
Now, configure should handle every architectures supported by Debian.
except maybe m68k (it needs several hour to build pari on the only
m68k-linux box I have access to, and it is probably one of the 
fastest m68k box available).

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	22 May 2004 15:17:00 -0000
@@ -51,15 +51,17 @@
 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_cc            # $_cc_list (includes 'optimization'), extraflag
+. ./get_double_format # doubleformat, sizeof_long
+. ./get_kernel        # asmarch, pretty
+. ./get_dlcflags      # DLCFLAGS, update CFLAGS
 . ./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	22 May 2004 21:32:53 -0000
@@ -12,7 +12,7 @@
 Currently supported architectures:
 EOM
   rep='none sparcv7 sparcv8_super sparcv8_micro sparcv9
-       ix86 i386 i486 i586 i686 alpha arm fx2800 hppa ia64 mips 
+       ix86 i386 i486 i586 i686 alpha amd64 arm fx2800 hppa ia64 mips m68k
        ppc s390'
   . ./display
   echo $n ..."Which of these apply, if any ? $c"
@@ -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"
Index: config/get_cc
===================================================================
RCS file: /home/cvs/pari/config/get_cc,v
retrieving revision 1.22
diff -u -r1.22 get_cc
--- config/get_cc	21 Oct 2003 16:41:54 -0000	1.22
+++ config/get_cc	22 May 2004 15:27:39 -0000
@@ -1,5 +1,5 @@
 # Exported variables
-_cc_list="__gnuc__ CC CFLAGS optimization DBGFLAGS OPTFLAGS CPP exe_suff suffix ASMINLINE DLCFLAGS"
+_cc_list="__gnuc__ CC CFLAGS optimization DBGFLAGS OPTFLAGS CPP exe_suff suffix ASMINLINE"
 
 # Which optimization ?
 if test "$fastread" != yes; then
@@ -117,11 +117,6 @@
   esac
   OPTFLAGS="$OPTFLAGS -DGCC_INLINE $warn"
   DBGFLAGS=${DBGFLAGS:-"-g $warn"}
-  # Some architectures need -fPIC for building dynamic lib
-  case "$osname-$arch" in
-    hpux-*|*-ia64) DLCFLAGS=-fPIC ;;
-    darwin-*) DLCFLAGS=-fno-common;;
-  esac
   # Specific optimisations for some architectures
   case "$arch" in
     sparcv8*) cflags=-mv8;;
@@ -142,8 +137,8 @@
   DBGFLAGS=${DBGFLAGS:-'-g'}
   PRFFLAGS='-pg'
   case "$osname-$arch" in
-    hpux-*) # -Ae is for ANSI C + defines HPUX_SOURCE, +z for PIC code
-                  OPTFLAGS=-O; cflags=-Ae; DLCFLAGS=+z;;
+    hpux-*) # -Ae is for ANSI C + defines HPUX_SOURCE
+                  OPTFLAGS=-O; cflags=-Ae;;
     aix-*)        OPTFLAGS='-O2 -qtune=auto -qmaxmem=8192'
                   cflags='-qlanglvl=ansi';;
     cygwin*|linux-i?86|freebsd-i?86)
@@ -156,7 +151,6 @@
   esac
   PRFFLAGS="$PRFFLAGS $OPTFLAGS"
 fi
-cflags="$cflags $DLCFLAGS"
 
 case "$optimization" in
   full)      suffix=;     cflags="$OPTFLAGS $cflags";;
@@ -170,8 +164,6 @@
   dflt=$CFLAGS; rep=; . ./myread
   CFLAGS=$ans
 fi
-
-echo "C compiler is          $CC  $CFLAGS"
 
 # Which C PreProcessor ?
 case "$osname" in
Index: config/get_double_format
===================================================================
RCS file: /home/cvs/pari/config/get_double_format,v
retrieving revision 1.3
diff -u -r1.3 get_double_format
--- config/get_double_format	4 Feb 2003 20:50:07 -0000	1.3
+++ config/get_double_format	20 May 2004 15:22:11 -0000
@@ -11,8 +11,8 @@
     echo "***************************************************************"
     echo "Your 'double' type does not follow the IEEE754 format. Aborting"
     echo "PLEASE REPORT! (dbltor/rtodbl need to be fixed)"; exit 1;;
-  -) sizeof_long=8; pretty="$pretty 64-bit version";;
-  *) sizeof_long=4; pretty="$pretty 32-bit version";;
+  -) sizeof_long=8;;
+  *) sizeof_long=4;;
 esac
 echo "Given the previous choices, sizeof(long) is $sizeof_long chars."
 
--- /dev/null	Wed Jul  2 16:24:28 2003
+++ config/get_dlcflags	Sat May 22 19:21:50 2004
@@ -0,0 +1,18 @@
+if test -n "$__gnuc__"; then
+  # Some architectures need -fPIC for building dynamic lib
+  # *-i?86|*-sparc*|*-powerpc|*-s390|*-mips) DLCFLAGS=
+  case "$osname-$arch" in
+    *-hppa|*-ia64|*-alpha|*-arm) DLCFLAGS=-fPIC ;;
+    x86_64-*) case "$sizeof_long" in 
+              8) DLCFLAGS=-fPIC;;
+              esac;;
+    darwin-*) DLCFLAGS=-fno-common;;
+  esac
+else
+  case "$osname-$arch" in
+    hpux-*) DLCFLAGS=+z;;
+  esac
+fi
+CFLAGS="$DLCFLAGS $CFLAGS"
+
+echo "C compiler is          $CC  $CFLAGS"
--- /dev/null	Wed Jul  2 16:24:28 2003
+++ config/get_kernel	Sun May 23 00:04:38 2004
@@ -0,0 +1,96 @@
+# 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 ;;
+  x86_64)  case "$sizeof_long" in   
+           4) asmarch=ix86;;
+           8) asmarch=none;;
+           esac;                        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 ;;
+  m68k)          asmarch=none;          pretty='Motorola 68k';;
+  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
+
+case "$sizeof_long" in
+  4) pretty="$pretty ($prettyk kernel) 32-bit version";;
+  8) pretty="$pretty ($prettyk kernel) 64-bit version";;
+esac;
+echo "Building for architecture: $pretty"
+cat << EOM
+==========================================================================
+EOM