Skip to content

Instantly share code, notes, and snippets.

@mattip
Created July 10, 2017 02:23
Show Gist options
  • Save mattip/c2867a7e22a6c90cc3053281a7cfff9e to your computer and use it in GitHub Desktop.
Save mattip/c2867a7e22a6c90cc3053281a7cfff9e to your computer and use it in GitHub Desktop.
f2py with --debug-capi
############ lambda: a: math.degrees #############
debug-capi:Python C/API function _test_ext_module_5403.t(fun,fun_extra_args=())
debug-capi:int a=:output,hidden,scalar
debug-capi:a=0
debug-capi:fun=>cb_fun_in_t__user__routines:input,required,callback
debug-capi:create_cb_arglist
debug-capi:create_cb_arglist:maxnofargs(-nofoptargs),tot,opt,ext,siz,nofargs=0(-0),1,0,1,1,0
debug-capi:create_cb_arglist-end
debug-capi:Assuming 0 arguments; at most 0(-0) is expected.
debug-capi:for fun=NULL
debug-capi:fun=0x7f4f94537db0 (call-back in C).
debug-capi:Saving jmpbuf for `fun`.
debug-capi:Fortran subroutine `t(fun_cptr,&a)'
debug-capi:cb:Call-back function cb_fun_in_t__user__routines (maxnofargs=0(-0))
debug-capi:cb:cb_fun_in_t__user__routines_capi=<function <lambda> at 0x00007f4f947f2368>
debug-capi:cb:capi_arglist=(3.141592653589793,)
debug-capi:cb:Call-back calling Python function fun.
debug-capi:cb:capi_return=180.0
debug-capi:cb:Getting a->180.
debug-capi:cb:cb_fun_in_t__user__routines:successful
debug-capi:a=180
debug-capi:Building return value.
debug-capi:Restoring jmpbuf for `fun`.
debug-capi:Python C/API function _test_ext_module_5403.t: successful.
debug-capi:Freeing memory.
############ degrees #############
debug-capi:Python C/API function _test_ext_module_5403.t(fun,fun_extra_args=())
debug-capi:int a=:output,hidden,scalar
debug-capi:a=0
debug-capi:fun=>cb_fun_in_t__user__routines:input,required,callback
debug-capi:create_cb_arglist
debug-capi:create_cb_arglist:maxnofargs(-nofoptargs),tot,opt,ext,siz,nofargs=0(-0),0,0,1,0,0
debug-capi:create_cb_arglist-end
debug-capi:Assuming 0 arguments; at most 0(-0) is expected.
debug-capi:for fun=NULL
debug-capi:fun=0x7f4f94537db0 (call-back in C).
debug-capi:Saving jmpbuf for `fun`.
debug-capi:Fortran subroutine `t(fun_cptr,&a)'
debug-capi:cb:Call-back function cb_fun_in_t__user__routines (maxnofargs=0(-0))
debug-capi:cb:cb_fun_in_t__user__routines_capi=<built-in function degrees>
debug-capi:cb:capi_arglist=()
debug-capi:cb:Call-back calling Python function fun.
debug-capi:cb:capi_return=NULL
capi_return is NULL
Call-back cb_fun_in_t__user__routines failed.
debug-capi:Restoring jmpbuf for `fun`.
debug-capi:Python C/API function _test_ext_module_5403.t: failure.
debug-capi:Freeing memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment