Changeset 18e7309 in sasview


Ignore:
Timestamp:
Aug 4, 2016 11:54:35 AM (8 years ago)
Author:
lewis
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
2760662
Parents:
3931ea14
Message:

Add C extension for reading 2d BSL files

Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • run.py

    r832fea2 r18e7309  
    7272    platform = '%s-%s'%(get_platform(),sys.version[:3]) 
    7373    build_path = joinpath(root, 'build','lib.'+platform) 
    74      
    75     # Notify the help menu that the Sphinx documentation is in a different  
     74 
     75    # Notify the help menu that the Sphinx documentation is in a different 
    7676    # place than it otherwise would be. 
    7777    os.environ['SASVIEW_DOC_PATH'] = joinpath(build_path, "doc") 
     
    123123    # Compiled modules need to be pulled from the build directory. 
    124124    # Some packages are not where they are needed, so load them explicitly. 
     125    import sas.sascalc.file_converter 
     126    sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core', 
     127                                  joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))                     
     128 
     129    # Compiled modules need to be pulled from the build directory. 
     130    # Some packages are not where they are needed, so load them explicitly. 
    125131    import sas.sascalc.calculator 
    126132    sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 
  • setup.py

    rdb74ee8 r18e7309  
    99from distutils.command.build_ext import build_ext 
    1010from distutils.core import Command 
     11import numpy 
    1112 
    1213# Manage version number ###################################### 
     
    5455        print "Removing existing build directory", SASVIEW_BUILD, "for a clean build" 
    5556        shutil.rmtree(SASVIEW_BUILD) 
    56                      
     57 
    5758# 'sys.maxsize' and 64bit: Not supported for python2.5 
    5859is_64bits = False 
    5960if sys.version_info >= (2, 6): 
    6061    is_64bits = sys.maxsize > 2**32 
    61      
     62 
    6263enable_openmp = False 
    6364 
     
    118119        c = self.compiler.compiler_type 
    119120        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 
    120          
     121 
    121122        # OpenMP build options 
    122123        if enable_openmp: 
     
    127128                for e in self.extensions: 
    128129                    e.extra_link_args = lopt[ c ] 
    129                      
     130 
    130131        # Platform-specific build options 
    131132        if platform_lopt.has_key(c): 
     
    205206) 
    206207 
    207      
     208 
    208209# sas.sascalc.pr 
    209210srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
     
    217218                              include_dirs=[], 
    218219                              ) ) 
    219          
     220 
     221# sas.sascalc.file_converter 
     222mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext") 
     223package_dir["sas.sascalc.file_converter.core"] = mydir 
     224package_dir["sas.sascalc.file_converter"] = os.path.join("src","sas", "sascalc", "file_converter") 
     225packages.extend(["sas.sascalc.file_converter","sas.sascalc.file_converter.core"]) 
     226ext_modules.append( Extension("sas.sascalc.file_converter.core.bsl_loader", 
     227                              sources = [os.path.join(mydir, "bsl_loader.c")], 
     228                              include_dirs=[numpy.get_include()], 
     229                              ) ) 
     230 
    220231# sas.sascalc.fit 
    221232package_dir["sas.sascalc.fit"] = os.path.join("src", "sas", "sascalc", "fit") 
     
    239250packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
    240251package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
    241      
     252 
    242253# Data util 
    243254package_dir["sas.sascalc.data_util"] = os.path.join("src", "sas", "sascalc", "data_util") 
     
    294305                               'test/2d_data/*', 
    295306                               'test/save_states/*', 
    296                                'test/upcoming_formats/*',  
     307                               'test/upcoming_formats/*', 
    297308                                 'default_categories.json'] 
    298309packages.append("sas.sasview") 
     
    316327    required.extend(['pillow']) 
    317328 
    318 # Set up SasView     
     329# Set up SasView 
    319330setup( 
    320331    name="sasview", 
     
    341352                'docs': BuildSphinxCommand, 
    342353                'disable_openmp': DisableOpenMPCommand} 
    343     )    
     354    ) 
Note: See TracChangeset for help on using the changeset viewer.