Changeset 8697


Ignore:
Timestamp:
Feb 14, 2013, 11:33:06 PM (12 years ago)
Author:
steve
Message:

Changes to get Padarn's new code working for windows. Do need to setup netcdf dll and netcdf.h in fit_interpolate directory

Location:
trunk/anuga_core
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/compile_all.py

    r8690 r8697  
    6363os.chdir('..')
    6464os.chdir('fit_interpolate')
     65subprocess.call([sys.executable, '..' + os.sep + 'utilities' + os.sep + 'compile.py', 'rand48.c'])
     66subprocess.call([sys.executable, '..' + os.sep + 'utilities' + os.sep + 'compile.py', 'ptinpoly.c'])
    6567execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    6668
  • trunk/anuga_core/source/anuga/caching/caching.py

    r8690 r8697  
    939939 
    940940  # Setup for quad_tree extension
    941   from anuga.utilities import compile
    942   if compile.can_use_C_extension('quad_tree_ext.c'):
    943       import quad_tree_ext
    944   else:
    945       msg = "C implementation of quad tree extension not avaliable"
    946       raise Exception(msg)
     941  #from anuga.utilities import compile
     942  #if compile.can_use_C_extension('quad_tree_ext.c'):
     943  #import quad_tree_ext
     944  #else:
     945  #    msg = "C implementation of quad tree extension not avaliable"
     946  #    raise Exception(msg)
    947947
    948948  # Setup for sparse_matrix extension
    949   from anuga.utilities import compile
    950   if compile.can_use_C_extension('sparse_matrix_ext.c'):
    951       import sparse_matrix_ext
    952   else:
    953       msg = "C implementation of sparse_matrix extension not avaliable"
    954       raise Exception(msg)
    955 
     949  #from anuga.utilities import compile
     950  #if compile.can_use_C_extension('sparse_matrix_ext.c'):
     951
     952  #else:
     953  #    msg = "C implementation of sparse_matrix extension not avaliable"
     954  #    raise Exception(msg)
     955
     956  import anuga.utilities.sparse_matrix_ext as sparse_matrix_ext
     957  import anuga.utilities.quad_tree_ext as quad_tree_ext
    956958  from anuga.geometry.aabb import AABB
    957959
  • trunk/anuga_core/source/anuga/fit_interpolate/fit.py

    r8695 r8697  
    4747
    4848# Setup for c fitting routines
    49 from anuga.utilities import compile
    50 if compile.can_use_C_extension('fitsmooth.c'):
    51     import fitsmooth
    52 else:
    53     msg = "C implementation of fitting algorithms (fitsmooth.c) not avalaible"
    54     raise Exception(msg)
     49#from anuga.utilities import compile
     50#if compile.can_use_C_extension('fitsmooth.c'):
     51import fitsmooth
     52#else:
     53#    msg = "C implementation of fitting algorithms (fitsmooth.c) not avalaible"
     54#    raise Exception(msg)
    5555
    5656# Setup for quad_tree extension
    57 from anuga.utilities import compile
    58 if compile.can_use_C_extension('quad_tree_ext.c'):
    59     import quad_tree_ext
    60 else:
    61     msg = "C implementation of quad tree extension not avaliable"
    62     raise Exception(msg)
     57#from anuga.utilities import compile
     58#if compile.can_use_C_extension('quad_tree_ext.c'):
     59#from anuga.utilities import quad_tree_ext
     60#else:
     61#    msg = "C implementation of quad tree extension not avaliable"
     62#    raise Exception(msg)
    6363
    6464# Setup for sparse_matrix extension
    65 from anuga.utilities import compile
    66 if compile.can_use_C_extension('sparse_matrix_ext.c'):
    67     import sparse_matrix_ext
    68 else:
    69     msg = "C implementation of sparse_matrix extension not avaliable"
    70     raise Exception(msg)
     65#from anuga.utilities import compile
     66#if compile.can_use_C_extension('sparse_matrix_ext.c'):
     67#from anuga.utilities import sparse_matrix_ext
     68#else:
     69#    msg = "C implementation of sparse_matrix extension not avaliable"
     70#    raise Exception(msg)
    7171
    7272
  • trunk/anuga_core/source/anuga/pmesh/mesh_quadtree.py

    r8690 r8697  
    6060        extents = AABB(*self.mesh.get_extent(absolute=True))
    6161        extents.grow(1.001)  # To avoid round off error
    62         extents = [extents.xmin, extents.xmax, extents.ymin, extents.ymax]
    63         self.extents = ensure_numeric(extents, num.float)
     62        numextents = [extents.xmin, extents.xmax, extents.ymin, extents.ymax]
     63        self.extents = num.array(numextents, num.float)
     64        #print self.extents
    6465
    6566    def add_quad_tree(self):
    6667
    6768        V = self.mesh.get_vertex_coordinates(absolute=True)
     69       
     70        self.set_extents()
     71        #print self.extents
    6872        self.root = fitsmooth.build_quad_tree(self.mesh.triangles, V, self.extents)
    6973
  • trunk/anuga_core/source/anuga/utilities/compile.py

    r8694 r8697  
    302302  # Make shared library (*.so or *.dll)
    303303  if FN=="fitsmooth.c":
    304     if libs is "":
    305       s = '%s -%s %s ../utilities/quad_tree.o ../utilities/sparse_dok.o ../utilities/sparse_csr.o -o %s.%s -lm -lblas -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext)
    306     else:
    307       s = '%s -%s %s ../utilities/quad_tree.o ../utilities/sparse_dok.o ../utilities/sparse_csr.o -o %s.%s "%s" -lm -lblas -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext, libs)
     304    if sys.platform == 'win32':   
     305      if libs is "":
     306        s = '%s -%s %s ../utilities/quad_tree.o ../utilities/sparse_dok.o ../utilities/sparse_csr.o -o %s.%s -lm  -fopenmp netcdf.dll' %(loader, sharedflag, object_files, root1, libext)
     307      else:
     308        s = '%s -%s %s ../utilities/quad_tree.o ../utilities/sparse_dok.o ../utilities/sparse_csr.o -o %s.%s "%s" -lm  -fopenmp netcdf.dll' %(loader, sharedflag, object_files, root1, libext, libs)
     309    else:   
     310      if libs is "":
     311        s = '%s -%s %s ../utilities/quad_tree.o ../utilities/sparse_dok.o ../utilities/sparse_csr.o -o %s.%s -lm  -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext)
     312      else:
     313        s = '%s -%s %s ../utilities/quad_tree.o ../utilities/sparse_dok.o ../utilities/sparse_csr.o -o %s.%s "%s" -lm  -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext, libs)
    308314  elif FN=="quad_tree_ext.c":
    309315    if libs is "":
    310       s = '%s -%s %s quad_tree.o -o %s.%s -lm -lblas -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext)
     316      s = '%s -%s %s quad_tree.o -o %s.%s -lm  -fopenmp' %(loader, sharedflag, object_files, root1, libext)
     317    else:
     318      s = '%s -%s %s quad_tree.o -o %s.%s "%s" -lm  -fopenmp ' %(loader, sharedflag, object_files, root1, libext, libs)       
    311319  elif FN=="sparse_matrix_ext.c":
    312320    if libs is "":
    313       s = '%s -%s %s sparse_dok.o -o %s.%s -lm -lblas -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext)
    314     else:
    315       s = '%s -%s %s sparse_dok.o -o %s.%s "%s" -lm -lblas -fopenmp -lnetcdf' %(loader, sharedflag, object_files, root1, libext, libs)
     321      s = '%s -%s %s sparse_dok.o -o %s.%s -lm  -fopenmp ' %(loader, sharedflag, object_files, root1, libext)
     322    else:
     323      s = '%s -%s %s sparse_dok.o -o %s.%s "%s" -lm  -fopenmp ' %(loader, sharedflag, object_files, root1, libext, libs)
     324  elif FN=="p_test.c":
     325    if libs is "":
     326      s = '%s -%s %s ptinpoly.o rand48.o -o %s.%s -lm  -fopenmp ' %(loader, sharedflag, object_files, root1, libext)
     327    else:
     328      s = '%s -%s %s ptinpoly.o rand48.o -o %s.%s "%s" -lm  -fopenmp ' %(loader, sharedflag, object_files, root1, libext, libs)
    316329  else:
    317330    if libs is "":
    318       s = '%s -%s %s -o %s.%s -lm -lblas -fopenmp' %(loader, sharedflag, object_files, root1, libext)
    319     else:
    320       s = '%s -%s %s -o %s.%s "%s" -lm -lblas -fopenmp' %(loader, sharedflag, object_files, root1, libext, libs)
     331      s = '%s -%s %s -o %s.%s -lm -fopenmp' %(loader, sharedflag, object_files, root1, libext)
     332    else:
     333      s = '%s -%s %s -o %s.%s "%s" -lm -fopenmp' %(loader, sharedflag, object_files, root1, libext, libs)
    321334 
    322335 
Note: See TracChangeset for help on using the changeset viewer.