Index: sansmodels/CMakeLists.txt
===================================================================
--- sansmodels/CMakeLists.txt	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
+++ sansmodels/CMakeLists.txt	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
@@ -0,0 +1,141 @@
+# CMakeLists for SANS models
+cmake_minimum_required (VERSION 2.6)
+project (SansModels)
+
+# Version number
+set (SansModels_VERSION_MAJOR 1)
+set (SansModels_VERSION_MAJOR 0)
+
+set (SRC_FILES
+    src/c_models/barbell.cpp
+    src/c_models/bcc.cpp
+    src/c_models/binaryHS.cpp
+    src/c_models/binaryHS_PSF11.cpp
+    src/c_models/capcyl.cpp
+    src/c_models/corefourshell.cpp
+    src/c_models/coreshellcylinder.cpp
+    src/c_models/coreshellsphere.cpp
+    src/c_models/csparallelepiped.cpp
+    src/c_models/cylinder.cpp
+    src/c_models/DiamCyl.cpp
+    src/c_models/DiamEllip.cpp
+    src/c_models/dispersion_visitor.cpp
+    src/c_models/ellipsoid.cpp
+    src/c_models/ellipticalcylinder.cpp
+    src/c_models/fcc.cpp
+    src/c_models/flexcyl_ellipX.cpp
+    src/c_models/flexiblecylinder.cpp
+    src/c_models/fractal.cpp
+    src/c_models/fuzzysphere.cpp
+    src/c_models/gamma_win.c
+    src/c_models/gaussian.cpp
+    src/c_models/Hardsphere.cpp
+    src/c_models/HayterMSA.cpp
+    src/c_models/hollowcylinder.cpp
+    src/c_models/lamellar.cpp
+    src/c_models/lamellarFF_HG.cpp
+    src/c_models/lamellarPC.cpp
+    src/c_models/lamellarPS.cpp
+    src/c_models/lamellarPS_HG.cpp
+    src/c_models/libfunc.c
+    src/c_models/librefl.c
+    src/c_models/logNormal.cpp
+    src/c_models/lorentzian.cpp
+    src/c_models/multishell.cpp
+    src/c_models/onion.cpp
+    src/c_models/parallelepiped.cpp
+    src/c_models/parameters.cpp
+    src/c_models/pearlnecklace.cpp
+    src/c_models/polygausscoil.cpp
+    src/c_models/refl.cpp
+    src/c_models/refl_adv.cpp
+    src/c_models/rpa.cpp
+    src/c_models/sc.cpp
+    src/c_models/schulz.cpp
+    src/c_models/sld_cal.cpp
+    src/c_models/sphere.cpp
+    src/c_models/spheresld.cpp
+    src/c_models/spheroid.cpp
+    src/c_models/SquareWell.cpp
+    src/c_models/stackeddisks.cpp
+    src/c_models/StickyHS.cpp
+    src/c_models/triaxialellipsoid.cpp
+    src/c_models/vesicle.cpp
+    src/libigor/GaussWeights.c
+    src/libigor/libCylinder.c
+    src/libigor/libSphere.c
+    src/libigor/libStructureFactor.c
+    src/libigor/libTwoPhase.c
+    )
+
+set ( INC_FILES
+    src/c_models/dispersion_visitor.hh
+    src/c_models/gamma_win.h
+    src/c_models/parameters.hh
+    include/barbell.h
+    include/bcc.h
+    include/binaryHS.h
+    include/capcyl.h
+    include/core_shell.h
+    include/core_shell_cylinder.h
+    include/corefourshell.h
+    include/csparallelepiped.h
+    include/cylinder.h
+    include/DiamCyl.h
+    include/DiamEllip.h
+    include/ellipsoid.h
+    include/elliptical_cylinder.h
+    include/fcc.h
+    include/flexcyl_ellipX.h
+    include/flexible_cylinder.h
+    include/fractal.h
+    include/fuzzysphere.h
+    include/gaussian.h
+    include/Hardsphere.h
+    include/HayterMSA.h
+    include/hollow_cylinder.h
+    include/lamellar.h
+    include/lamellarFF_HG.h
+    include/lamellarPC.h
+    include/lamellarPS.h
+    include/lamellarPS_HG.h
+    include/logNormal.h
+    include/lorentzian.h
+    include/multishell.h
+    include/onion.h
+    include/parallelepiped.h
+    include/pearlnecklace.h
+    include/polygausscoil.h
+    include/refl.h
+    include/refl_adv.h
+    include/rpa.h
+    include/sc.h
+    include/schulz.h
+    include/sld_cal.h
+    include/sphere.h
+    include/spheresld.h
+    include/spheroid.h
+    include/SquareWell.h
+    include/stacked_disks.h
+    include/StickyHS.h
+    include/triaxial_ellipsoid.h
+    include/vesicle.h
+    src/libigor/GaussWeights.h
+    src/libigor/libCylinder.h
+    src/libigor/libSANSAnalysis.h
+    src/libigor/libSphere.h
+    src/libigor/libStructureFactor.h
+    src/libigor/libTwoPhase.h
+    src/libigor/StandardHeaders.h
+    src/libigor/winFuncs.h
+
+)
+    
+include_directories (src/libigor include src/c_models)
+
+# Add the target for this directory
+add_library ( models ${SRC_FILES} ${INC_FILES})
+add_executable( libraryTest test/library_test.cpp  ${INC_FILES})
+ADD_DEFINITIONS(-D__MODELS_STANDALONE__)
+ADD_DEPENDENCIES(libraryTest models)
+TARGET_LINK_LIBRARIES(libraryTest models)
Index: sansmodels/MANIFEST.IN
===================================================================
--- sansmodels/MANIFEST.IN	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
+++ sansmodels/MANIFEST.IN	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
@@ -0,0 +1,10 @@
+
+graft src/sans/models/libigor
+graft src/sans/models/c_smearer
+graft src/sans/models/c_models
+graft src/sans/models/c_extensions
+recursive-include sans *.h
+recursive-include sans *.hh
+include README.txt
+include license.txt
+include release_notes.txt
Index: sansmodels/generate_cmake.py
===================================================================
--- sansmodels/generate_cmake.py	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
+++ sansmodels/generate_cmake.py	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
@@ -0,0 +1,69 @@
+"""
+    Script to generate a CMakeLists.txt file for cmake
+    
+    python generate_cmake.py
+    cd [your build location not in the source tree]
+    cmake [path to directory containing CMakeLists.txt]
+    make
+    
+    That will produce a library libModels.a
+"""
+import os
+f = open("CMakeLists.txt", "w")
+
+cmakelist = """# CMakeLists for SANS models
+cmake_minimum_required (VERSION 2.6)
+project (SansModels)
+
+# Version number
+set (SansModels_VERSION_MAJOR 1)
+set (SansModels_VERSION_MAJOR 0)
+
+set (SRC_FILES
+"""
+
+source_dirs = ["src/c_models",
+               "src/libigor"]
+excluded_src = ["c_models.cpp",
+                "disperser.c",
+                "winFuncs.c"]
+
+for src_dir in source_dirs:
+    for item in os.listdir(src_dir):
+        if item in excluded_src:
+            continue
+        ext = os.path.splitext(item)[1]
+        if ext in [".c",".cpp"]:
+            cmakelist += "    %s\n" % os.path.join(src_dir, item)
+
+cmakelist += "    )\n\n"    
+
+cmakelist += "set ( INC_FILES\n"    
+
+include_dirs = ["src/c_models",
+                "include",
+                "src/libigor"]
+
+for inc_dir in include_dirs:
+    for item in os.listdir(inc_dir):
+        ext = os.path.splitext(item)[1]
+        if ext in [".h",".hh"]:
+            cmakelist += "    %s\n" % os.path.join(inc_dir, item)
+    
+cmakelist += """
+)
+    
+include_directories (src/libigor include src/c_models)
+
+# Add the target for this directory
+add_library ( models ${SRC_FILES} ${INC_FILES})
+add_executable( libraryTest test/library_test.cpp  ${INC_FILES})
+ADD_DEFINITIONS(-D__MODELS_STANDALONE__)
+ADD_DEPENDENCIES(libraryTest models)
+TARGET_LINK_LIBRARIES(libraryTest models)
+"""
+
+f.write(cmakelist)
+f.close()
+
+    
Index: sansmodels/license.txt
===================================================================
--- sansmodels/license.txt	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
+++ sansmodels/license.txt	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
@@ -0,0 +1,16 @@
+This software was developed by the University of Tennessee as part of the
+Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+project funded by the US National Science Foundation. 
+
+If you use this program to do productive scientific research that leads
+to publication, we ask that you acknowledge use of the program by citing
+the following paper in your publication:
+
+P. Butler, M. Doucet, G. Alina, R. Cortes Hernandez, J. Zhou, P. Kienzle,
+Jae Hie Cho, Jessica T. Tumarkin
+"SANS analysis software", to be published.
+
+See the DANSE project web site for license information:
+http://wiki.cacr.caltech.edu/danse/index.php/Main_Page
+
+copyright 2008-2011, University of Tennessee
Index: sansmodels/setup.py
===================================================================
--- sansmodels/setup.py	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
+++ sansmodels/setup.py	(revision 1d80bb23ffe1b8958c43c561f96cf06f15c53f3b)
@@ -0,0 +1,151 @@
+"""
+ Installation script for SANS models
+"""
+
+import sys
+import os
+import platform
+from numpy.distutils.misc_util import get_numpy_include_dirs
+numpy_incl_path = os.path.join(get_numpy_include_dirs()[0], "numpy")
+   
+# Then build and install the modules
+from distutils.core import Extension, setup
+from distutils.command.build_ext import build_ext
+
+# Manage version number ######################################
+sys.path.append(os.path.join("src", "sans"))
+import models
+VERSION = models.__version__
+print "Building models v%s" % VERSION
+##############################################################
+
+# Options to enable OpenMP
+copt =  {'msvc': ['/openmp'],
+         'mingw32' : ['-fopenmp'],
+         'unix' : ['-fopenmp']}
+lopt =  {'msvc': ['/MANIFEST'],
+         'mingw32' : ['-fopenmp'],
+         'unix' : ['-lgomp']}
+
+# Options for non-openmp builds. MSVC always needs MANIFEST
+if sys.argv[-1] == "-nomp":
+    copt = {}
+    lopt = {'msvc': ['/MANIFEST']}
+
+class build_ext_subclass( build_ext ):
+    def build_extensions(self):
+        # Get 64-bitness
+        if sys.version_info >= (2, 6):
+            is_64bits = sys.maxsize > 2**32
+        else:
+            # 'sys.maxsize' and 64bit: Not supported for python2.5
+            is_64bits = False
+        c = self.compiler.compiler_type
+        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits))
+        
+        if not (sys.platform=='darwin' and not is_64bits):
+            if copt.has_key(c):
+               for e in self.extensions:
+                   e.extra_compile_args = copt[ c ]
+            if lopt.has_key(c):
+                for e in self.extensions:
+                    e.extra_link_args = lopt[ c ]
+                    
+        build_ext.build_extensions(self)
+
+# Build the module name
+includedir  = "include"
+igordir = os.path.join("src", "libigor")
+c_model_dir = os.path.join("src", "c_models")
+smear_dir  = os.path.join("src", "c_smearer")
+wrapper_dir  = os.path.join("src", "python_wrapper", "generated")
+if not os.path.isdir(wrapper_dir):
+    os.makedirs(wrapper_dir)
+
+sys.path.append(os.path.join("src", "python_wrapper"))
+from wrapping import generate_wrappers
+generate_wrappers(header_dir=includedir, 
+                  output_dir=os.path.join("src", "sans", "models"), 
+                  c_wrapper_dir=wrapper_dir)
+
+IGNORED_FILES = [".svn"]
+if not os.name=='nt':
+    IGNORED_FILES.extend(["gamma_win.c","winFuncs.c"])
+
+EXTENSIONS = [".c", ".cpp"]
+
+def append_file(file_list, dir_path):
+    """
+    Add sources file to sources
+    """
+    for f in os.listdir(dir_path):
+        if os.path.isfile(os.path.join(dir_path, f)):
+            _, ext = os.path.splitext(f)
+            if ext.lower() in EXTENSIONS and f not in IGNORED_FILES:
+                file_list.append(os.path.join(dir_path, f)) 
+        elif os.path.isdir(os.path.join(dir_path, f)) and \
+                not f.startswith("."):
+            sub_dir = os.path.join(dir_path, f)
+            for new_f in os.listdir(sub_dir):
+                if os.path.isfile(os.path.join(sub_dir, new_f)):
+                    _, ext = os.path.splitext(new_f)
+                    if ext.lower() in EXTENSIONS and\
+                         new_f not in IGNORED_FILES:
+                        file_list.append(os.path.join(sub_dir, new_f)) 
+        
+model_sources = []
+append_file(file_list=model_sources, dir_path=igordir)
+append_file(file_list=model_sources, dir_path=c_model_dir)
+append_file(file_list=model_sources, dir_path=wrapper_dir)
+smear_sources = []
+append_file(file_list=smear_sources, dir_path=smear_dir)
+
+
+smearer_sources = [os.path.join(smear_dir, "smearer.cpp"),
+                  os.path.join(smear_dir, "smearer_module.cpp")]
+if os.name=='nt':
+    smearer_sources.append(os.path.join(igordir, "winFuncs.c"))
+
+dist = setup(
+    name="sansmodels",
+    version = VERSION,
+    description = "Python module for SANS scattering models",
+    author = "SANS/DANSE",
+    author_email = "sansdanse@gmail.gov",
+    url = "http://sansviewproject.svn.sourceforge.net",
+    
+    # Place this module under the sans package
+    #ext_package = "sans",
+    
+    # Use the pure python modules
+    package_dir = {"sans":os.path.join("src", "sans"),
+                   "sans.models":os.path.join("src", "sans", "models"),
+                   "sans.models.sans_extension":os.path.join("src", "sans", "models", "sans_extension"),
+                  },
+    package_data={'sans.models': [os.path.join('media', "*")]},
+    packages = ["sans","sans.models",
+                "sans.models.sans_extension",],
+    
+    ext_modules = [ 
+                   
+        Extension("sans.models.sans_extension.c_models",
+                    sources=model_sources,                 
+                    include_dirs=[igordir, includedir, c_model_dir, numpy_incl_path],   
+                    ),
+
+        # Smearer extension
+        Extension("sans.models.sans_extension.smearer",
+                   sources = smearer_sources,
+                   include_dirs=[igordir, smear_dir, numpy_incl_path],
+                   ),
+                   
+        Extension("sans.models.sans_extension.smearer2d_helper",
+                  sources = [os.path.join(smear_dir, 
+                                          "smearer2d_helper_module.cpp"),
+                             os.path.join(smear_dir, "smearer2d_helper.cpp"),],
+                  include_dirs=[smear_dir,numpy_incl_path],
+                  )
+        ],
+    cmdclass = {'build_ext': build_ext_subclass }
+    )
+        
Index: c/sansmodels/CMakeLists.txt
===================================================================
--- src/sansmodels/CMakeLists.txt	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ 	(revision )
@@ -1,141 +1,0 @@
-# CMakeLists for SANS models
-cmake_minimum_required (VERSION 2.6)
-project (SansModels)
-
-# Version number
-set (SansModels_VERSION_MAJOR 1)
-set (SansModels_VERSION_MAJOR 0)
-
-set (SRC_FILES
-    src/c_models/barbell.cpp
-    src/c_models/bcc.cpp
-    src/c_models/binaryHS.cpp
-    src/c_models/binaryHS_PSF11.cpp
-    src/c_models/capcyl.cpp
-    src/c_models/corefourshell.cpp
-    src/c_models/coreshellcylinder.cpp
-    src/c_models/coreshellsphere.cpp
-    src/c_models/csparallelepiped.cpp
-    src/c_models/cylinder.cpp
-    src/c_models/DiamCyl.cpp
-    src/c_models/DiamEllip.cpp
-    src/c_models/dispersion_visitor.cpp
-    src/c_models/ellipsoid.cpp
-    src/c_models/ellipticalcylinder.cpp
-    src/c_models/fcc.cpp
-    src/c_models/flexcyl_ellipX.cpp
-    src/c_models/flexiblecylinder.cpp
-    src/c_models/fractal.cpp
-    src/c_models/fuzzysphere.cpp
-    src/c_models/gamma_win.c
-    src/c_models/gaussian.cpp
-    src/c_models/Hardsphere.cpp
-    src/c_models/HayterMSA.cpp
-    src/c_models/hollowcylinder.cpp
-    src/c_models/lamellar.cpp
-    src/c_models/lamellarFF_HG.cpp
-    src/c_models/lamellarPC.cpp
-    src/c_models/lamellarPS.cpp
-    src/c_models/lamellarPS_HG.cpp
-    src/c_models/libfunc.c
-    src/c_models/librefl.c
-    src/c_models/logNormal.cpp
-    src/c_models/lorentzian.cpp
-    src/c_models/multishell.cpp
-    src/c_models/onion.cpp
-    src/c_models/parallelepiped.cpp
-    src/c_models/parameters.cpp
-    src/c_models/pearlnecklace.cpp
-    src/c_models/polygausscoil.cpp
-    src/c_models/refl.cpp
-    src/c_models/refl_adv.cpp
-    src/c_models/rpa.cpp
-    src/c_models/sc.cpp
-    src/c_models/schulz.cpp
-    src/c_models/sld_cal.cpp
-    src/c_models/sphere.cpp
-    src/c_models/spheresld.cpp
-    src/c_models/spheroid.cpp
-    src/c_models/SquareWell.cpp
-    src/c_models/stackeddisks.cpp
-    src/c_models/StickyHS.cpp
-    src/c_models/triaxialellipsoid.cpp
-    src/c_models/vesicle.cpp
-    src/libigor/GaussWeights.c
-    src/libigor/libCylinder.c
-    src/libigor/libSphere.c
-    src/libigor/libStructureFactor.c
-    src/libigor/libTwoPhase.c
-    )
-
-set ( INC_FILES
-    src/c_models/dispersion_visitor.hh
-    src/c_models/gamma_win.h
-    src/c_models/parameters.hh
-    include/barbell.h
-    include/bcc.h
-    include/binaryHS.h
-    include/capcyl.h
-    include/core_shell.h
-    include/core_shell_cylinder.h
-    include/corefourshell.h
-    include/csparallelepiped.h
-    include/cylinder.h
-    include/DiamCyl.h
-    include/DiamEllip.h
-    include/ellipsoid.h
-    include/elliptical_cylinder.h
-    include/fcc.h
-    include/flexcyl_ellipX.h
-    include/flexible_cylinder.h
-    include/fractal.h
-    include/fuzzysphere.h
-    include/gaussian.h
-    include/Hardsphere.h
-    include/HayterMSA.h
-    include/hollow_cylinder.h
-    include/lamellar.h
-    include/lamellarFF_HG.h
-    include/lamellarPC.h
-    include/lamellarPS.h
-    include/lamellarPS_HG.h
-    include/logNormal.h
-    include/lorentzian.h
-    include/multishell.h
-    include/onion.h
-    include/parallelepiped.h
-    include/pearlnecklace.h
-    include/polygausscoil.h
-    include/refl.h
-    include/refl_adv.h
-    include/rpa.h
-    include/sc.h
-    include/schulz.h
-    include/sld_cal.h
-    include/sphere.h
-    include/spheresld.h
-    include/spheroid.h
-    include/SquareWell.h
-    include/stacked_disks.h
-    include/StickyHS.h
-    include/triaxial_ellipsoid.h
-    include/vesicle.h
-    src/libigor/GaussWeights.h
-    src/libigor/libCylinder.h
-    src/libigor/libSANSAnalysis.h
-    src/libigor/libSphere.h
-    src/libigor/libStructureFactor.h
-    src/libigor/libTwoPhase.h
-    src/libigor/StandardHeaders.h
-    src/libigor/winFuncs.h
-
-)
-    
-include_directories (src/libigor include src/c_models)
-
-# Add the target for this directory
-add_library ( models ${SRC_FILES} ${INC_FILES})
-add_executable( libraryTest test/library_test.cpp  ${INC_FILES})
-ADD_DEFINITIONS(-D__MODELS_STANDALONE__)
-ADD_DEPENDENCIES(libraryTest models)
-TARGET_LINK_LIBRARIES(libraryTest models)
Index: c/sansmodels/MANIFEST.IN
===================================================================
--- src/sansmodels/MANIFEST.IN	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ 	(revision )
@@ -1,10 +1,0 @@
-
-graft src/sans/models/libigor
-graft src/sans/models/c_smearer
-graft src/sans/models/c_models
-graft src/sans/models/c_extensions
-recursive-include sans *.h
-recursive-include sans *.hh
-include README.txt
-include license.txt
-include release_notes.txt
Index: c/sansmodels/generate_cmake.py
===================================================================
--- src/sansmodels/generate_cmake.py	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ 	(revision )
@@ -1,69 +1,0 @@
-"""
-    Script to generate a CMakeLists.txt file for cmake
-    
-    python generate_cmake.py
-    cd [your build location not in the source tree]
-    cmake [path to directory containing CMakeLists.txt]
-    make
-    
-    That will produce a library libModels.a
-"""
-import os
-f = open("CMakeLists.txt", "w")
-
-cmakelist = """# CMakeLists for SANS models
-cmake_minimum_required (VERSION 2.6)
-project (SansModels)
-
-# Version number
-set (SansModels_VERSION_MAJOR 1)
-set (SansModels_VERSION_MAJOR 0)
-
-set (SRC_FILES
-"""
-
-source_dirs = ["src/c_models",
-               "src/libigor"]
-excluded_src = ["c_models.cpp",
-                "disperser.c",
-                "winFuncs.c"]
-
-for src_dir in source_dirs:
-    for item in os.listdir(src_dir):
-        if item in excluded_src:
-            continue
-        ext = os.path.splitext(item)[1]
-        if ext in [".c",".cpp"]:
-            cmakelist += "    %s\n" % os.path.join(src_dir, item)
-
-cmakelist += "    )\n\n"    
-
-cmakelist += "set ( INC_FILES\n"    
-
-include_dirs = ["src/c_models",
-                "include",
-                "src/libigor"]
-
-for inc_dir in include_dirs:
-    for item in os.listdir(inc_dir):
-        ext = os.path.splitext(item)[1]
-        if ext in [".h",".hh"]:
-            cmakelist += "    %s\n" % os.path.join(inc_dir, item)
-    
-cmakelist += """
-)
-    
-include_directories (src/libigor include src/c_models)
-
-# Add the target for this directory
-add_library ( models ${SRC_FILES} ${INC_FILES})
-add_executable( libraryTest test/library_test.cpp  ${INC_FILES})
-ADD_DEFINITIONS(-D__MODELS_STANDALONE__)
-ADD_DEPENDENCIES(libraryTest models)
-TARGET_LINK_LIBRARIES(libraryTest models)
-"""
-
-f.write(cmakelist)
-f.close()
-
-    
Index: c/sansmodels/license.txt
===================================================================
--- src/sansmodels/license.txt	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ 	(revision )
@@ -1,16 +1,0 @@
-This software was developed by the University of Tennessee as part of the
-Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
-project funded by the US National Science Foundation. 
-
-If you use this program to do productive scientific research that leads
-to publication, we ask that you acknowledge use of the program by citing
-the following paper in your publication:
-
-P. Butler, M. Doucet, G. Alina, R. Cortes Hernandez, J. Zhou, P. Kienzle,
-Jae Hie Cho, Jessica T. Tumarkin
-"SANS analysis software", to be published.
-
-See the DANSE project web site for license information:
-http://wiki.cacr.caltech.edu/danse/index.php/Main_Page
-
-copyright 2008-2011, University of Tennessee
Index: c/sansmodels/setup.py
===================================================================
--- src/sansmodels/setup.py	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ 	(revision )
@@ -1,151 +1,0 @@
-"""
- Installation script for SANS models
-"""
-
-import sys
-import os
-import platform
-from numpy.distutils.misc_util import get_numpy_include_dirs
-numpy_incl_path = os.path.join(get_numpy_include_dirs()[0], "numpy")
-   
-# Then build and install the modules
-from distutils.core import Extension, setup
-from distutils.command.build_ext import build_ext
-
-# Manage version number ######################################
-sys.path.append(os.path.join("src", "sans"))
-import models
-VERSION = models.__version__
-print "Building models v%s" % VERSION
-##############################################################
-
-# Options to enable OpenMP
-copt =  {'msvc': ['/openmp'],
-         'mingw32' : ['-fopenmp'],
-         'unix' : ['-fopenmp']}
-lopt =  {'msvc': ['/MANIFEST'],
-         'mingw32' : ['-fopenmp'],
-         'unix' : ['-lgomp']}
-
-# Options for non-openmp builds. MSVC always needs MANIFEST
-if sys.argv[-1] == "-nomp":
-    copt = {}
-    lopt = {'msvc': ['/MANIFEST']}
-
-class build_ext_subclass( build_ext ):
-    def build_extensions(self):
-        # Get 64-bitness
-        if sys.version_info >= (2, 6):
-            is_64bits = sys.maxsize > 2**32
-        else:
-            # 'sys.maxsize' and 64bit: Not supported for python2.5
-            is_64bits = False
-        c = self.compiler.compiler_type
-        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits))
-        
-        if not (sys.platform=='darwin' and not is_64bits):
-            if copt.has_key(c):
-               for e in self.extensions:
-                   e.extra_compile_args = copt[ c ]
-            if lopt.has_key(c):
-                for e in self.extensions:
-                    e.extra_link_args = lopt[ c ]
-                    
-        build_ext.build_extensions(self)
-
-# Build the module name
-includedir  = "include"
-igordir = os.path.join("src", "libigor")
-c_model_dir = os.path.join("src", "c_models")
-smear_dir  = os.path.join("src", "c_smearer")
-wrapper_dir  = os.path.join("src", "python_wrapper", "generated")
-if not os.path.isdir(wrapper_dir):
-    os.makedirs(wrapper_dir)
-
-sys.path.append(os.path.join("src", "python_wrapper"))
-from wrapping import generate_wrappers
-generate_wrappers(header_dir=includedir, 
-                  output_dir=os.path.join("src", "sans", "models"), 
-                  c_wrapper_dir=wrapper_dir)
-
-IGNORED_FILES = [".svn"]
-if not os.name=='nt':
-    IGNORED_FILES.extend(["gamma_win.c","winFuncs.c"])
-
-EXTENSIONS = [".c", ".cpp"]
-
-def append_file(file_list, dir_path):
-    """
-    Add sources file to sources
-    """
-    for f in os.listdir(dir_path):
-        if os.path.isfile(os.path.join(dir_path, f)):
-            _, ext = os.path.splitext(f)
-            if ext.lower() in EXTENSIONS and f not in IGNORED_FILES:
-                file_list.append(os.path.join(dir_path, f)) 
-        elif os.path.isdir(os.path.join(dir_path, f)) and \
-                not f.startswith("."):
-            sub_dir = os.path.join(dir_path, f)
-            for new_f in os.listdir(sub_dir):
-                if os.path.isfile(os.path.join(sub_dir, new_f)):
-                    _, ext = os.path.splitext(new_f)
-                    if ext.lower() in EXTENSIONS and\
-                         new_f not in IGNORED_FILES:
-                        file_list.append(os.path.join(sub_dir, new_f)) 
-        
-model_sources = []
-append_file(file_list=model_sources, dir_path=igordir)
-append_file(file_list=model_sources, dir_path=c_model_dir)
-append_file(file_list=model_sources, dir_path=wrapper_dir)
-smear_sources = []
-append_file(file_list=smear_sources, dir_path=smear_dir)
-
-
-smearer_sources = [os.path.join(smear_dir, "smearer.cpp"),
-                  os.path.join(smear_dir, "smearer_module.cpp")]
-if os.name=='nt':
-    smearer_sources.append(os.path.join(igordir, "winFuncs.c"))
-
-dist = setup(
-    name="sansmodels",
-    version = VERSION,
-    description = "Python module for SANS scattering models",
-    author = "SANS/DANSE",
-    author_email = "sansdanse@gmail.gov",
-    url = "http://sansviewproject.svn.sourceforge.net",
-    
-    # Place this module under the sans package
-    #ext_package = "sans",
-    
-    # Use the pure python modules
-    package_dir = {"sans":os.path.join("src", "sans"),
-                   "sans.models":os.path.join("src", "sans", "models"),
-                   "sans.models.sans_extension":os.path.join("src", "sans", "models", "sans_extension"),
-                  },
-    package_data={'sans.models': [os.path.join('media', "*")]},
-    packages = ["sans","sans.models",
-                "sans.models.sans_extension",],
-    
-    ext_modules = [ 
-                   
-        Extension("sans.models.sans_extension.c_models",
-                    sources=model_sources,                 
-                    include_dirs=[igordir, includedir, c_model_dir, numpy_incl_path],   
-                    ),
-
-        # Smearer extension
-        Extension("sans.models.sans_extension.smearer",
-                   sources = smearer_sources,
-                   include_dirs=[igordir, smear_dir, numpy_incl_path],
-                   ),
-                   
-        Extension("sans.models.sans_extension.smearer2d_helper",
-                  sources = [os.path.join(smear_dir, 
-                                          "smearer2d_helper_module.cpp"),
-                             os.path.join(smear_dir, "smearer2d_helper.cpp"),],
-                  include_dirs=[smear_dir,numpy_incl_path],
-                  )
-        ],
-    cmdclass = {'build_ext': build_ext_subclass }
-    )
-        
