[Scipy-svn] r2328 - trunk/Lib/sandbox/montecarlo

scipy-svn at scipy.org scipy-svn at scipy.org
Wed Nov 22 12:31:08 CST 2006


Author: edschofield
Date: 2006-11-22 12:31:04 -0600 (Wed, 22 Nov 2006)
New Revision: 2328

Modified:
   trunk/Lib/sandbox/montecarlo/setup.py
Log:
Added test for existence of randomkit.{ch} in montecarlo/setup.py. Fixes bug #293.


Modified: trunk/Lib/sandbox/montecarlo/setup.py
===================================================================
--- trunk/Lib/sandbox/montecarlo/setup.py	2006-11-21 22:08:13 UTC (rev 2327)
+++ trunk/Lib/sandbox/montecarlo/setup.py	2006-11-22 18:31:04 UTC (rev 2328)
@@ -1,15 +1,15 @@
 import numpy
 from numpy.distutils.core import setup
 from numpy.distutils.misc_util import Configuration
-from os.path import join, dirname
+from os.path import join, dirname, exists
 
 def configuration(parent_package='', top_path=None):
 
     config = Configuration('montecarlo', parent_package, top_path)
-
-    # This code requires 'randomkit.c' and 'randomkit.h' to have been copied
-    # to (or symlinked to) montecarlo/src/.
-
+    
+    if not (exists('src/randomkit.c') and exists('src/randomkit.h')):
+        raise OSError, "Please copy or symlink randomkit.c and randomkit.h to montecarlo/src/ from numpy/random/mtrand/ in the NumPy source tree!"
+    
     config.add_extension('_intsampler',
               sources = [join('src', f) for f in
                         ['_intsamplermodule.c', 'compact5table.c', 'randomkit.c']])



More information about the Scipy-svn mailing list