Changes in sasmodels/kerneldll.py [bf94e6e:1a3559f] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    rbf94e6e r1a3559f  
    9999    pass 
    100100# pylint: enable=unused-import 
     101 
     102if "SAS_DLL_PATH" in os.environ: 
     103    SAS_DLL_PATH = os.environ["SAS_DLL_PATH"] 
     104else: 
     105    # Assume the default location of module DLLs is in .sasmodels/compiled_models. 
     106    SAS_DLL_PATH = os.path.join(os.path.expanduser("~"), ".sasmodels", "compiled_models") 
    101107 
    102108if "SAS_COMPILER" in os.environ: 
     
    123129    # add openmp support if not running on a mac 
    124130    if sys.platform != "darwin": 
    125         CC.append("-fopenmp") 
     131        # OpenMP seems to be broken on gcc 5.4.0 (ubuntu 16.04.9) 
     132        # Shut it off for all unix until we can investigate. 
     133        #CC.append("-fopenmp") 
     134        pass 
    126135    def compile_command(source, output): 
    127136        """unix compiler command""" 
     
    158167        return CC + [source, "-o", output, "-lm"] 
    159168 
    160 # Assume the default location of module DLLs is in .sasmodels/compiled_models. 
    161 DLL_PATH = os.path.join(os.path.expanduser("~"), ".sasmodels", "compiled_models") 
    162  
    163169ALLOW_SINGLE_PRECISION_DLLS = True 
    164170 
     
    197203        return path 
    198204 
    199     return joinpath(DLL_PATH, basename) 
     205    return joinpath(SAS_DLL_PATH, basename) 
    200206 
    201207 
     
    206212    exist yet if it hasn't been compiled. 
    207213    """ 
    208     return os.path.join(DLL_PATH, dll_name(model_info, dtype)) 
     214    return os.path.join(SAS_DLL_PATH, dll_name(model_info, dtype)) 
    209215 
    210216 
     
    225231    models are not allowed as DLLs. 
    226232 
    227     Set *sasmodels.kerneldll.DLL_PATH* to the compiled dll output path. 
     233    Set *sasmodels.kerneldll.SAS_DLL_PATH* to the compiled dll output path. 
     234    Alternatively, set the environment variable *SAS_DLL_PATH*. 
    228235    The default is in ~/.sasmodels/compiled_models. 
    229236    """ 
     
    244251    if need_recompile: 
    245252        # Make sure the DLL path exists 
    246         if not os.path.exists(DLL_PATH): 
    247             os.makedirs(DLL_PATH) 
     253        if not os.path.exists(SAS_DLL_PATH): 
     254            os.makedirs(SAS_DLL_PATH) 
    248255        basename = splitext(os.path.basename(dll))[0] + "_" 
    249256        system_fd, filename = tempfile.mkstemp(suffix=".c", prefix=basename) 
Note: See TracChangeset for help on using the changeset viewer.