[SciPy-user] Problems building SciPy-0.3 on OS X

Tom Loredo loredo at astro.cornell.edu
Tue Aug 10 14:11:08 CDT 2004


Hi Pearu-

Thanks for the help.

> Hmm, the segfault appears while executing pure Python code. 

Yes.  By the admittedly crude approach of inserting lots of print
statements, I've determined that it happens in "all_subroutines" in
Lib/linalg/interface_gen.py:

	def all_subroutines(interface_in):
		# remove comments
		comment_block_exp = re.compile(r'/\*(?:\s|.)*?\*/')
		subroutine_exp = re.compile(r'subroutine (?:\s|.)*?end subroutine.*')
		function_exp = re.compile(r'function (?:\s|.)*?end function.*')
		print '***** Compiled regexps...'
		
		print '***** stripping comments...'
		interface = comment_block_exp.sub('',interface_in)
		print '***** finding subrs...'
		print interface
		subroutine_list = subroutine_exp.findall(interface)
		print '***** finding functions...'
		function_list = function_exp.findall(interface)
		print '***** concatenating...'
		subroutine_list = subroutine_list + function_list 
		print '***** stripping...'
		subroutine_list = map(lambda x: string.strip(x),subroutine_list)
		return subroutine_list

The fault occurs while finding the subroutines via "subroutine_exp.findall(interface)".
I've printed out "interface" (too long to post here) and there is nothing obvious
wrong with it, but I don't really know what to expect.  In years of using Python,
this is the first segfault I've seen running a builtin or library module!

> Also, I'd suggest using CVS version of scipy 

Yes, I was afraid you'd suggest this.  I'm developing a public package, and
a frequent comment from potential users is that they don't want to have to
deal with CVS---they would ideally just want an RPM, though I think they'll
live with a setup.py.  The CVS barrier is admittedly small in scipy's case,
but every barrier cuts off another layer of possible users.  The latest
"official" build really should build on all the major platforms.

My own obstacle is that at work I'm on a linux machine; the Mac is at home
on a dialup connection.  So CVS stuff is slow.  But in this case I copied
the linux machine's scipy directory via a flash drive to the Mac, and then
did a CVS to update it (thus avoiding checking out the whole thing via
my modem).  The exact same errors happen using today's version on CVS.

> I would disable building xplt for now. To do that, add 'xplt' to the
> ignore_packages list at the end of setup.py file. And then try 'python 
> setup.py build' again. 

I tried that with the CVS version.  No go, same problem:

	building extension "scipy.linalg.cblas" sources
	  adding 'build/src/scipy/linalg/cblas.pyf' to sources.
	  adding 'build/src/fortranobject.c' to sources.
	  adding 'build/src' to include_dirs.
	building extension "scipy.linalg.flapack" sources
	generating flapack interface
	Segmentation fault

I've again inserted print statements and verified that the segfault is
happening in the same place (using the subroutine_exp regexp).  This
regexp works fine on earlier modules.

Is the earlier error (AttributeError: 'NoneType' object has no attribute 'rfind')
perhaps a clue I'm overlooking (i.e., something is not getting set up on that
first build attempt, and is getting overlooked on the 2nd attempt)?

Help!

-Tom



More information about the SciPy-user mailing list