When building Arbor you can enable backtraces in the CMake configure step by
ARB_BACKTRACE=ON. Beware aware that this requires the
libraries to be installed on your system. This will cause the following
additions to Arbor’s behaviour
Failed assertions via
asb_assertwill print the corresponding stacktrace.
All exceptions deriving from
arbor_internal_errorwill have stacktraces attached in the
Python exceptions derived from these types will add that same stacktrace information to their message.
Alternatively, you can obtain the same information using a debugger like GDB or LLDB.
Since Arbor often uses a buffer of instructions on how to construct a particular object instead of perform the action right away, errors occur not always at the location you might expect.
Consider this (adapted from
class Recipe(arb.recipe): # [...] def connections_on(self, gid): return [arbor.connection((src, "detector"), "syn-NOT", w, d)] def cell_description(self, gid): # [...] decor = (arbor.decor() .place('"synapse_site"', arbor.synapse("expsyn"), "syn")) return arbor.cable_cell(tree, labels, decor) rec = Recipe() # "Ok" sim = arb.simulation(rec) # ERROR here