Changeset ebdb833 in sasview


Ignore:
Timestamp:
Dec 28, 2011 6:04:56 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e79a467
Parents:
9e5ec99
Message:

Re #5 Make sure platform-specific build options are separated from openmp option

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/setup.py

    r5c77050 rebdb833  
    44 
    55import sys 
    6  
    76import os 
    87import platform 
     
    1514 
    1615# Options to enable OpenMP 
     16copt =  {'msvc': ['/openmp'], 
     17         'mingw32' : ['-fopenmp'], 
     18         'unix' : ['-fopenmp']} 
     19lopt =  {'msvc': ['/MANIFEST'], 
     20         'mingw32' : ['-fopenmp'], 
     21         'unix' : ['-lgomp']} 
     22 
     23# Options for non-openmp builds. MSVC always needs MANIFEST 
    1724if sys.argv[-1] == "-nomp": 
    18     # Disable OpenMP 
    1925    copt = {} 
    20     lopt = {} 
    21 else: 
    22     print "openmp ENABLED" 
    23     copt =  {'msvc': ['/openmp'], 
    24              'mingw32' : ['-fopenmp'], 
    25              'unix' : ['-fopenmp']} 
    26     lopt =  {'msvc': ['/MANIFEST'], 
    27              'mingw32' : ['-fopenmp'], 
    28              'unix' : ['-lgomp']} 
     26    lopt = {'msvc': ['/MANIFEST']} 
    2927 
    3028class build_ext_subclass( build_ext ): 
     
    3735            is_64bits = False 
    3836        c = self.compiler.compiler_type 
    39  
    4037        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 
     38         
    4139        if not (sys.platform=='darwin' and not is_64bits): 
    4240            if copt.has_key(c): 
  • setup.py

    reb32080e rebdb833  
    8585         'unix' : ['-lgomp']} 
    8686 
     87# Platform-specific link options 
     88platform_lopt = {'msvc' : ['/MANIFEST']} 
     89 
    8790class build_ext_subclass( build_ext ): 
    8891    def build_extensions(self): 
     
    9194        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 
    9295         
     96        # OpenMP build options 
    9397        if enable_openmp: 
    9498            if copt.has_key(c): 
     
    96100                   e.extra_compile_args = copt[ c ] 
    97101            if lopt.has_key(c): 
    98                  
    99102                for e in self.extensions: 
    100103                    e.extra_link_args = lopt[ c ] 
    101104                     
     105        # Platform-specific build options 
     106        if platform_lopt.has_key(c): 
     107            for e in self.extensions: 
     108                e.extra_link_args = platform_lopt[ c ] 
     109 
    102110        build_ext.build_extensions(self) 
    103111 
Note: See TracChangeset for help on using the changeset viewer.