[cmor] 149/190: WIP: Progress: don't use -fPIE. Breaks python

Alastair McKinstry mckinstry at moszumanska.debian.org
Tue Jul 21 12:54:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository cmor.

commit a99298efdd79610b0053a4e4499d6a30f5075d50
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Jun 12 18:03:44 2013 +0100

    WIP: Progress: don't use -fPIE. Breaks python
---
 debian/patches/python3.patch | 312 +++++++++++++++++++++++++++++++++++++++----
 debian/python3-cmor.install  |   2 +-
 debian/rules                 |  20 +--
 3 files changed, 301 insertions(+), 33 deletions(-)

diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 7246914..7790468 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -5,8 +5,8 @@ Forwarded: no
 
 Index: cmor-2.8.3/Lib/git2svn.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/git2svn.py	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/Lib/git2svn.py	2013-06-12 14:10:28.000000000 +0100
+--- cmor-2.8.3.orig/Lib/git2svn.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Lib/git2svn.py	2013-06-12 15:52:40.000000000 +0100
 @@ -1,3 +1,4 @@
 +from __future__ import print_function
  import os,sys
@@ -33,8 +33,8 @@ Index: cmor-2.8.3/Lib/git2svn.py
      os.popen(cmd).readlines()
 Index: cmor-2.8.3/Lib/pywrapper.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/pywrapper.py	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/Lib/pywrapper.py	2013-06-12 14:10:28.000000000 +0100
+--- cmor-2.8.3.orig/Lib/pywrapper.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Lib/pywrapper.py	2013-06-12 15:52:40.000000000 +0100
 @@ -1,4 +1,3 @@
 -
  import cmor_const,numpy,os,_cmor
@@ -708,8 +708,8 @@ Index: cmor-2.8.3/Lib/pywrapper.py
          if (file_name is False):
 Index: cmor-2.8.3/Lib/__init__.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/__init__.py	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/Lib/__init__.py	2013-06-12 14:10:28.000000000 +0100
+--- cmor-2.8.3.orig/Lib/__init__.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Lib/__init__.py	2013-06-12 15:52:40.000000000 +0100
 @@ -1,9 +1,9 @@
 -from cmor_const import *
 -
@@ -728,8 +728,8 @@ Index: cmor-2.8.3/Lib/__init__.py
    pass
 Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/Lib/check_CMOR_compliant.py	2013-06-12 14:10:28.000000000 +0100
+--- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Lib/check_CMOR_compliant.py	2013-06-12 15:52:40.000000000 +0100
 @@ -1,3 +1,4 @@
 +from __future__ import print_function
  import cdms2
@@ -1152,18 +1152,14 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
             
 Index: cmor-2.8.3/Test/check_results.py
 ===================================================================
---- cmor-2.8.3.orig/Test/check_results.py	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/Test/check_results.py	2013-06-12 14:10:28.000000000 +0100
-@@ -2,6 +2,8 @@
+--- cmor-2.8.3.orig/Test/check_results.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Test/check_results.py	2013-06-12 16:18:36.000000000 +0100
+@@ -1,3 +1,4 @@
++from __future__ import print_function
+ from out_files import out
  from in_files import input_tables
  import sys,os
- 
-+from __future__ import print_function
-+
- import cmor
- 
- test = sys.argv[1]
-@@ -10,7 +12,7 @@
+@@ -10,7 +11,7 @@
  if test[-4:].lower()=='.f90':
      test=test[:-4]
  
@@ -1172,7 +1168,7 @@ Index: cmor-2.8.3/Test/check_results.py
  
  outfiles = out.get(test,[])
  intables = input_tables.get(test,['IPCC_test_table_A',])
-@@ -22,12 +24,12 @@
+@@ -22,12 +23,12 @@
  
  nfiles = 0
  
@@ -1187,7 +1183,7 @@ Index: cmor-2.8.3/Test/check_results.py
          sys.exit()
      tables=[]
      for t in intables:
-@@ -39,13 +41,13 @@
+@@ -39,13 +40,13 @@
      if os.path.exists(fnm):
          nfiles+=1
          gotfiles.append(fnm)
@@ -1207,8 +1203,8 @@ Index: cmor-2.8.3/Test/check_results.py
 +    raise CMORResultCheckError(["Error checking output files for test: Test/%s.f90 we could only find %i files when %i were expected.\n\n Expected files: \n\t%s\n\nPresent files: \n\t%s\n\nMissing files: \n\t%s\n" % (test,nfiles,len(outfiles),repr(outfiles),repr(gotfiles),repr(missing)),])
 Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
 ===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py	2013-06-12 15:32:42.000000000 +0100
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py	2013-06-12 15:52:40.000000000 +0100
 @@ -1,11 +1,13 @@
 +from __future__ import print_function 
  import cmor,numpy,sys,os
@@ -1286,8 +1282,8 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
  f.close()
 Index: cmor-2.8.3/setup.py.in
 ===================================================================
---- cmor-2.8.3.orig/setup.py.in	2013-06-12 14:10:22.000000000 +0100
-+++ cmor-2.8.3/setup.py.in	2013-06-12 14:10:28.000000000 +0100
+--- cmor-2.8.3.orig/setup.py.in	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/setup.py.in	2013-06-12 15:52:40.000000000 +0100
 @@ -1,8 +1,10 @@
 +from __future__ import print_function # to be python2/python3 agnostic
  import numpy
@@ -1318,3 +1314,271 @@ Index: cmor-2.8.3/setup.py.in
  
  setup (name = "CMOR",
         version='2.0',
+Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
+===================================================================
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression_02.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression_02.py	2013-06-12 16:20:59.000000000 +0100
+@@ -1,8 +1,9 @@
++from __future__ import print_function
+ import cmor,numpy,sys,os
+ try:
+     import cdms2
+ except:
+-    print "This test code needs cdms2 interface for i/0"
++    print("This test code needs cdms2 interface for I/O")
+     sys.exit()
+ 
+ cdms2.setNetcdfShuffleFlag(0)
+@@ -52,7 +53,7 @@
+ 
+ tables=[]
+ tables.append(cmor.load_table("mytable"))
+-print 'Tables ids:',tables
++print('Tables ids:',tables)
+ 
+ 
+ ## read in data, just one slice
+@@ -75,7 +76,7 @@
+     except:
+         missing_value=None
+ 
+-print 'Missing:',type(missing_value),missing_value
++print('Missing:',type(missing_value),missing_value)
+ #missing_value = -999.
+ myaxes[0] = cmor.axis(table_entry = 'latitude', 
+                       units = 'degrees_north', 
+@@ -115,7 +116,7 @@
+ f=cdms2.open("Test/crap.nc","w")
+ step=10
+ for i in range(0,ntimes,step):
+-    print 'Time:',i
++    print('Time:',i)
+     j1=i
+     j2=i+step
+     cmor.write(myvars[0],s[j1:j2].filled(),step,file_suffix="speed-comp-02")
+@@ -154,15 +155,15 @@
+ import cdtime,os
+ ltime = cdtime.reltime(Tim[ntimes-1],Tim.units).tocomp()
+ ftime = cdtime.reltime(Tim[0],Tim.units).tocomp()
+-print ftime,ltime
+-print (var,var,ftime.year,ftime.month,ltime.year,ltime.month)
++print(ftime,ltime)
++print((var,var,ftime.year,ftime.month,ltime.year,ltime.month))
+ lcmor = os.stat("Test/IPCC_Fourth_Assessment/output/INSTITUTE_ID/pcmdi-09a/mon/REALM/%s/r1/%s_A1_pcmdi-09a_r1_%i%.2i-%i%.2i_speed-comp-02.nc" % (var,var,ftime.year,ftime.month,ltime.year,ltime.month))[6]
+-print 'level:',level,"shuffle:",shuffle
+-print 'total cmor:',totcmor,mincmor,totcmor/ntimes,maxcmor,lcmor
++print('level:',level,"shuffle:",shuffle)
++print('total cmor:',totcmor,mincmor,totcmor/ntimes,maxcmor,lcmor)
+ lcdms = os.stat("Test/crap.nc")[6]
+-print 'total cdms:',totcdms,mincdms,totcdms/ntimes,maxcdms,lcdms
+-print 'Size diff:',float(lcmor)/float(lcdms)
+-print 'speed diff:', totcmor/totcdms
++print('total cdms:',totcdms,mincdms,totcdms/ntimes,maxcdms,lcdms)
++print('Size diff:',float(lcmor)/float(lcdms))
++print('speed diff:', totcmor/totcdms)
+ 
+ if os.path.exists("summary.txt"):
+     f = open("summary.txt")
+@@ -177,7 +178,7 @@
+ for i in range(10):
+     a = dic.get((i,0),"N/A")
+     b = dic.get((i,1),"N/A")
+-    print 'Level: ',i,"no suffle:",a,"shuffle",b
++    print('Level: ',i,"no suffle:",a,"shuffle",b)
+ f=open("summary.txt","w")
+ f.write(repr(dic))
+ f.close()
+Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
+===================================================================
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression.py	2013-06-12 16:22:41.000000000 +0100
+@@ -1,3 +1,4 @@
++from __future__ import print_function
+ import cmor,numpy,sys,os
+ try:
+     import cdms2
+@@ -5,7 +6,7 @@
+     cdms2.setNetcdfDeflateFlag(0)
+     cdms2.setNetcdfDeflateLevelFlag(0)
+ except:
+-    print "This test code needs a recent cdms2 interface for i/0"
++    print("This test code needs a recent cdms2 interface for I/O")
+     sys.exit()
+ 
+ if len(sys.argv)>1:
+@@ -52,7 +53,7 @@
+ 
+ tables=[]
+ tables.append(cmor.load_table("mytable"))
+-print 'Tables ids:',tables
++print('Tables ids:',tables)
+ 
+ 
+ ## read in data, just one slice
+@@ -98,7 +99,7 @@
+ c0=st
+ s2=s*1
+ sh=list(s.shape)
+-print 'shape:',sh
++print('shape:',sh)
+ sh.insert(0,1)
+ s2=MV2.reshape(s2,sh)
+ s2.setAxis(1,s.getLatitude())
+@@ -135,12 +136,12 @@
+ import cdtime,os
+ ltime = cdtime.reltime(ntimes-1,'month since 1980').tocomp()
+ lcmor = os.stat("Test/CMIP5/output/PCMDI/GICCM1/historical/mon/atmos/tas/r1i1p1/tas_Amon_GICCM1_historical_r1i1p1_198001-%i%.2i.nc" % (ltime.year,ltime.month))[6]
+-print 'level:',level,"shuffle:",shuffle
+-print 'total cmor:',totcmor,mincmor,totcmor/ntimes,maxcmor,lcmor
++print('level:',level,"shuffle:",shuffle)
++print('total cmor:',totcmor,mincmor,totcmor/ntimes,maxcmor,lcmor)
+ lcdms = os.stat("Test/crap.nc")[6]
+-print 'total cdms:',totcdms,mincdms,totcdms/ntimes,maxcdms,lcdms
+-print 'Size diff:',float(lcmor)/float(lcdms)
+-print 'speed diff:', totcmor/totcdms
++print('total cdms:',totcdms,mincdms,totcdms/ntimes,maxcdms,lcdms)
++print('Size diff:',float(lcmor)/float(lcdms))
++print('speed diff:', totcmor/totcdms)
+ 
+ if os.path.exists("summary.txt"):
+     f = open("summary.txt")
+@@ -155,7 +156,7 @@
+ for i in range(10):
+     a = dic.get((i,0),"N/A")
+     b = dic.get((i,1),"N/A")
+-    print 'Level: ',i,"no suffle:",a,"shuffle",b
++    print('Level: ',i,"no suffle:",a,"shuffle",b)
+ f=open("summary.txt","w")
+ f.write(repr(dic))
+ f.close()
+Index: cmor-2.8.3/Test/jamie_hybrid_height.py
+===================================================================
+--- cmor-2.8.3.orig/Test/jamie_hybrid_height.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Test/jamie_hybrid_height.py	2013-06-12 16:24:00.000000000 +0100
+@@ -1,5 +1,5 @@
+ #!/usr/bin/env python
+-
++from __future__ import print_function
+ import cmor
+ import numpy
+ 
+@@ -45,22 +45,22 @@
+         axis_id = cmor.axis(**axis)
+         axis_ids.append(axis_id)
+ 
+-    print 'cmor.axis calls complete'
++    print('cmor.axis calls complete')
+ 
+     cmor.zfactor(axis_ids[3], 'b', '', axis_ids[3:4], 'd', [0., 0.5], [[0., 0.25], [0.25, 1.]])
+     cmor.zfactor(axis_ids[3], 'orog', 'm', axis_ids[1:3], 'd', [[0.]]) 
+-    print 'cmor.zfactor calls complete'
++    print('cmor.zfactor calls complete')
+     varid = cmor.variable('ua',
+                           'm s-1',
+                           axis_ids,
+                           missing_value = -99
+                           )
+ 
+-    print 'cmor.variable call complete'
++    print('cmor.variable call complete')
+     
+     cmor.write(varid, values, time_vals = [6.0])
+ 
+-    print 'cmor.write call complete'
++    print('cmor.write call complete')
+ 
+     cmor.close()
+     
+Index: cmor-2.8.3/Test/nc2asc.py
+===================================================================
+--- cmor-2.8.3.orig/Test/nc2asc.py	2013-06-12 15:52:32.000000000 +0100
++++ cmor-2.8.3/Test/nc2asc.py	2013-06-12 16:30:45.000000000 +0100
+@@ -1,5 +1,5 @@
+ #!/usr/bin/env python
+-
++from __future__ import print_function
+ import cdms2,sys, genutil
+ cdms2.setAutoBounds('on')
+ 
+@@ -20,18 +20,18 @@
+ f=cdms2.open(fnm)
+ 
+ ntimes= 3
+-print 'var:',var
++print('var:',var)
+ #s=f(var,time=slice(0,3),latitude=(-20,20),order=order,squeeze=1)
+ if order is not None:
+ 	if order.find('z')>-1:
+ 		s=f(var,time=slice(0,ntimes),order=order,squeeze=1,longitude=(-180,180,'con'),level=slice(5,12))
+-		print s.getLevel()[:]
++		print(s.getLevel()[:])
+ 	else:
+ 		s=f(var,time=slice(0,ntimes),order=order,squeeze=1,longitude=(-180,180,'con'))
+ else:
+ 	s=f(var,time=slice(0,ntimes),squeeze=1)
+ #s=s[:,::4,::4]
+-print 'Read in',s.shape
++print('Read in',s.shape)
+ try:
+ 	p=s.getLevel()
+ 	p.id='pressure'
+@@ -44,41 +44,41 @@
+ f=open(fout,'w')
+ 
+ ndim=s.rank()
+-print 'Dumping'
+-print >>f, s.id
+-print >>f, s.units
+-print >>f, ndim
++print('Dumping')
++print(s.id, file=f)
++print(s.units, file=f)
++print(ndimi, file=f)
+ 
+ for i in range(ndim):
+     ax=s.getAxis(i)
+-    print >>f, len(ax)
++    print(len(ax), file=f)
+ 	
+ for i in range(ndim):
+     ax=s.getAxis(i)
+     if ax.isLatitude():
+-	    print >>f, 'latitude'
++	    print('latitude', file=f)
+     elif ax.isLongitude():
+-	    print >>f,'longitude'
++	    print('longitude', file=f)
+     else:
+-	    print >>f, ax.id
+-    print >>f, ax.units
+-    print  ax.id
+-    print  ax.units
++	    print(ax.id, file=f)
++    print(ax.units, file=f)
++    print(ax.id)
++    print(ax.units)
+     for j in ax[:]:
+-        print >>f, j,
+-    print >>f
++        print(j, file=f)
++    print(file=f)
+     for j in ax.getBounds().flat[:]:
+-        print >>f, j,
+-    print >>f
++        print(j, file=f)
++    print(file=f)
+ f.flush()
+ 
+ s=s.filled(120).astype(type)
+ s=s.flat
+ j=0
+ for i in s[:]:
+-    print >>f, i,
++    print(i, file=f)
+     j+=1
+-print >>f
+-print j,s[-1]
++print(file=f)
++print(j,s[-1])
+ 
+ f.close()
diff --git a/debian/python3-cmor.install b/debian/python3-cmor.install
index 097a7e8..fef6392 100644
--- a/debian/python3-cmor.install
+++ b/debian/python3-cmor.install
@@ -1 +1 @@
-/usr/lib/python3
+/usr/lib/python3*
diff --git a/debian/rules b/debian/rules
index d633e61..15c98a1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,7 @@ export DH_VERBOSE=1
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
 
-DEB_BUILD_MAINT_OPTIONS:= hardening=+all
+# DEB_BUILD_MAINT_OPTIONS:= hardening=+all
 DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic
 export DEB_BUILD_MAINT_OPTIONS
 export DEB_CFLAGS_MAINT_APPEND
@@ -14,9 +14,9 @@ export DEB_CFLAGS_MAINT_APPEND
 BUILD_ARCH_OS :-= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
 BUILD_ARCH_CPU := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
 
-PYVERS:=`pyversions --supported`
-PY3VERS:=''
-DESTDIR:=`pwd`/debian/tmp
+PYVERS:=$(shell pyversions --supported)
+PY3VERS:=$(shell py3versions --supported)
+DESTDIR:=$(shell pwd)/debian/tmp
 
 %:
 	dh $@ --with python2,python3
@@ -24,19 +24,22 @@ DESTDIR:=`pwd`/debian/tmp
 override_dh_auto_configure:
 	autoreconf -fiv
 	ln -sf  /usr/share/misc/config.sub 
-	dh_auto_configure -- --disable-color --enable-verbose-test  --with-uuid  \
+	dh_auto_configure -- --disable-color --enable-verbose-test  --with-uuid --without-python \
 		UUIDLDFLAGS="-lossp-uuid" UUIDFLAGS="-I/usr/include/ossp" SZLIBFLAGS=nosz
 
 override_dh_auto_clean:
 	rm -rf config.sub config.log config.status libcmor.a libcmor.so.2 build test_grid configure CMIP5
+	rm -f ipcc_test_code Makefile setup.py *.mod compile_line.txt include/cmor_locale.h
 	find . -name '*.nc' -delete
-	find . -name '*.o' -or -name '*.pic_o' -or -name '*.pyc' -delete
+	find . -name '*.o' -delete
+	find .  -name '*.pic_o' -delete
+	find . -name '*.pyc' -delete
 
 override_dh_auto_build:
 	$(MAKE) FC=gfortran
 
 override_dh_auto_test:
-	for p in $(PYVERS) ; do \
+	# for p in $(PYVERS) ; do \
 		$(MAKE) test_python PYTHONEXEC=$$p DESTDIR=$(DESTDIR)  ; done
 ifeq ( $(BUILD_ARCH_OS)-$(BUILD_ARCH_CPU), kfreebsd-i386)
 	@echo "Tests disabled; see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598745"
@@ -50,8 +53,9 @@ override_dh_auto_install:
 	for p in $(PYVERS) $(PY3VERS) ; do \
 		$$p ./setup.py install  --prefix=$(DESTDIR)/usr ; \
 		done
-	dh_numpy
 	dh_install -p libcmor2 libcmor.so.2    $(LIBDIR)
 	dh_install -p libcmor-dev debian/tmp/usr/lib/libcmor.a $(LIBDIR)
 	dh_install -p libcmor-dev debian/tmp/usr/lib/pkgconfig/cmor.pc  $(LIBDIR)/pkgconfig
 	dh_link -p libcmor-dev $(LIBDIR)/libcmor.so.2   $(LIBDIR)/libcmor.so
+	dh_numpy
+	dh_numpy3

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cmor.git



More information about the debian-science-commits mailing list