Changeset 9662


Ignore:
Timestamp:
Feb 11, 2015, 2:12:23 PM (10 years ago)
Author:
steve
Message:

added hacky code to link to mingw runtime library files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/anuga/__init__.py

    r9641 r9662  
    2121#-----------------------------------------------------
    2222
    23 from numpy.testing import Tester
    24 test = Tester().test
     23
    2524
    2625
     
    4443__svn_revision__ = filter(str.isdigit, "$Revision$")
    4544
    46 #from anuga.__metadata__ import  __date__, __author__
    47 
    48 #from .version import git_revision as __git_revision__
    49 #from .version import svn_revision as __svn_revision__
    50 
    51 
    52 
    5345
    5446
     
    7567        raise ImportError(msg)
    7668       
     69       
     70    #------------------------------------------
     71    # Hacky Code to allow binary install on windows
     72    # without a compiler by packaging the mingw
     73    # runtime libraries
     74    #-----------------------------------------
     75    MinGW = False
     76    GCC = False
     77    import subprocess
     78    try:
     79        output = subprocess.check_output('gcc -dumpmachine', shell=True)
     80        GCC = True
     81        MinGW = 'mingw' in output
     82    except Exception as e:
     83        print 'Error running gcc'
     84        pass
     85   
     86    # At runtime, If mingw not installed add mingw dlls folder to path
     87    import sys
     88    import os
     89    if sys.platform == 'win32':
     90        if not MinGW:
     91            (folder, tail) = os.path.split(__file__)
     92            runtime_dir = os.path.join(os.path.abspath(folder), 'runtime_dir')
     93            sys.path = runtime_dir + sys.path
     94   
     95   
     96    #---------------------------------
     97    # Setup the nose tester from numpy
     98    #---------------------------------
     99    from numpy.testing import Tester
     100    test = Tester().test
     101   
    77102    #--------------------------------
    78103    # Important basic classes
Note: See TracChangeset for help on using the changeset viewer.