RPC xdr_free segmentation fault

2014-11-09 Thread Tomas By
Hi all, I'm trying to write a Guile/C RPC client (I know about guile-rpc but would like to get this working also). The dir.x and server code is the standard RPC example. I have only modified the client (code below). It works fine as far as the xdr_free at the bottom, which causes a segmentation

Guile/Cairo, files formats/surfaces

2015-08-02 Thread Tomas By
Hi all, (Am following instructions on http://www.nongnu.org/guile-cairo/dev/) I'm trying to create EPS files using guile-cairo, but have some problems. Am using version 1.14.2, the latest in Ubuntu. scheme@(guile-user)> (cairo-version-string) $1 = "1.14.2" According to the web documentation

Re: Guile/Cairo, files formats/surfaces

2015-08-05 Thread Tomas By
Hi, On 2015-08-05 10:32, Amirouche Boubekki wrote: Can you share a small snippet that works for images? I'd like to output a pdf, but I can't. Not sure what you are having problems with, but this produces a PDF: (define (pdf-file) (let* ((sf (cairo-pdf-surface-create 842 595 "test.pdf"))

system calls

2015-09-01 Thread Tomas By
Hi all, In a Guile program I am using (system ) to start a C binary which I then communicate with over the network. I'm wondering if there is any way to get the process id of this binary? Have tried to call "ps -A|grep " using with-output-to-string and with-error-to-string, but am not gettin

gdk-pixbuf-add-alpha

2015-12-01 Thread Tomas By
Hi all, I am trying to change a colour to transparent by doing this: (gdk-pixbuf-add-alpha img #t (integer->char r) (integer->char g) (integer->char b)) (Doing `interger->char' seems a bit weird but passing ints causes errors.) However, the image is not changed (I write it out using gdk

dynamic linking

2010-02-05 Thread Tomas By
Hi all, I'm trying to create a Guile module, using code written in Mercury. (http://www.cs.mu.oz.au/research/mercury/) I have managed to produce a library file (.so), but when I try to open it in Guile (with dynamic-link), I get "file not found". It's clear from the strace output that it does find

Re: dynamic linking

2010-02-08 Thread Tomas By
3000, 6385312) = 0 munmap(0x304000, 287840)= 0 munmap(0x49b000, 206620)= 0 munmap(0xe5b000, 119336)= 0 ------ On Fri, February 5, 2010 14:57, Ludovic Courtès wrote: > Hi, > >

Re: dynamic linking

2010-02-08 Thread Tomas By
On Mon, February 8, 2010 13:15, Tomas By wrote: > I have now tried to link my Mercury library with the libgc that Guile > uses instead of the Mercury one, and I asked about it on the Mercury > mailing list, where I got this reply: > > "The version of libgc that Mercury u

Re: dynamic linking

2010-02-09 Thread Tomas By
On Mon, February 8, 2010 13:50, Ludovic Courtès wrote: > Looking at the strace(1) output you sent doesn’t really help. Could you > instead send the strace(1) output starting at the first occurrence of > “libguile”? It should be this bit I think: open("/usr/lib/libguile.so.17", O_RDONLY) =

hackery (was: dynamic linking)

2010-02-15 Thread Tomas By
Hello again everybody, After some experimentation, it now seems clear that this has nothing to do with garbage collection or Mercury. It is probably just a silly programming error on my part. Here follows full source code for a simple example that illustrates the problem I am having. The importan

Re: hackery (was: dynamic linking)

2010-02-16 Thread Tomas By
On Tue, February 16, 2010 16:20, Linas Vepstas wrote: > what does ldd libguile-mytest.so show? Are all dependencies resolved? I think so. > If you compile the following, will it run? [...] > i.e. is this enough to compile it: [...] Mercury needs to be initialized, and the C compiler needs to kn

loading a module

2010-02-17 Thread Tomas By
Hello one more time, There was a little problem in mytest.c, where I had declared a pointer only and no address location. This was the cause of the segmentation fault. With the following source files, the code Linas posted, after some modifications, is compiled to a binary `vepstas' which runs fi

Re: loading a module

2010-02-17 Thread Tomas By
On Wed, February 17, 2010 21:12, Andy Wingo wrote: > On Wed 17 Feb 2010 19:26, "Tomas By" writes: > More than that, it's tough to say; I'm mercury-ignorant. Well, since the `vepstas' binary works, the Mercury bit seems ok. Do you have any suggestions for how to

Re: loading a module

2010-03-01 Thread Tomas By
On Sun, February 28, 2010 23:59, Neil Jerram wrote: > This is really a stab in the dark - but could you try using a name for > the Scheme-level procedure that is different from the module name? > Currently they are both "mytest". > > I think there could be some residual nonsense meaning for a bindi

Guile + Mercury / GC

2011-06-11 Thread Tomas By
Hi all, After upgrading to Guile 2.0.1, my Mercury - Guile app stopped working. | $ ./test | 0xac44040 is not a GC visible pointer location | GC_is_visible test failed | Aborted | $ All source files for a minimal example shown below. Any help appreciated. /Tomas ---test.c

Re: Guile + Mercury / GC

2011-06-13 Thread Tomas By
On Sun, June 12, 2011 23:05, Ludovic Courtès wrote: > "Tomas By" skribis: >> After upgrading to Guile 2.0.1, > > From 2.0.0? 1.8.7 > Could it be that libgc was compiled with --disable-threads, as in > <http://thread.gmane.org/gmane.lisp.guile.bugs/5435>?

"unbound variable"

2011-06-26 Thread Tomas By
Hi all, I have an extended Guile interpreter with a C function "get-map", defined by "scm_c_define_gsubr", that I then try to use in the (pure Scheme) module "mapdisplay", with the following result: | mapdisplay.scm:36:12: In expression (get-map wg name): | mapdisplay.scm:36:12: Unbound variable:

Re: "unbound variable"

2011-06-27 Thread Tomas By
On Mon, June 27, 2011 05:40, nalaginrut wrote: > I think you need to import this symbol in your module, in this case, I > think it's mapdisplay.scm. If get-map's not within a module, you'd need > to get this symbol with "dynamic-link" and it's friends. It's in the top-level module. | guile> (apro

Re: "unbound variable"

2011-06-27 Thread Tomas By
Hi again, Thanks for the help so far. On Mon, June 27, 2011 10:38, nalaginrut wrote: > I can't give accurate answer because you provided less information. So I > just give a guess: > If you have wrapped a module in mapdisplay.scm, you'd have imported some > symbols out of this module. I know you

Re: "unbound variable"

2011-06-27 Thread Tomas By
On Mon, June 27, 2011 23:44, Linas Vepstas wrote: > Not sure what the bug is, though ... does get-map work > if you don't use it within the module? Can you verify it works > in some simple way? yes it works fine, except from inside the module.