Changeset 739aad4 in sasmodels
- Timestamp:
- Jul 27, 2016 2:18:18 PM (8 years ago)
- 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:
- 0c24a82
- Parents:
- df776db
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
rdf776db r739aad4 496 496 """ 497 497 if callable(model_info.Iq): 498 #raise ValueError("can't compile python model")499 return None498 raise ValueError("can't compile python model") 499 #return None 500 500 501 501 # TODO: need something other than volume to indicate dispersion parameters -
sasmodels/kerneldll.py
rdf776db r739aad4 57 57 import numpy as np # type: ignore 58 58 59 try: 60 import tinycc 61 except ImportError: 62 tinycc = None 63 59 64 from . import generate 60 65 from .kernel import KernelModel, Kernel … … 70 75 pass 71 76 72 if os.name == 'nt': 73 ARCH = "" if sys.maxint > 2**32 else "x86" # maxint=2**31-1 on 32 bit 74 # Windows compiler; check if TinyCC is available 75 try: 76 import tinycc 77 if "DONT_USE_TINYCC" in os.environ: 78 tinycc = None 79 except ImportError: 80 tinycc = None 81 # call vcvarsall.bat before compiling to set path, headers, libs, etc. 77 if "SAS_COMPILER" in os.environ: 78 compiler = os.environ["SAS_COMPILER"] 79 elif os.name == 'nt': 80 # If vcvarsall.bat has been called, then VCINSTALLDIR is in the environment 81 # and we can use the MSVC compiler. Otherwise, if tinycc is available 82 # the use it. Otherwise, hope that mingw is available. 82 83 if "VCINSTALLDIR" in os.environ: 83 # MSVC compiler is available, so use it. OpenMP requires a copy of 84 # vcomp90.dll on the path. One may be found here: 85 # C:/Windows/winsxs/x86_microsoft.vc90.openmp*/vcomp90.dll 86 # Copy this to the python directory and uncomment the OpenMP COMPILE 87 # TODO: remove intermediate OBJ file created in the directory 88 # TODO: maybe don't use randomized name for the c file 89 # TODO: maybe ask distutils to find MSVC 90 CC = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG".split() 91 if "SAS_OPENMP" in os.environ: 92 CC.append("/openmp") 93 LN = "/link /DLL /INCREMENTAL:NO /MANIFEST".split() 94 def compile_command(source, output): 95 return CC + ["/Tp%s"%source] + LN + ["/OUT:%s"%output] 84 compiler = "msvc" 96 85 elif tinycc: 97 # TinyCC compiler. 98 CC = [tinycc.TCC] + "-shared -rdynamic -Wall".split() 99 def compile_command(source, output): 100 return CC + [source, "-o", output] 86 compiler = "tinycc" 101 87 else: 102 # MinGW compiler. 103 CC = "gcc -shared -std=c99 -O2 -Wall".split() 104 if "SAS_OPENMP" in os.environ: 105 CC.append("-fopenmp") 106 def compile_command(source, output): 107 return CC + [source, "-o", output, "-lm"] 88 compiler = "mingw" 108 89 else: 109 ARCH = "" 90 compiler = "unix" 91 92 ARCH = "" if sys.maxint > 2**32 else "x86" # maxint=2**31-1 on 32 bit 93 if compiler == "unix": 110 94 # Generic unix compile 111 95 # On mac users will need the X code command line tools installed … … 114 98 # add openmp support if not running on a mac 115 99 if sys.platform != "darwin": 100 CC.append("-fopenmp") 101 def compile_command(source, output): 102 return CC + [source, "-o", output, "-lm"] 103 elif compiler == "msvc": 104 # Call vcvarsall.bat before compiling to set path, headers, libs, etc. 105 # MSVC compiler is available, so use it. OpenMP requires a copy of 106 # vcomp90.dll on the path. One may be found here: 107 # C:/Windows/winsxs/x86_microsoft.vc90.openmp*/vcomp90.dll 108 # Copy this to the python directory and uncomment the OpenMP COMPILE 109 # TODO: remove intermediate OBJ file created in the directory 110 # TODO: maybe don't use randomized name for the c file 111 # TODO: maybe ask distutils to find MSVC 112 CC = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG".split() 113 if "SAS_OPENMP" in os.environ: 114 CC.append("/openmp") 115 LN = "/link /DLL /INCREMENTAL:NO /MANIFEST".split() 116 def compile_command(source, output): 117 return CC + ["/Tp%s"%source] + LN + ["/OUT:%s"%output] 118 elif compiler == "tinycc": 119 # TinyCC compiler. 120 CC = [tinycc.TCC] + "-shared -rdynamic -Wall".split() 121 def compile_command(source, output): 122 return CC + [source, "-o", output] 123 elif compiler == "mingw": 124 # MinGW compiler. 125 CC = "gcc -shared -std=c99 -O2 -Wall".split() 126 if "SAS_OPENMP" in os.environ: 116 127 CC.append("-fopenmp") 117 128 def compile_command(source, output):
Note: See TracChangeset
for help on using the changeset viewer.