- Timestamp:
- Dec 22, 2011 11:55:32 AM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 273801b
- Parents:
- 7983000f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
setup.py
r5c77050 r8ab3302 3 3 #TODO: Add checks to see that all the dependencies are on the system 4 4 """ 5 # [command] can be any of the following: 6 # -nomp: no openmp: Use this flag; C-lib without openmp as well as numpy < 1.6 7 5 8 import sys 6 7 9 import os 8 10 import platform … … 16 18 try: 17 19 import numpy 18 NUMPY_INC = os.path.join(os.path.split(numpy.__file__)[0],"core","include") 20 NUMPY_INC = os.path.join(os.path.split(numpy.__file__)[0], 21 "core","include") 19 22 except: 20 print "\nNumpy is needed to build SansView. Try easy_install numpy.\n %s" % str(sys.exc_value) 23 msg = "\nNumpy is needed to build SansView. " 24 print msg, "Try easy_install numpy.\n %s" % str(sys.exc_value) 21 25 sys.exit(0) 22 26 … … 31 35 ext_modules = [] 32 36 37 # Remove all files that should be updated by this setup 38 # We do this here because application updates these files from .sansview 39 # except when there is no such file 40 # Todo : make this list generic 41 plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py', 42 'sum_Ap1_1_Ap2.py', 'sum_p1_p2.py', 43 'testmodel_2.py', 'testmodel.py'] 44 sans_dir = os.path.join(os.path.expanduser("~"),'.sansview') 45 if os.path.isdir(sans_dir): 46 f_path = os.path.join(sans_dir, "sansview.log") 47 if os.path.isfile(f_path): 48 os.remove(f_path) 49 f_path = os.path.join(sans_dir, 'config', "custom_config.py") 50 if os.path.isfile(f_path): 51 os.remove(f_path) 52 f_path = os.path.join(sans_dir, 'plugin_models') 53 if os.path.isdir(f_path): 54 for file in os.listdir(f_path): 55 if file in plugin_model_list: 56 file_path = os.path.join(f_path, file) 57 os.remove(file_path) 58 33 59 if sys.argv[-1] == "-nomp": 34 60 # Disable OpenMP … … 56 82 print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 57 83 58 if not (sys.platform =='darwin' and not is_64bits):84 if not (sys.platform =='darwin' and not is_64bits): 59 85 if copt.has_key(c): 60 86 for e in self.extensions: … … 74 100 guiframe_path = os.path.join("sansguiframe", "src", "sans", "guiframe") 75 101 package_dir["sans.guiframe"] = guiframe_path 76 package_dir["sans.guiframe.local_perspectives"] = os.path.join(guiframe_path, "local_perspectives") 102 package_dir["sans.guiframe.local_perspectives"] = os.path.join(guiframe_path, 103 "local_perspectives") 77 104 package_data["sans.guiframe"] = ['images/*', 'media/*'] 78 105 packages.extend(["sans.guiframe", "sans.guiframe.local_perspectives"]) … … 82 109 package_name = "sans.guiframe.local_perspectives." + dir 83 110 packages.append(package_name) 84 package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", dir) 111 package_dir[package_name] = os.path.join(guiframe_path, 112 "local_perspectives", dir) 85 113 86 114 # sans.dataloader 87 package_dir["sans.dataloader"] = os.path.join("sansdataloader", "src", "sans", "dataloader") 115 package_dir["sans.dataloader"] = os.path.join("sansdataloader", 116 "src", "sans", "dataloader") 88 117 package_data["sans.dataloader.readers"] = ['defaults.xml'] 89 118 packages.extend(["sans.dataloader","sans.dataloader.readers"]) … … 120 149 121 150 # Invariant view 122 package_dir["sans.perspectives"] = os.path.join("invariantview", "src", "sans", "perspectives") 123 package_dir["sans.perspectives.invariant"] = os.path.join("invariantview", "src", "sans", "perspectives", "invariant") 151 package_dir["sans.perspectives"] = os.path.join("invariantview", "src", 152 "sans", "perspectives") 153 package_dir["sans.perspectives.invariant"] = os.path.join("invariantview", 154 "src", "sans", "perspectives", "invariant") 124 155 125 156 package_data['sans.perspectives.invariant'] = [os.path.join("media",'*')] … … 127 158 128 159 # Fitting view 129 package_dir["sans.perspectives"] = os.path.join("fittingview", "src", "sans", "perspectives"), 130 package_dir["sans.perspectives.fitting"] = os.path.join("fittingview", "src", "sans", "perspectives", "fitting") 160 fitting_path = os.path.join("fittingview", "src", "sans", 161 "perspectives", "fitting") 162 package_dir["sans.perspectives"] = os.path.join("fittingview", 163 "src", "sans", "perspectives"), 164 package_dir["sans.perspectives.fitting"] = fitting_path 165 package_dir["sans.perspectives.fitting.plugin_models"] = \ 166 os.path.join(fitting_path, "plugin_models") 131 167 package_data['sans.perspectives.fitting'] = ['media/*','plugin_models/*'] 132 packages.extend(["sans.perspectives", "sans.perspectives.fitting"]) 168 packages.extend(["sans.perspectives", "sans.perspectives.fitting", 169 "sans.perspectives.fitting.plugin_models"]) 133 170 134 171 # Calculator view 135 172 package_dir["sans.perspectives"] = "calculatorview/src/sans/perspectives" 136 package_dir["sans.perspectives.calculator"] = os.path.join("calculatorview", "src", "sans", "perspectives", "calculator") 173 package_dir["sans.perspectives.calculator"] = os.path.join("calculatorview", 174 "src", "sans", "perspectives", "calculator") 137 175 package_data['sans.perspectives.calculator'] = ['images/*', 'media/*'] 138 176 packages.extend(["sans.perspectives", "sans.perspectives.calculator"]) … … 144 182 # Plottools 145 183 package_dir["danse"] = os.path.join("plottools", "src", "danse") 146 package_dir["danse.common"] = os.path.join("plottools", "src", "danse", "common") 147 package_dir["danse.common.plottools"] = os.path.join("plottools", "src", "danse", "common", "plottools") 184 package_dir["danse.common"] = os.path.join("plottools", "src", 185 "danse", "common") 186 package_dir["danse.common.plottools"] = os.path.join("plottools", 187 "src", "danse", "common", "plottools") 148 188 packages.extend(["danse", "danse.common", "danse.common.plottools"]) 149 189 … … 153 193 package_data["park"] = ['park-1.2.1/*.txt', 'park-1.2.1/park.epydoc'] 154 194 ext_modules.append( Extension("park._modeling", 155 sources = [ os.path.join("park-1.2.1", "park", "lib", "modeling.cc"), 156 os.path.join("park-1.2.1", "park", "lib", "resolution.c"), 195 sources = [ os.path.join("park-1.2.1", 196 "park", "lib", "modeling.cc"), 197 os.path.join("park-1.2.1", 198 "park", "lib", "resolution.c"), 157 199 ], 158 200 ) ) … … 225 267 ext_modules.extend( [ Extension("sans.models.sans_extension.c_models", 226 268 sources=model_sources, 227 include_dirs=[igordir, srcdir, c_model_dir, numpy_incl_path], 269 include_dirs=[igordir, srcdir, 270 c_model_dir, numpy_incl_path], 228 271 ), 229 272 # Smearer extension 230 273 Extension("sans.models.sans_extension.smearer", 231 274 sources = smearer_sources, 232 include_dirs=[igordir, smear_dir, numpy_incl_path], 275 include_dirs=[igordir, 276 smear_dir, numpy_incl_path], 233 277 ), 234 278 235 279 Extension("sans.models.sans_extension.smearer2d_helper", 236 280 sources = [os.path.join(smear_dir, 237 "smearer2d_helper_module.cpp"), 238 os.path.join(smear_dir, "smearer2d_helper.cpp"),], 281 "smearer2d_helper_module.cpp"), 282 os.path.join(smear_dir, 283 "smearer2d_helper.cpp"),], 239 284 include_dirs=[smear_dir,numpy_incl_path], 240 285 ) … … 246 291 packages.append("sans.sansview") 247 292 248 #required = ['lxml>=2.2.2', 'numpy>=1.4.1', 'matplotlib>=0.99.1.1', 'wxPython>=2.8.11', 249 # 'pil','periodictable>=1.3.0', 'scipy>=0.7.2'] 293 #required = ['lxml>=2.2.2', 'numpy>=1.4.1', 'matplotlib>=0.99.1.1', 294 # 'wxPython>=2.8.11', 'pil', 295 # 'periodictable>=1.3.0', 'scipy>=0.7.2'] 250 296 required = ['lxml','periodictable>=1.3.0'] 251 297 """ 252 298 if os.name=='nt': 253 299 #required.extend(['comtypes', 'pisa', 'html5lib', 'reportlab']) 254 required.extend(['pisa', 'html5lib'])300 #required.extend(['pisa', 'html5lib']) 255 301 if sys.version_info < (2, 7): 256 302 required.append('comtypes')
Note: See TracChangeset
for help on using the changeset viewer.