File tree Expand file tree Collapse file tree 4 files changed +18
-29
lines changed
Expand file tree Collapse file tree 4 files changed +18
-29
lines changed Original file line number Diff line number Diff line change 3636 python -m pip install --upgrade pip
3737 python -m pip install wheel setuptools
3838 python -m pip install mako
39- python -m pip install numpy scipy matplotlib docutils pytest sphinx bumps==0.* unittest-xml-reporting tinycc siphash24
39+ python -m pip install numpy scipy matplotlib docutils pytest sphinx bumps==0.* unittest-xml-reporting tccbox siphash24
4040
4141 - name : setup pyopencl on Linux + macOS
4242 if : ${{ matrix.os != 'windows-latest' }}
Original file line number Diff line number Diff line change 8989 #else // !__cplusplus
9090 #include <inttypes.h> // C99 guarantees that int32_t types is here
9191 #include <stdio.h>
92- #if defined(__TINYC__ )
93- typedef int int32_t ;
94- #include <math.h>
95- // TODO: check isnan is correct
96- inline double _isnan (double x ) { return x != x ; } // hope this doesn't optimize away!
97- #undef isnan
98- #define isnan (x ) _isnan(x)
99- // Defeat the double->float conversion since we don't have tgmath
100- inline SAS_DOUBLE trunc (SAS_DOUBLE x ) { return x >=0 ?floor (x ):- floor (- x ); }
101- inline SAS_DOUBLE fmin (SAS_DOUBLE x , SAS_DOUBLE y ) { return x > y ? y : x ; }
102- inline SAS_DOUBLE fmax (SAS_DOUBLE x , SAS_DOUBLE y ) { return x < y ? y : x ; }
103- #define NEED_ERF
104- #define NEED_EXPM1
105- #define NEED_TGAMMA
106- #define NEED_CBRT
107- // expf missing from windows?
108- #define expf exp
109- #else
110- #include <tgmath.h> // C99 type-generic math, so sin(float) => sinf
111- #endif
92+ #define NEED_ERF
93+ #include <tgmath.h> // C99 type-generic math, so sin(float) => sinf
11294 // MSVC doesn't support C99, so no need for dllexport on C99 branch
11395 #define kernel
11496 #define SINCOS (angle ,svar ,cvar ) do {const double _t_=angle; svar=sin(_t_);cvar=cos(_t_);} while (0)
Original file line number Diff line number Diff line change 8181import numpy as np # type: ignore
8282
8383try :
84- import tinycc
84+ import tccbox
8585except ImportError :
86- tinycc = None
86+ tccbox = None
8787
8888from . import generate
8989from .kernel import KernelModel , Kernel
112112if "SAS_COMPILER" in os .environ :
113113 COMPILER = os .environ ["SAS_COMPILER" ]
114114elif os .name == 'nt' :
115- if tinycc is not None :
115+ if tccbox is not None :
116116 COMPILER = "tinycc"
117117 elif "VCINSTALLDIR" in os .environ :
118118 # If vcvarsall.bat has been called, then VCINSTALLDIR is in the
@@ -166,7 +166,17 @@ def compile_command(source, output):
166166 return CC + ["/Tp%s" % source ] + LN + ["/OUT:%s" % output ]
167167elif COMPILER == "tinycc" :
168168 # TinyCC compiler.
169- CC = [tinycc .TCC ] + "-shared -rdynamic -Wall" .split ()
169+ CC = [
170+ tccbox .tcc_bin_path (),
171+ "-nostdinc" ,
172+ "-std=c99" ,
173+ f"-L{ tccbox .tcc_lib_dir ()} " ,
174+ f"-L{ joinpath (tccbox .tcc_lib_dir (), 'tcc' )} " ,
175+ f"-I{ tccbox .tcc_dist_dir ()} /include" ,
176+ "-shared" ,
177+ "-rdynamic" ,
178+ "-Wall" ,
179+ ]
170180 def compile_command (source , output ):
171181 """tinycc compiler command"""
172182 return CC + [source , "-o" , output ]
Original file line number Diff line number Diff line change @@ -29,14 +29,11 @@ def find_version(package):
2929 return version [1 :- 1 ]
3030 raise RuntimeError ("Could not read version from %s/__init__.py" % package )
3131
32- install_requires = ['numpy' , 'scipy' ]
32+ install_requires = ['numpy' , 'scipy' , 'tccbox' ]
3333
3434with open ('README.rst' ) as fid :
3535 long_description = fid .read ()
3636
37- if sys .platform == 'win32' or sys .platform == 'cygwin' :
38- install_requires .append ('tinycc' )
39-
4037setup (
4138 name = 'sasmodels' ,
4239 version = find_version ('sasmodels' ),
You can’t perform that action at this time.
0 commit comments