Changeset 2a55a6f in sasmodels


Ignore:
Timestamp:
Apr 26, 2016 6:50:12 PM (9 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:
a062d18
Parents:
98cb4d7
Message:

add support for tinycc

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r4a82d4d r2a55a6f  
    55*.pyc 
    66*.cl 
     7*.def 
    78*.so 
    89*.obj 
  • sasmodels/kernel_template.c

    r98cb4d7 r2a55a6f  
    2222         inline double fmin(double x, double y) { return x>y ? y : x; } 
    2323         inline double fmax(double x, double y) { return x<y ? y : x; } 
    24          inline double isnan(double x) { return _isnan(x); } 
     24         #define isnan(x) _isnan(x) 
     25         #define isinf(x) (!_finite(x)) 
     26         #define isfinite(x) _finite(x) 
    2527         #define NAN (std::numeric_limits<double>::quiet_NaN()) // non-signalling NaN 
     28         #define INFINITY (std::numeric_limits<double>::infinity()) 
    2629         #define NEED_EXPM1 
    2730         #define NEED_TGAMMA 
     
    3235#  else 
    3336     #include <stdio.h> 
    34      #include <tgmath.h> // C99 type-generic math, so sin(float) => sinf 
     37     #if defined(__TINYC__) 
     38         #include <math.h> 
     39         inline double trunc(double x) { return x>=0?floor(x):-floor(-x); } 
     40         inline double fmin(double x, double y) { return x>y ? y : x; } 
     41         inline double fmax(double x, double y) { return x<y ? y : x; } 
     42         // TODO: test isnan 
     43         inline double _isnan(double x) { return x != x; } // hope this doesn't optimize away! 
     44         #undef isnan 
     45         #define isnan(x) _isnan(x) 
     46         #define NEED_EXPM1 
     47         #define NEED_TGAMMA 
     48     #else 
     49         #include <tgmath.h> // C99 type-generic math, so sin(float) => sinf 
     50     #endif 
    3551     // MSVC doesn't support C99, so no need for dllexport on C99 branch 
    3652     #define kernel 
  • sasmodels/kerneldll.py

    re1454ab r2a55a6f  
    8484        if "SAS_OPENMP" in os.environ: 
    8585            COMPILE = COMPILE + " -fopenmp" 
     86        #COMPILE = "z:/tcc/tcc -shared -rdynamic -Wall %(source)s -o %(output)s" 
    8687else: 
    8788    COMPILE = "cc -shared -fPIC -fopenmp -std=c99 -O2 -Wall %(source)s -o %(output)s -lm" 
Note: See TracChangeset for help on using the changeset viewer.