Changeset a30cdd5 in sasmodels for sasmodels/kerneldll.py


Ignore:
Timestamp:
Nov 24, 2015 1:29:36 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
5753e4e
Parents:
7be65ea
Message:

use SAS_OPENMP=1 in environment to use openmp for dlls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    r0763009 ra30cdd5  
    2626    # call vcvarsall.bat before compiling to set path, headers, libs, etc. 
    2727    if "VCINSTALLDIR" in os.environ: 
    28         # MSVC compiler is available, so use it. 
     28        # MSVC compiler is available, so use it.  OpenMP requires a copy of 
     29        # vcomp90.dll on the path.  One may be found here: 
     30        #       C:/Windows/winsxs/x86_microsoft.vc90.openmp*/vcomp90.dll 
     31        # Copy this to the python directory and uncomment the OpenMP COMPILE 
    2932        # TODO: remove intermediate OBJ file created in the directory 
    3033        # TODO: maybe don't use randomized name for the c file 
    31         #COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /openmp /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
    32         # Can't find VCOMP90.DLL (don't know why), so remove openmp support 
    33         # from windows compiler build 
    34         COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
     34        CC = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s " 
     35        LN = "/link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
     36        if "SAS_OPENMP" in os.environ: 
     37            COMPILE = " ".join((CC, "/openmp", LN)) 
     38        else: 
     39            COMPILE = " ".join((CC, LN)) 
    3540    else: 
    36         #COMPILE = "gcc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm" 
    3741        COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %(source)s -o %(output)s -lm" 
     42        if "SAS_OPENMP" in os.environ: 
     43            COMPILE = COMPILE + " -fopenmp" 
    3844else: 
    39     COMPILE = "cc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm" 
     45    COMPILE = "cc -shared -fPIC -fopenmp -std=c99 -O2 -Wall %(source)s -o %(output)s -lm" 
    4046 
    4147DLL_PATH = tempfile.gettempdir() 
Note: See TracChangeset for help on using the changeset viewer.