@@ -200,6 +200,62 @@ def check_unix_compiler(plat, plat_ver, compiler, extensions, compiler_name):
200
200
201
201
return status
202
202
203
+ #
204
+ # Checking if certain optimizations are available
205
+ #
206
+ def check_unix_optimization (plat , plat_ver , compiler , extensions , compiler_name ):
207
+
208
+ #
209
+ # checking is fsincos is enabled
210
+ #
211
+ import tempfile
212
+ import random
213
+ import string
214
+
215
+ tempdir = tempfile .gettempdir ();
216
+
217
+ pat = '' .join (random .choice (string .ascii_uppercase + string .digits ) for _ in range (10 ))
218
+ src = pat + '_sincos_opt.c'
219
+ exe = pat + '_sincos_opt.exe'
220
+ obj = pat + '_sincos_opt.o'
221
+
222
+ with open (tempdir + '/' + src , 'w' ) as tmp :
223
+ tmp .writelines ([
224
+ '#include <math.h>\n ' ,
225
+ 'void our_sincos(double angle, double *s, double *c){\n ' ,
226
+ ' asm volatile("fsincos" : "=t" (*c), "=u" (*s) : "0" (angle));\n ' ,
227
+ '}\n ' ,
228
+
229
+ 'int main() {\n ' ,
230
+ ' double t = 1, x[2];\n ' ,
231
+ ' our_sincos(t, x, x+1);\n ' ,
232
+ ' return 0;\n ' ,
233
+ '}\n '
234
+ ])
235
+
236
+ status = True
237
+ try :
238
+ objects = compiler .compile ([tempdir + '/' + src ], output_dir = tempdir )
239
+ compiler .link_executable (objects , exe , output_dir = tempdir )
240
+
241
+ if re .search (r'gcc' , compiler_name ) or re .search (r'g\+\+' , compiler_name ) or \
242
+ re .search (r'clang' , compiler_name ) or re .search (r'icc' , compiler_name ) or \
243
+ re .search (r'icpc' , compiler_name ):
244
+ for e in extensions : e .extra_compile_args .append ('-DTARGET_HAS_SINCOS' )
245
+ else :
246
+ print ("Did not recognize the compiler %s." % (compiler_name ))
247
+ status = False
248
+ except :
249
+ print ("Failed to compile sincos test case on compiler %s." % (compiler_name ))
250
+ status = False
251
+
252
+ # Cleanup
253
+ removefile (tempdir + '/' + src )
254
+ removefile (tempdir + '/' + exe )
255
+ removefile (tempdir + '/' + obj )
256
+
257
+ return status
258
+
203
259
#
204
260
# Hooking the building of extentions
205
261
#
@@ -219,6 +275,9 @@ def build_extensions(self):
219
275
build_ext .build_extensions (self )
220
276
221
277
elif plat in ['Linux' , 'Darwin' ]:
278
+
279
+ check_unix_optimization (plat , plat_ver , self .compiler , self .extensions , self .compiler .compiler_cxx [0 ])
280
+
222
281
if (
223
282
check_unix_compiler (plat , plat_ver , self .compiler , self .extensions , self .compiler .compiler_cxx [0 ]) and
224
283
check_unix_compiler (plat , plat_ver , self .compiler , self .extensions , self .compiler .compiler_so [0 ])
@@ -346,8 +405,8 @@ def _env_variable_bool(key, default):
346
405
long_description = "\n " .join (long_description_s [long_description_s .index ("INTRODUCTION" ):])
347
406
348
407
setup (name = 'phoebe' ,
349
- version = '2.3.60 ' ,
350
- description = 'PHOEBE 2.3.60 ' ,
408
+ version = '2.3.61 ' ,
409
+ description = 'PHOEBE 2.3.61 ' ,
351
410
long_description = long_description ,
352
411
author = 'PHOEBE development team' ,
353
412
author_email = 'phoebe-devel@lists.sourceforge.net' ,
@@ -367,7 +426,7 @@ def _env_variable_bool(key, default):
367
426
'Programming Language :: Python :: 3 :: Only' ,
368
427
],
369
428
python_requires = '>=3.6, <4' ,
370
- download_url = 'https://github.com/phoebe-project/phoebe2/tarball/2.3.60 ' ,
429
+ download_url = 'https://github.com/phoebe-project/phoebe2/tarball/2.3.61 ' ,
371
430
packages = ['phoebe' , 'phoebe.parameters' , 'phoebe.parameters.solver' , 'phoebe.parameters.figure' , 'phoebe.frontend' , 'phoebe.constraints' , 'phoebe.dynamics' , 'phoebe.distortions' , 'phoebe.algorithms' , 'phoebe.atmospheres' , 'phoebe.backend' , 'phoebe.solverbackends' , 'phoebe.solverbackends.ebai' , 'phoebe.utils' , 'phoebe.helpers' , 'phoebe.pool' , 'phoebe.dependencies' , 'phoebe.dependencies.autofig' , 'phoebe.dependencies.nparray' , 'phoebe.dependencies.distl' , 'phoebe.dependencies.unitsiau2015' ],
372
431
install_requires = ['numpy>=1.12' ,'scipy>=1.2' ,'astropy>=1.0' , 'corner' , 'pytest' , 'requests' , 'python-socketio[client]' ]+ ['flask' , 'flask-cors' , 'flask-socketio==4.3.*' , 'gevent-websocket' ],
373
432
package_data = {'phoebe.atmospheres' :['tables/wd/*' , 'tables/passbands/*' ],
0 commit comments