Changeset 13f00a0 in sasview for sansmodels
- 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
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.