Sage crashed following an attempt to compile a cython module, a compilation
that produced many error messages.
I had previously compiled and run the module with profiling enabled; the crash
occurred on a following compilation.
I'm attaching the crash report, per instructions that were printed in the
Terminal window.
Sage 5.0, Mac OS X 10.6.8
***************************************************************************
IPython post-mortem report
IPython version: 0.10.2
Platform info : os.name -> posix, sys.platform -> darwin
***************************************************************************
Current user configuration structure:
{'Version': 0,
'__allownew': True,
'alias': [],
'args': [],
'autocall': 0,
'autoedit_syntax': 0,
'autoexec': ['load /Users/jim/.sage//init.sage'],
'autoindent': 1,
'automagic': 1,
'banner': 0,
'c': '',
'cache_size': 1000,
'classic': 0,
'color_info': 1,
'colors': 'NoColor',
'confirm_exit': 0,
'debug': 0,
'deep_reload': 0,
'editor': 'vi',
'embedded': False,
'execfile': [],
'execute': ['',
"def view_all(): view([(i, globals()[i]) for i in variables()],
title='All SAGE Variables')",
"def variables(): return [k for k in globals() if not k in iglob
and len(k) > 0 and k[0] != '_']",
'import sage.misc.preparser_ipython;
sage.misc.preparser_ipython.magma_colon_equals=True'],
'gthread': 0,
'help': 0,
'import_all': [],
'import_mod': [],
'import_some': [[]],
'include': [],
'interact': 1,
'ipythondir': u'/Users/jim/.sage/ipython',
'log': 0,
'logfile': '',
'logplay': '',
'magic_docstrings': 0,
'messages': 1,
'multi_line_specials': 1,
'nosep': 0,
'object_info_string_level': 0,
'opts': Struct({'__allownew': True, 'interact': 1, 'profile': 'sage'}),
'pdb': 0,
'pprint': 1,
'profile': 'sage',
'prompt_in1': '${sage_prompt()}: ',
'prompt_in2': "${'.'*len(sage_prompt())}: ",
'prompt_out': '',
'prompts_pad_left': 0,
'pydb': 0,
'pylab': 0,
'pylab_import_all': 1,
'q4thread': 0,
'qthread': 0,
'quick': 0,
'quiet': 0,
'rcfile': 'ipythonrc',
'readline': 1,
'readline_merge_completions': 1,
'readline_omit__names': 2,
'readline_parse_and_bind': ['tab: complete',
'"\\C-l": possible-completions',
'set show-all-if-ambiguous on',
'"\\C-o": tab-insert',
'"\\M-i": " "',
'"\\M-o": "\\d\\d\\d\\d"',
'"\\M-I": "\\d\\d\\d\\d"',
'"\\C-r": reverse-search-history',
'"\\C-s": forward-search-history',
'"\\C-p": history-search-backward',
'"\\C-n": history-search-forward',
'"\\e[A": history-search-backward',
'"\\e[B": history-search-forward',
'"\\C-k": kill-line',
'"\\C-u": unix-line-discard'],
'readline_remove_delims': '-/~',
'screen_length': -1,
'separate_in': '',
'separate_out': '',
'separate_out2': '',
'system_header': 'IPython system call: ',
'system_verbose': 0,
'term_title': 1,
'tk': 0,
'upgrade': 0,
'wildcards_case_sensitive': 1,
'wthread': 0,
'wxversion': '0',
'xmode': 'Context'}
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
ImportError Python 2.7.2: /Applications/sage/local/bin/python
Tue May 22 09:01:53 2012
A problem occured executing Python code. Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/Applications/sage/local/bin/sage-ipython in <module>()
37
38 sage_commands = os.listdir(os.environ['SAGE_ROOT']+"/local/bin/")
39 DARWIN_SYSTEM = os.uname()[0]=='Darwin'
40
41 def sage_system(self, cmd):
42 if cmd in sage_commands:
43 old_system(cmd)
44 else:
45 libraries = 'LD_LIBRARY_PATH=$$SAGE_ORIG_LD_LIBRARY_PATH;'
46 if DARWIN_SYSTEM:
47 libraries +=
'DYLD_LIBRARY_PATH=$$SAGE_ORIG_DYLD_LIBRARY_PATH;'
48 old_system(libraries+cmd)
49
50 ipy_sage.IP.system = new.instancemethod(sage_system, ipy_sage.IP,
IPython.iplib.InteractiveShell)
51
---> 52 ipy_sage.mainloop(sys_exit=1, banner='')
global ipy_sage.mainloop = <bound method IPShell.mainloop of
<IPython.Shell.IPShell instance at 0x1011c47a0>>
global sys_exit = undefined
global banner = undefined
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/Applications/sage/local/lib/python2.7/site-packages/IPython/Shell.pyc in
mainloop(self=<IPython.Shell.IPShell instance>, sys_exit=1, banner='')
61
#-----------------------------------------------------------------------------
62 # This class is trivial now, but I want to have it in to publish a clean
63 # interface. Later when the internals are reorganized, code that uses
this
64 # shouldn't have to change.
65
66 class IPShell:
67 """Create an IPython instance."""
68
69 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
70 debug=1,shell_class=InteractiveShell):
71 self.IP = make_IPython(argv,user_ns=user_ns,
72 user_global_ns=user_global_ns,
73 debug=debug,shell_class=shell_class)
74
75 def mainloop(self,sys_exit=0,banner=None):
---> 76 self.IP.mainloop(banner)
global When = undefined
global the = undefined
global IPython = <module 'IPython' from
'/Applications/sage/local/lib/python2.7/site-packages/IPython/__init__.pyc'>
global shell = undefined
global exited = undefined
global Ctrl = undefined
global D = undefined
global normal = undefined
global program = undefined
global execution = undefined
77 if sys_exit:
78 sys.exit()
79
80
#-----------------------------------------------------------------------------
81 def kill_embedded(self,parameter_s=''):
82 """%kill_embedded : deactivate for good the current embedded
IPython.
83
84 This function (after asking for confirmation) sets an internal flag
so that
85 an embedded IPython will never activate again. This is useful to
86 permanently disable a shell that is being called inside a loop:
once you've
87 figured out what you needed from it, you may then kill it and the
program
88 will then continue to run without the interactive shell interfering
again.
89 """
90
91 kill = ask_yes_no("Are you sure you want to kill this embedded
instance "
/Applications/sage/local/lib/python2.7/site-packages/IPython/iplib.pyc in
mainloop(self=<IPython.iplib.InteractiveShell object>, banner='')
1747 if not self.rc.banner:
1748 banner = ''
1749 # banner is string? Use it directly!
1750 elif isinstance(self.rc.banner,basestring):
1751 banner = self.rc.banner
1752 else:
1753 banner = self.BANNER+self.banner2
1754
1755 # if you run stuff with -c <cmd>, raw hist is not updated
1756 # ensure that it's in sync
1757 if len(self.input_hist) != len (self.input_hist_raw):
1758 self.input_hist_raw = InputList(self.input_hist)
1759
1760 while 1:
1761 try:
-> 1762 self.interact(banner)
1763 #self.interact_with_readline()
1764
1765 # XXX for testing of a readline-decoupled repl loop,
call
1766 # interact_with_readline above
1767
1768 break
1769 except KeyboardInterrupt:
1770 # this should not be necessary, but KeyboardInterrupt
1771 # handling seems rather unpredictable...
1772 self.write("\nKeyboardInterrupt in interact()\n")
1773
1774 def exec_init_cmd(self):
1775 """Execute a command given at the command line.
1776
1777 This emulates Python's -c option."""
/Applications/sage/local/lib/python2.7/site-packages/IPython/iplib.pyc in
interact(self=<IPython.iplib.InteractiveShell object>, banner='')
1975 self.resetbuffer()
1976 # keep cache in sync with the prompt counter:
1977 self.outputcache.prompt_count -= 1
1978
1979 if self.autoindent:
1980 self.indent_current_nsp = 0
1981 more = 0
1982 except KeyboardInterrupt:
1983 pass
1984 except EOFError:
1985 if self.autoindent:
1986 self.rl_do_indent = False
1987 if self.has_readline:
1988 self.readline_startup_hook(None)
1989 self.write('\n')
-> 1990 self.exit()
1991 except bdb.BdbQuit:
1992 warn('The Python debugger has exited with a BdbQuit
exception.\n'
1993 'Because of how pdb handles the stack, it is
impossible\n'
1994 'for IPython to properly format this particular
exception.\n'
1995 'IPython will resume normal operation.')
1996 except:
1997 # exceptions here are VERY RARE, but they can be
triggered
1998 # asynchronously by signal handlers, for example.
1999 self.showtraceback()
2000 else:
2001 more = self.push(line)
2002 if (self.SyntaxTB.last_syntax_error and
2003 self.rc.autoedit_syntax):
2004 self.edit_syntax_error()
2005
/Applications/sage/local/lib/python2.7/site-packages/sage/all.pyc in
_quit_sage_(self=<IPython.iplib.InteractiveShell object>)
276
277 def _quit_sage_(self):
278 import sage.misc.preparser_ipython
279 if sage.misc.preparser_ipython.interface != None:
280 sage.misc.preparser_ipython.switch_interface('sage')
281 self.exit_now = False
282 return
283
284 from IPython.genutils import ask_yes_no
285 if self.rc.confirm_exit:
286 if ask_yes_no('Do you really want to exit ([y]/n)?','y'):
287 self.exit_now = True
288 else:
289 self.exit_now = True
290 if self.exit_now:
--> 291 quit_sage()
292 self.exit_now = True
293
294 return self.exit_now
295
296 from IPython.iplib import InteractiveShell
297 InteractiveShell.exit = _quit_sage_
298
299 import sage.misc.displayhook
300 sage.misc.displayhook.install()
301
302 from sage.ext.interactive_constructors_c import inject_on, inject_off
303
304
sage.structure.sage_object.register_unpickle_override('sage.categories.category',
'Sets', Sets)
305
sage.structure.sage_object.register_unpickle_override('sage.categories.category_types',
'HeckeModules', HeckeModules)
306
sage.structure.sage_object.register_unpickle_override('sage.categories.category_types',
'Objects', Objects)
/Applications/sage/local/lib/python2.7/site-packages/sage/all.pyc in
quit_sage(verbose=True)
219 It makes sure any child processes are also killed, etc.
220 """
221 if verbose:
222 t1 = cputime(_cpu_time_)
223 t1m = int(t1/60); t1s=t1-t1m*60
224 t2 = walltime(_wall_time_)
225 t2m = int(t2/60); t2s=t2-t2m*60
226 print "Exiting Sage (CPU time %sm%.2fs, Wall time %sm%.2fs)."%(
227 t1m,t1s,t2m,t2s)
228 from sage.interfaces.quit import expect_quitall
229 expect_quitall(verbose=verbose)
230
231 import sage.matrix.matrix_mod2_dense
232 sage.matrix.matrix_mod2_dense.free_m4ri()
233
--> 234 import sage.libs.flint.flint
235 sage.libs.flint.flint.free_flint_stack()
236
237 pari._unsafe_deallocate_pari_stack()
238
239 ### The following is removed -- since it would cleanup
240 ### the tmp directory that the sage cleaner depends upon.
241 # The following code close all open file descriptors,
242 # so that on shared file systems the delete_tmpfiles
243 # command below works.
244 # AUTHOR:
245 # * Kate Minola (2007-05-03)
246 #import resource # Resource usage information.
247 #maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
248 #if maxfd != resource.RLIM_INFINITY:
249 # Iterate through and close all file descriptors.
/Applications/sage/local/lib/python2.7/site-packages/pyximport/pyximport.pyc in
load_module(self=<pyximport.pyximport.PyxLoader object>,
fullname='sage.libs.flint.flint')
320 self.pyxbuild_dir = pyxbuild_dir
321
322 def load_module(self, fullname):
323 assert self.fullname == fullname, (
324 "invalid module, expected %s, got %s" % (
325 self.fullname, fullname))
326 if self.init_path:
327 # package
328 #print "PACKAGE", fullname
329 module = load_module(fullname, self.init_path,
330 self.pyxbuild_dir)
331 module.__path__ = [self.path]
332 else:
333 #print "MODULE", fullname
334 module = load_module(fullname, self.path,
--> 335 self.pyxbuild_dir)
336 return module
337
338
339 #install args
340 class PyxArgs(object):
341 build_dir=True
342 build_in_temp=True
343 setup_args={} #None
344
345 ##pyxargs=None
346
347 def install(pyximport=True, pyimport=False, build_dir=None,
build_in_temp=True,
348 setup_args={}, reload_support=False ):
349 """Main entry point. Call this to install the .pyx import hook in
350 your meta-path for a single Python process. If you want it to be
/Applications/sage/local/lib/python2.7/site-packages/pyximport/pyximport.pyc in
load_module(name='sage.libs.flint.flint',
pyxfilename='/Applications/sage/local/lib/python2.7/site-packages/sage/libs/flint/flint.pyx',
pyxbuild_dir='/Users/jim/.pyxbld')
168 assert os.path.exists(so_path), "Cannot find: %s" % so_path
169
170 junkpath = os.path.join(os.path.dirname(so_path), name+"_*") #very
dangerous with --inplace ?
171 junkstuff = glob.glob(junkpath)
172 for path in junkstuff:
173 if path!=so_path:
174 try:
175 os.remove(path)
176 except IOError:
177 print("Couldn't remove ", path)
178
179 return so_path
180
181 def load_module(name, pyxfilename, pyxbuild_dir=None):
182 try:
--> 183 so_path = build_module(name, pyxfilename, pyxbuild_dir)
184 mod = imp.load_dynamic(name, so_path)
185 assert mod.__file__ == so_path, (mod.__file__, so_path)
186 except Exception, e:
187 import traceback
188 raise ImportError("Building module failed: %s" %
189
traceback.format_exception_only(*sys.exc_info()[:2])),None,sys.exc_info()[2]
190 return mod
191
192
193 # import hooks
194
195 class PyxImporter(object):
196 """A meta-path importer for .pyx files.
197 """
198 def __init__(self, extension=PYX_EXT, pyxbuild_dir=None):
/Applications/sage/local/lib/python2.7/site-packages/pyximport/pyximport.pyc in
build_module(name='sage.libs.flint.flint',
pyxfilename='/Applications/sage/local/lib/python2.7/site-packages/sage/libs/flint/flint.pyx',
pyxbuild_dir='/Users/jim/.pyxbld')
152 assert os.path.exists(pyxfilename), (
153 "Path does not exist: %s" % pyxfilename)
154 handle_dependencies(pyxfilename)
155
156 extension_mod,setup_args = get_distutils_extension(name,
pyxfilename)
157 build_in_temp=pyxargs.build_in_temp
158 sargs=pyxargs.setup_args.copy()
159 sargs.update(setup_args)
160 build_in_temp=sargs.pop('build_in_temp',build_in_temp)
161
162 import pyxbuild
163 so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod,
164 build_in_temp=build_in_temp,
165 pyxbuild_dir=pyxbuild_dir,
166 setup_args=sargs,
--> 167 reload_support=pyxargs.reload_support)
global rd = undefined
global q = undefined
global Wt = undefined
global d = undefined
global S = undefined
global Ni = undefined
global Rp = undefined
global t = undefined
global __main__t = undefined
global mod_nameRo = undefined
global dirR = undefined
global setattrt = undefined
global AttributeErrort = undefined
global TypeErrort = undefined
global help = undefined
global R = undefined
global item = undefined
global sK = undefined
global Applications = undefined
global sage = undefined
global local = undefined
global lib = undefined
global python2 = undefined
global site = undefined
global packages = undefined
global pyximport = undefined
global pyximport.pyt = undefined
global show_docs = <function show_docs at 0x10d7cb9b0>
global s = undefined
global Rq = undefined
global RO = undefined
global hexversionR = undefined
global Rr = undefined
global Ry = undefined
global R8 = undefined
global RH = undefined
global RR = undefined
global objectRS = undefined
global Rs = undefined
global Ro = undefined
global module = undefined
global s2 = undefined
168 assert os.path.exists(so_path), "Cannot find: %s" % so_path
169
170 junkpath = os.path.join(os.path.dirname(so_path), name+"_*") #very
dangerous with --inplace ?
171 junkstuff = glob.glob(junkpath)
172 for path in junkstuff:
173 if path!=so_path:
174 try:
175 os.remove(path)
176 except IOError:
177 print("Couldn't remove ", path)
178
179 return so_path
180
181 def load_module(name, pyxfilename, pyxbuild_dir=None):
182 try:
/Applications/sage/local/lib/python2.7/site-packages/pyximport/pyxbuild.pyc in
pyx_to_dll(filename='/Applications/sage/local/lib/python2.7/site-packages/sage/libs/flint/flint.pyx',
ext=<distutils.extension.Extension instance>, force_rebuild=0,
build_in_temp=True, pyxbuild_dir='/Users/jim/.pyxbld', setup_args={},
reload_support=False)
70 try: cfgfiles.remove('setup.cfg')
71 except ValueError: pass
72 dist.parse_config_files(cfgfiles)
73 try:
74 ok = dist.parse_command_line()
75 except DistutilsArgError:
76 raise
77
78 if DEBUG:
79 print("options (after parsing command line):")
80 dist.dump_option_dicts()
81 assert ok
82
83
84 try:
---> 85 dist.run_commands()
86 obj_build_ext = dist.get_command_obj("build_ext")
87 so_path = obj_build_ext.get_outputs()[0]
88 if obj_build_ext.inplace:
89 # Python distutils get_outputs()[ returns a wrong so_path
90 # when --inplace ; see http://bugs.python.org/issue5977
91 # workaround:
92 so_path = os.path.join(os.path.dirname(filename),
93 os.path.basename(so_path))
94 if reload_support:
95 org_path = so_path
96 timestamp = os.path.getmtime(org_path)
97 global _reloads
98 last_timestamp, last_path, count = _reloads.get(org_path,
(None,None,0) )
99 if last_timestamp == timestamp:
100 so_path = last_path
/Applications/sage/local/lib/python/distutils/dist.pyc in
run_commands(self=<distutils.dist.Distribution instance>)
938 self.reinitialize_command(sub, reinit_subcommands)
939
940 return command
941
942 # -- Methods that operate on the Distribution ----------------------
943
944 def announce(self, msg, level=log.INFO):
945 log.log(level, msg)
946
947 def run_commands(self):
948 """Run each command that was seen on the setup script command
line.
949 Uses the list of commands found and cache of command objects
950 created by 'get_command_obj()'.
951 """
952 for cmd in self.commands:
--> 953 self.run_command(cmd)
954
955 # -- Methods that operate on its Commands --------------------------
956
957 def run_command(self, command):
958 """Do whatever it takes to run a command (including nothing at
all,
959 if the command has already been run). Specifically: if we have
960 already created and run the command named by 'command', return
961 silently without doing anything. If the command named by
'command'
962 doesn't even have a command object yet, create one. Then invoke
963 'run()' on that command object (or an existing one).
964 """
965 # Already been here, done that? then return silently.
966 if self.have_run.get(command):
967 return
968
/Applications/sage/local/lib/python/distutils/dist.pyc in
run_command(self=<distutils.dist.Distribution instance>, command='build_ext')
957 def run_command(self, command):
958 """Do whatever it takes to run a command (including nothing at
all,
959 if the command has already been run). Specifically: if we have
960 already created and run the command named by 'command', return
961 silently without doing anything. If the command named by
'command'
962 doesn't even have a command object yet, create one. Then invoke
963 'run()' on that command object (or an existing one).
964 """
965 # Already been here, done that? then return silently.
966 if self.have_run.get(command):
967 return
968
969 log.info("running %s", command)
970 cmd_obj = self.get_command_obj(command)
971 cmd_obj.ensure_finalized()
--> 972 cmd_obj.run()
973 self.have_run[command] = 1
974
975
976 # -- Distribution query methods ------------------------------------
977
978 def has_pure_modules(self):
979 return len(self.packages or self.py_modules or []) > 0
980
981 def has_ext_modules(self):
982 return self.ext_modules and len(self.ext_modules) > 0
983
984 def has_c_libraries(self):
985 return self.libraries and len(self.libraries) > 0
986
987 def has_modules(self):
/Applications/sage/local/lib/python2.7/site-packages/Cython/Distutils/build_ext.pyc
in run(self=<Cython.Distutils.build_ext.build_ext instance>)
120 self.pyrex_include_dirs = \
121 self.pyrex_include_dirs.split(os.pathsep)
122 if self.pyrex_directives is None:
123 self.pyrex_directives = {}
124 # finalize_options ()
125
126 def run(self):
127 # We have one shot at this before build_ext initializes the
compiler.
128 # If --pyrex-gdb is in effect as a command line option or as
option
129 # of any Extension module, disable optimization for the C or C++
130 # compiler.
131 if (self.pyrex_gdb or any([getattr(ext, 'pyrex_gdb', False)
132 for ext in self.extensions])):
133 optimization.disable_optimization()
134
--> 135 _build_ext.build_ext.run(self)
136
137 def build_extensions(self):
138 # First, sanity-check the 'extensions' list
139 self.check_extensions_list(self.extensions)
140
141 for ext in self.extensions:
142 ext.sources = self.cython_sources(ext.sources, ext)
143 self.build_extension(ext)
144
145 def cython_sources(self, sources, extension):
146 """
147 Walk the list of source files in 'sources', looking for Cython
148 source files (.pyx and .py). Run Cython on all that are
149 found, and return a modified 'sources' list with Cython source
150 files replaced by the generated C (or C++) files.
/Applications/sage/local/lib/python/distutils/command/build_ext.pyc in
run(self=<Cython.Distutils.build_ext.build_ext instance>)
325 for (name, value) in self.define:
326 self.compiler.define_macro(name, value)
327 if self.undef is not None:
328 for macro in self.undef:
329 self.compiler.undefine_macro(macro)
330 if self.libraries is not None:
331 self.compiler.set_libraries(self.libraries)
332 if self.library_dirs is not None:
333 self.compiler.set_library_dirs(self.library_dirs)
334 if self.rpath is not None:
335 self.compiler.set_runtime_library_dirs(self.rpath)
336 if self.link_objects is not None:
337 self.compiler.set_link_objects(self.link_objects)
338
339 # Now actually compile and link everything.
--> 340 self.build_extensions()
341
342 def check_extensions_list(self, extensions):
343 """Ensure that the list of extensions (presumably provided as a
344 command option 'extensions') is valid, i.e. it is a list of
345 Extension objects. We also support the old-style list of
2-tuples,
346 where the tuples are (ext_name, build_info), which are
converted to
347 Extension instances here.
348
349 Raise DistutilsSetupError if the structure is invalid anywhere;
350 just returns otherwise.
351 """
352 if not isinstance(extensions, list):
353 raise DistutilsSetupError, \
354 "'ext_modules' option must be a list of Extension
instances"
355
/Applications/sage/local/lib/python2.7/site-packages/Cython/Distutils/build_ext.pyc
in build_extensions(self=<Cython.Distutils.build_ext.build_ext instance>)
128 # If --pyrex-gdb is in effect as a command line option or as
option
129 # of any Extension module, disable optimization for the C or C++
130 # compiler.
131 if (self.pyrex_gdb or any([getattr(ext, 'pyrex_gdb', False)
132 for ext in self.extensions])):
133 optimization.disable_optimization()
134
135 _build_ext.build_ext.run(self)
136
137 def build_extensions(self):
138 # First, sanity-check the 'extensions' list
139 self.check_extensions_list(self.extensions)
140
141 for ext in self.extensions:
142 ext.sources = self.cython_sources(ext.sources, ext)
--> 143 self.build_extension(ext)
144
145 def cython_sources(self, sources, extension):
146 """
147 Walk the list of source files in 'sources', looking for Cython
148 source files (.pyx and .py). Run Cython on all that are
149 found, and return a modified 'sources' list with Cython source
150 files replaced by the generated C (or C++) files.
151 """
152 try:
153 from Cython.Compiler.Main \
154 import CompilationOptions, \
155 default_options as pyrex_default_options, \
156 compile as cython_compile
157 from Cython.Compiler.Errors import PyrexError
158 except ImportError:
/Applications/sage/local/lib/python/distutils/command/build_ext.pyc in
build_extension(self=<Cython.Distutils.build_ext.build_ext instance>,
ext=<distutils.extension.Extension instance>)
484 # The environment variable should take precedence, and
485 # any sensible compiler will give precedence to later
486 # command line args. Hence we combine them in order:
487 extra_args = ext.extra_compile_args or []
488
489 macros = ext.define_macros[:]
490 for undef in ext.undef_macros:
491 macros.append((undef,))
492
493 objects = self.compiler.compile(sources,
494 output_dir=self.build_temp,
495 macros=macros,
496 include_dirs=ext.include_dirs,
497 debug=self.debug,
498 extra_postargs=extra_args,
--> 499 depends=ext.depends)
500
501 # XXX -- this is a Vile HACK!
502 #
503 # The setup.py script for Python on Unix needs to be able to
504 # get this list so it can perform all the clean up needed to
505 # avoid keeping object files around when cleaning out a failed
506 # build of an extension module. Since Distutils does not
507 # track dependencies, we have to get rid of intermediates to
508 # ensure all the intermediates will be properly re-built.
509 #
510 self._built_objects = objects[:]
511
512 # Now link the object files together into a "shared object" --
513 # of course, first we have to figure out all the other things
514 # that go into the mix.
/Applications/sage/local/lib/python/distutils/ccompiler.pyc in
compile(self=<distutils.unixccompiler.UnixCCompiler instance>,
sources=['/Users/jim/.pyxbld/temp.macosx-10.6-x86_64-2.7/pyrex/sage/libs/flint/flint.c'],
output_dir='/Users/jim/.pyxbld/temp.macosx-10.6-x86_64-2.7', macros=[],
include_dirs=[], debug=None, extra_preargs=None, extra_postargs=[], depends=[])
609 Raises CompileError on failure.
610 """
611 # A concrete compiler class can either override this method
612 # entirely or implement _compile().
613
614 macros, objects, extra_postargs, pp_opts, build = \
615 self._setup_compile(output_dir, macros, include_dirs,
sources,
616 depends, extra_postargs)
617 cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
618
619 for obj in objects:
620 try:
621 src, ext = build[obj]
622 except KeyError:
623 continue
--> 624 self._compile(obj, src, ext, cc_args, extra_postargs,
pp_opts)
625
626 # Return *all* object filenames, not just the ones we just
built.
627 return objects
628
629 def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
630 """Compile 'src' to product 'obj'."""
631
632 # A concrete compiler class that does not override compile()
633 # should implement _compile().
634 pass
635
636 def create_static_lib(self, objects, output_libname,
output_dir=None,
637 debug=0, target_lang=None):
638 """Link a bunch of stuff together to create a static library
file.
639 The "bunch of stuff" consists of the list of object files
supplied
/Applications/sage/local/lib/python/distutils/unixccompiler.pyc in
_compile(self=<distutils.unixccompiler.UnixCCompiler instance>,
obj='/Users/jim/.pyxbld/temp.macosx-10.6-x86_64-2.7/U...osx-10.6-x86_64-2.7/pyrex/sage/libs/flint/flint.o',
src='/Users/jim/.pyxbld/temp.macosx-10.6-x86_64-2.7/pyrex/sage/libs/flint/flint.c',
ext='.c', cc_args=['-I/Applications/sage/local/include/python2.7', '-c'],
extra_postargs=[], pp_opts=['-I/Applications/sage/local/include/python2.7'])
165 if output_file:
166 self.mkpath(os.path.dirname(output_file))
167 try:
168 self.spawn(pp_args)
169 except DistutilsExecError, msg:
170 raise CompileError, msg
171
172 def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
173 compiler_so = self.compiler_so
174 if sys.platform == 'darwin':
175 compiler_so = _darwin_compiler_fixup(compiler_so, cc_args +
extra_postargs)
176 try:
177 self.spawn(compiler_so + cc_args + [src, '-o', obj] +
178 extra_postargs)
179 except DistutilsExecError, msg:
--> 180 raise CompileError, msg
181
182 def create_static_lib(self, objects, output_libname,
183 output_dir=None, debug=0, target_lang=None):
184 objects, output_dir = self._fix_object_args(objects, output_dir)
185
186 output_filename = \
187 self.library_filename(output_libname, output_dir=output_dir)
188
189 if self._need_link(objects, output_filename):
190 self.mkpath(os.path.dirname(output_filename))
191 self.spawn(self.archiver +
192 [output_filename] +
193 objects + self.objects)
194
195 # Not many Unices required ranlib anymore -- SunOS 4.x is, I
ImportError: Building module failed: ["CompileError: command 'gcc' failed with
exit status 1\n"]
***************************************************************************
History of session input:
sage.misc.preparser.load(sage.misc.preparser.base64.b64decode("L1VzZXJzL2ppbS8uc2FnZS8vaW5pdC5zYWdl"),globals(),False)
gridproj = load("gridproj")
load(gridproj + "HW3.spyx")
load(gridproj + "HW3.sage")
load(gridproj + "HW3.spyx")
*** Last line of input (may not be in above history):
load(gridproj + "HW3.spyx")
Jim Clark
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org