Use ILU to connect the two sides. See ftp://ftp.parc.xerox.com/pub/ilu/ilu.html for more information. Basically, you write a little ILU wrapper in C around mymath.c (there are examples included in the distribution), then use either the C or Python bindings for ILU on the client side. Bill