Changes in / [8fff00e:3fdb4b6] in sasmodels


Ignore:
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    rdf4dc86 r660cdd6  
    44*.cl 
    55*.so 
    6 *.obj 
    76/doc/_build/ 
    87/doc/api/ 
  • sasmodels/dll.py

    rdf4dc86 r216a9e1  
    44import sys 
    55import os 
    6 import tempfile 
    76import ctypes as ct 
    87from ctypes import c_void_p, c_int, c_double 
     
    1615if sys.platform == 'darwin': 
    1716    #COMPILE = "gcc-mp-4.7 -shared -fPIC -std=c99 -fopenmp -O2 -Wall %s -o %s -lm -lgomp" 
    18     COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %(source)s -o %(output)s -lm" 
     17    COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %s -o %s -lm" 
    1918elif os.name == 'nt': 
    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" 
     19    COMPILE = "gcc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %s -o %s -lm" 
    2720else: 
    28     COMPILE = "cc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm" 
    29  
    30 DLL_PATH = tempfile.gettempdir() 
     21    COMPILE = "cc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %s -o %s -lm" 
     22DLL_PATH = "/tmp" 
    3123 
    3224 
     
    6153        fid, filename = tempfile.mkstemp(suffix=".c",prefix="sas_"+info['name']) 
    6254        os.fdopen(fid,"w").write(source) 
    63         command = COMPILE%{"source":filename, "output":dllpath} 
    64         print "Compile command:",command 
    65         status = os.system(command) 
     55        status = os.system(COMPILE%(filename, dllpath)) 
    6656        if status != 0: 
    6757            print "compile failed.  File is in %r"%filename 
     
    10191        Npd2d = len(self.info['partype']['pd-2d']) 
    10292 
    103         #print "dll",self.dllpath 
    10493        self.dll = ct.CDLL(self.dllpath) 
    10594 
  • sasmodels/gen.py

    rdf4dc86 r3699587  
    226226// Note: if using a C++ compiler, then define kernel as extern "C" 
    227227#ifndef USE_OPENCL 
    228 #  ifdef __cplusplus 
    229      #include <cmath> 
    230      #if defined(_MSC_VER) 
    231      #define kernel extern "C" __declspec( dllexport ) 
    232      #else 
    233      #define kernel extern "C" 
    234      #endif 
    235      using namespace std; 
    236      inline void SINCOS(double angle, double &svar, double &cvar) 
    237        { svar=sin(angle); cvar=cos(angle); } 
    238 #  else 
    239      #include <math.h> 
    240      #if defined(_MSC_VER) 
    241      #define kernel __declspec( dllexport ) 
    242      #else 
    243      #define kernel 
    244      #endif 
    245      #define SINCOS(angle,svar,cvar) do {svar=sin(angle);cvar=cos(angle);} while (0) 
    246 #  endif 
     228#  include <math.h> 
    247229#  define global 
    248230#  define local 
    249231#  define constant const 
     232#  define kernel 
     233#  define SINCOS(angle,svar,cvar) do {svar=sin(angle);cvar=cos(angle);} while (0) 
    250234#  define powr(a,b) pow(a,b) 
    251235#else 
Note: See TracChangeset for help on using the changeset viewer.