Changeset 13f00a0 in sasview
- Timestamp:
- Dec 9, 2011 4:27:02 PM (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:
- 2cef9d3
- Parents:
- 849fa92
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/setup.py
rb57e704 r13f00a0 11 11 # Then build and install the modules 12 12 from distutils.core import Extension, setup 13 #from setuptools import setup#, find_packages 13 from distutils.command.build_ext import build_ext 14 15 # Options to enable OpenMP 16 copt = {'msvc': ['/openmp'], 17 'mingw32' : ['-fopenmp'], 18 'unix' : ['-fopenmp']} 19 lopt = {'msvc': ['/MANIFEST'], 20 'mingw32' : ['-fopenmp'], 21 'unix' : ['-lgomp']} 22 23 class build_ext_subclass( build_ext ): 24 def build_extensions(self): 25 # Get 64-bitness 26 is_64bits = sys.maxsize > 2**32 27 28 c = self.compiler.compiler_type 29 print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 30 31 if not (sys.platform=='darwin' and not is_64bits): 32 if copt.has_key(c): 33 for e in self.extensions: 34 e.extra_compile_args = copt[ c ] 35 if lopt.has_key(c): 36 for e in self.extensions: 37 e.extra_link_args = lopt[ c ] 38 39 build_ext.build_extensions(self) 14 40 15 41 # Build the module name … … 70 96 smearer_sources.append(os.path.join(igordir, "winFuncs.c")) 71 97 72 # Enable OpenMP73 extra_compile_args = []74 extra_link_args = []75 if sys.platform=='linux2' or (sys.platform=='darwin' and platform.architecture()[0]=='64bit'):76 extra_compile_args = ['-fopenmp']77 extra_link_args = ['-lgomp']78 elif sys.platform=='win32':79 extra_compile_args = ['/openmp']80 extra_link_args = ['/MANIFEST']81 82 98 dist = setup( 83 99 name="sansmodels", … … 103 119 sources=model_sources, 104 120 include_dirs=[igordir, srcdir, c_model_dir, numpy_incl_path], 105 extra_compile_args=extra_compile_args,106 extra_link_args=extra_link_args107 121 ), 108 122 … … 110 124 Extension("sans.models.sans_extension.smearer", 111 125 sources = smearer_sources, 112 include_dirs=[igordir, smear_dir, numpy_incl_path]), 126 include_dirs=[igordir, smear_dir, numpy_incl_path], 127 ), 128 113 129 Extension("sans.models.sans_extension.smearer2d_helper", 114 130 sources = [os.path.join(smear_dir, … … 116 132 os.path.join(smear_dir, "smearer2d_helper.cpp"),], 117 133 include_dirs=[smear_dir,numpy_incl_path], 118 extra_compile_args=extra_compile_args, 119 extra_link_args=extra_link_args 120 ) 121 ] 134 ) 135 ], 136 cmdclass = {'build_ext': build_ext_subclass } 122 137 ) 123 138 -
setup.py
r01de557 r13f00a0 24 24 ext_modules = [] 25 25 26 # TODO check for sans/__init__.py 27 28 # Enable OpenMP 29 extra_compile_args = [] 30 extra_link_args = [] 31 if sys.platform=='linux2' or (sys.platform=='darwin' and platform.architecture()[0]=='64bit'): 32 extra_compile_args = ['-fopenmp'] 33 extra_link_args = ['-lgomp'] 34 elif os.name=='nt': 35 extra_compile_args = ['/openmp'] 26 # Options to enable OpenMP 27 copt = {'msvc': ['/openmp'], 28 'mingw32' : ['-fopenmp'], 29 'unix' : ['-fopenmp']} 30 lopt = {'msvc': ['/MANIFEST'], 31 'mingw32' : ['-fopenmp'], 32 'unix' : ['-lgomp']} 33 34 class build_ext_subclass( build_ext ): 35 def build_extensions(self): 36 # Get 64-bitness 37 is_64bits = sys.maxsize > 2**32 38 39 c = self.compiler.compiler_type 40 print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 41 42 if not (sys.platform=='darwin' and not is_64bits): 43 if copt.has_key(c): 44 for e in self.extensions: 45 e.extra_compile_args = copt[ c ] 46 if lopt.has_key(c): 47 for e in self.extensions: 48 e.extra_link_args = lopt[ c ] 49 50 build_ext.build_extensions(self) 51 36 52 37 53 # sans.invariant … … 75 91 ], 76 92 include_dirs=[numpy_incl_path], 77 extra_compile_args=extra_compile_args,78 extra_link_args=extra_link_args79 93 ) ) 80 94 … … 126 140 os.path.join("park-1.2.1", "park", "lib", "resolution.c"), 127 141 ], 128 extra_compile_args=extra_compile_args,129 extra_link_args=extra_link_args130 142 ) ) 131 143 … … 198 210 sources=model_sources, 199 211 include_dirs=[igordir, srcdir, c_model_dir, numpy_incl_path], 200 extra_compile_args=extra_compile_args,201 extra_link_args=extra_link_args202 212 ), 203 213 # Smearer extension … … 205 215 sources = smearer_sources, 206 216 include_dirs=[igordir, smear_dir, numpy_incl_path], 207 extra_compile_args=extra_compile_args,208 extra_link_args=extra_link_args209 217 ), 210 218 … … 214 222 os.path.join(smear_dir, "smearer2d_helper.cpp"),], 215 223 include_dirs=[smear_dir,numpy_incl_path], 216 extra_compile_args=extra_compile_args,217 extra_link_args=extra_link_args218 224 ) 219 225 ] ) … … 255 261 "sansview = sans.sansview.sansview:run", 256 262 ] 257 } 263 }, 264 cmdclass = {'build_ext': build_ext_subclass } 258 265 )
Note: See TracChangeset
for help on using the changeset viewer.