Changeset 8fff00e in sasmodels


Ignore:
Timestamp:
Feb 13, 2015 3:47:26 AM (9 years ago)
Author:
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:
be802cb
Parents:
df4dc86 (diff), 3fdb4b6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge

Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    rdf4dc86 r8fff00e  
    55*.so 
    66*.obj 
     7/doc/_build/ 
     8/doc/api/ 
     9/doc/model/ 
     10.mplconfig 
  • sasmodels/gen.py

    rdf4dc86 r8fff00e  
    438438    Convert code from double precision to single precision. 
    439439    """ 
    440     source = re.sub(r'(^|[^a-zA-Z0-9_])double($|[^a-zA-Z0-9_])', 
     440    # Convert double keyword to float.  Accept an 'n' parameter for vector 
     441    # values, where n is 2, 4, 8 or 16. Assume complex numbers are represented 
     442    # as cdouble which is typedef'd to double2. 
     443    source = re.sub(r'(^|[^a-zA-Z0-9_]c?)double(([248]|16)?($|[^a-zA-Z0-9_]))', 
    441444                    r'\1float\2', source) 
     445    # Convert floating point constants to single by adding 'f' to the end. 
     446    # OS/X driver complains if you don't do this. 
    442447    source = re.sub(r'[^a-zA-Z_](\d*[.]\d+|\d+[.]\d*)([eE][+-]?\d+)?', 
    443448                    r'\g<0>f', source) 
  • sasmodels/dll.py

    r216a9e1 rdf4dc86  
    44import sys 
    55import os 
     6import tempfile 
    67import ctypes as ct 
    78from ctypes import c_void_p, c_int, c_double 
     
    1516if sys.platform == 'darwin': 
    1617    #COMPILE = "gcc-mp-4.7 -shared -fPIC -std=c99 -fopenmp -O2 -Wall %s -o %s -lm -lgomp" 
    17     COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %s -o %s -lm" 
     18    COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %(source)s -o %(output)s -lm" 
    1819elif os.name == 'nt': 
    19     COMPILE = "gcc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %s -o %s -lm" 
     20    # make sure vcvarsall.bat is called first in order to set compiler, headers, lib paths, etc. 
     21    ##COMPILER = r'"C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe"' 
     22    # Can't find VCOMP90.DLL (don't know why), so remove openmp support from windows compiler build 
     23    #COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
     24    COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /openmp /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
     25    #/MANIFESTFILE:build\temp.win32-2.7\Release\src\sans\models\c_extension\libigor\c_models.pyd.manifest 
     26    #COMPILE = "gcc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm" 
    2027else: 
    21     COMPILE = "cc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %s -o %s -lm" 
    22 DLL_PATH = "/tmp" 
     28    COMPILE = "cc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm" 
     29 
     30DLL_PATH = tempfile.gettempdir() 
    2331 
    2432 
     
    5361        fid, filename = tempfile.mkstemp(suffix=".c",prefix="sas_"+info['name']) 
    5462        os.fdopen(fid,"w").write(source) 
    55         status = os.system(COMPILE%(filename, dllpath)) 
     63        command = COMPILE%{"source":filename, "output":dllpath} 
     64        print "Compile command:",command 
     65        status = os.system(command) 
    5666        if status != 0: 
    5767            print "compile failed.  File is in %r"%filename 
     
    91101        Npd2d = len(self.info['partype']['pd-2d']) 
    92102 
     103        #print "dll",self.dllpath 
    93104        self.dll = ct.CDLL(self.dllpath) 
    94105 
Note: See TracChangeset for help on using the changeset viewer.