unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Re: libguile on Windows
       [not found] ` <87vf07afac.fsf@ossau.uklinux.net>
@ 2005-10-09 21:53   ` Dylan Nicholson
  2005-10-10 16:47     ` Neil Jerram
  0 siblings, 1 reply; 10+ messages in thread
From: Dylan Nicholson @ 2005-10-09 21:53 UTC (permalink / raw)
  Cc: guile-user

>
> Dylan,
>
> Yes I do, but I'd recommend writing to guile-user@gnu.org instead of
> to me directly; I am far from being an expert on this subject.
>

Ok, I got guile 1.6.5 compiling and linking as a static library under MSVC 
7.1, but if I try a simple (console) program that just calls
scm_boot_guile(), when it runs it just prints out "ERROR: unbound variable 
define" and aborts.

This occurs while reading/processing boot-9.scm from the ice-9 directory.

Any ideas?

Thanks

Dylan





_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
  2005-10-09 21:53   ` Dylan Nicholson
@ 2005-10-10 16:47     ` Neil Jerram
  2005-10-10 22:19       ` Dylan Nicholson
  0 siblings, 1 reply; 10+ messages in thread
From: Neil Jerram @ 2005-10-10 16:47 UTC (permalink / raw)
  Cc: guile-user

"Dylan Nicholson" <dylannic@bigpond.net.au> writes:

>>
>> Dylan,
>>
>> Yes I do, but I'd recommend writing to guile-user@gnu.org instead of
>> to me directly; I am far from being an expert on this subject.
>>
>
> Ok, I got guile 1.6.5 compiling and linking as a static library under
> MSVC 7.1, but if I try a simple (console) program that just calls
> scm_boot_guile(), when it runs it just prints out "ERROR: unbound
> variable define" and aborts.
>
> This occurs while reading/processing boot-9.scm from the ice-9 directory.
>
> Any ideas?

Can you hack the code somehow so that the debug and backtrace options
are set:

  SCM_DEVAL_P = 1;
  SCM_BACKTRACE_P = 1;
  SCM_RESET_DEBUG_MODE;

(This would have to be after the init functions for debug.c.)

Then you may get more error information.

     Neil



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
  2005-10-10 16:47     ` Neil Jerram
@ 2005-10-10 22:19       ` Dylan Nicholson
  0 siblings, 0 replies; 10+ messages in thread
From: Dylan Nicholson @ 2005-10-10 22:19 UTC (permalink / raw)
  Cc: guile-user

----- Original Message ----- 
From: "Neil Jerram" <neil@ossau.uklinux.net>
To: "Dylan Nicholson" <dylannic@bigpond.net.au>
Cc: <guile-user@gnu.org>
Sent: Tuesday, October 11, 2005 2:47 AM
Subject: Re: libguile on Windows


> "Dylan Nicholson" <dylannic@bigpond.net.au> writes:
>>
>> Ok, I got guile 1.6.5 compiling and linking as a static library under
>> MSVC 7.1, but if I try a simple (console) program that just calls
>> scm_boot_guile(), when it runs it just prints out "ERROR: unbound
>> variable define" and aborts.
>>
>> This occurs while reading/processing boot-9.scm from the ice-9 directory.
>>
>> Any ideas?
>
> Can you hack the code somehow so that the debug and backtrace options
> are set:
>
>  SCM_DEVAL_P = 1;
>  SCM_BACKTRACE_P = 1;
>  SCM_RESET_DEBUG_MODE;
>
> (This would have to be after the init functions for debug.c.)

I just get

Backtrace:
In unknown file:
   ?: 0*

Then an access violation trying to access a null pointer in unmemocopy 
(eval.c, line 1291).  unmemocopy calls itself recursively using SCM_CAR( ), 
and at some point SCM_CAR returns 0, which unmemocopy can't handle.

This happens no matter where I put the code (e.g. before callling 
scm_boot_guile or just before scm_load_startup_files())





_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
@ 2005-10-10 22:38 Dylan Nicholson
  0 siblings, 0 replies; 10+ messages in thread
From: Dylan Nicholson @ 2005-10-10 22:38 UTC (permalink / raw)
  Cc: guile-user

> ----- Original Message ----- 
> From: "Neil Jerram" <neil@ossau.uklinux.net>
>>
>> Can you hack the code somehow so that the debug and backtrace options
>> are set:
>>
>>  SCM_DEVAL_P = 1;
>>  SCM_BACKTRACE_P = 1;
>>  SCM_RESET_DEBUG_MODE;
>>
>> (This would have to be after the init functions for debug.c.)
>
> I just get
>
> Backtrace:
> In unknown file:
>   ?: 0*
>
> Then an access violation trying to access a null pointer in unmemocopy 
> (eval.c, line 1291).  unmemocopy calls itself recursively using 
> SCM_CAR( ), and at some point SCM_CAR returns 0, which unmemocopy can't 
> handle.
>
> This happens no matter where I put the code (e.g. before callling 
> scm_boot_guile or just before scm_load_startup_files())
>
Ok, I added an extra test to unmemocopy (to test that the argument is null), 
and now I get

Backtrace:
In unknown file:
   ?: 0* (define begin-deprecated (procedure->memoizing-macro (lambda # #)))

<unnamed port>: In expression (define begin-deprecated 
(procedure->memoizing-macro #)):
<unnamed port>: Unbound variable: define


Hope that means more to you than it does to me!  I don't understand why I 
needed to
change unmemocopy though.





_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
@ 2005-10-10 22:52 Dylan Nicholson
  2005-10-10 23:09 ` Neil Jerram
  0 siblings, 1 reply; 10+ messages in thread
From: Dylan Nicholson @ 2005-10-10 22:52 UTC (permalink / raw)
  Cc: guile-user

Sorry for the top-post, but now I'm pretty sure I know what the problem is.

I wasn't sure how to create the .x files, so I simply created them all as 
blank files!
Obviously this isn't right, so if anyone can send me the .x files, or simple 
instructions on how to create them *without* any GNU tools, that would be 
great.

----- Original Message ----- 

From: "Dylan Nicholson" <dylannic@bigpond.net.au>
To: "Neil Jerram" <neil@ossau.uklinux.net>
Cc: <guile-user@gnu.org>
Sent: Tuesday, October 11, 2005 8:38 AM
Subject: Re: libguile on Windows


>> ----- Original Message ----- 
>> From: "Neil Jerram" <neil@ossau.uklinux.net>
>>>
>>> Can you hack the code somehow so that the debug and backtrace options
>>> are set:
>>>
>>>  SCM_DEVAL_P = 1;
>>>  SCM_BACKTRACE_P = 1;
>>>  SCM_RESET_DEBUG_MODE;
>>>
>>> (This would have to be after the init functions for debug.c.)
>>
>> I just get
>>
>> Backtrace:
>> In unknown file:
>>   ?: 0*
>>
>> Then an access violation trying to access a null pointer in unmemocopy 
>> (eval.c, line 1291).  unmemocopy calls itself recursively using 
>> SCM_CAR( ), and at some point SCM_CAR returns 0, which unmemocopy can't 
>> handle.
>>
>> This happens no matter where I put the code (e.g. before callling 
>> scm_boot_guile or just before scm_load_startup_files())
>>
> Ok, I added an extra test to unmemocopy (to test that the argument is 
> null), and now I get
>
> Backtrace:
> In unknown file:
>   ?: 0* (define begin-deprecated (procedure->memoizing-macro (lambda # 
> #)))
>
> <unnamed port>: In expression (define begin-deprecated 
> (procedure->memoizing-macro #)):
> <unnamed port>: Unbound variable: define
>
>
> Hope that means more to you than it does to me!  I don't understand why I 
> needed to
> change unmemocopy though.
>
>
> 



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
  2005-10-10 22:52 libguile on Windows Dylan Nicholson
@ 2005-10-10 23:09 ` Neil Jerram
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Jerram @ 2005-10-10 23:09 UTC (permalink / raw)
  Cc: guile-user

"Dylan Nicholson" <dylannic@bigpond.net.au> writes:

> Sorry for the top-post, but now I'm pretty sure I know what the problem is.
>
> I wasn't sure how to create the .x files, so I simply created them all
> as blank files!
> Obviously this isn't right, so if anyone can send me the .x files, or
> simple instructions on how to create them *without* any GNU tools,
> that would be great.

Yes, that'll be it.  I'll send these to you off-list.

     Neil




_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
@ 2005-10-10 23:23 Dylan Nicholson
  2005-10-10 23:40 ` Neil Jerram
  0 siblings, 1 reply; 10+ messages in thread
From: Dylan Nicholson @ 2005-10-10 23:23 UTC (permalink / raw)
  Cc: guile-user

>>
>> .x files are attached.  These are from the 1.6.x branch in CVS, so may
>> not match your codebase exactly, but any discrepancies should be
>> trivial to resolve - let me know if you need help with any such
>> problems.
>>
>>      Neil
>>
> Thank you so much.  Now I get
>
> Backtrace:
> In unknown file:
>   ?: 0* [for-each #<procedure set-system-module! (m s)> ...
>   ?: 1*  (list the-root-module the-scm-module)
>
> <unnamed port>: In expression (list the-root-module the-scm-module):
> <unnamed port>: Unbound variable: list
>
>
Thought I knew what the problem was here, but no such luck...

The line
scm_c_define_gsubr (s_list, 0, 0, 1, (SCM (*)()) scm_list_copy);

from list.x didn't compile at first, so I tried commenting it out, then 
adding
static char s_list[]="list";

to list.c (it was only in read.c)

Still, seems like at least some progress!





_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
  2005-10-10 23:23 Dylan Nicholson
@ 2005-10-10 23:40 ` Neil Jerram
       [not found]   ` <00e301c5cdf5$02aa3d40$6b01a8c0@DORIAN>
  0 siblings, 1 reply; 10+ messages in thread
From: Neil Jerram @ 2005-10-10 23:40 UTC (permalink / raw)
  Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

"Dylan Nicholson" <dylannic@bigpond.net.au> writes:

> Thought I knew what the problem was here, but no such luck...
>
> The line
> scm_c_define_gsubr (s_list, 0, 0, 1, (SCM (*)()) scm_list_copy);
>
> from list.x didn't compile at first, so I tried commenting it out,
> then adding
> static char s_list[]="list";
>
> to list.c (it was only in read.c)
>
> Still, seems like at least some progress!

Please try the attached instead.  These ones are from my own Windows
(MSVC) build of Guile 1.6.4, so they will hopefully work.  (And in
particular, the entry for "list" is a bit different!)

Regards,
        Neil


[-- Attachment #2: x files 2 --]
[-- Type: application/octet-stream, Size: 12189 bytes --]

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
@ 2005-10-10 23:43 Dylan Nicholson
  0 siblings, 0 replies; 10+ messages in thread
From: Dylan Nicholson @ 2005-10-10 23:43 UTC (permalink / raw)
  Cc: guile-user

>> Thank you so much.  Now I get
>>
>> Backtrace:
>> In unknown file:
>>   ?: 0* [for-each #<procedure set-system-module! (m s)> ...
>>   ?: 1*  (list the-root-module the-scm-module)
>>
>> <unnamed port>: In expression (list the-root-module the-scm-module):
>> <unnamed port>: Unbound variable: list
>>
>>
> Thought I knew what the problem was here, but no such luck...
> 
> The line
> scm_c_define_gsubr (s_list, 0, 0, 1, (SCM (*)()) scm_list_copy);
> 
> from list.x didn't compile at first, so I tried commenting it out, then 
> adding
> static char s_list[]="list";
> 
> to list.c (it was only in read.c)
> 
> Still, seems like at least some progress!
> 
I replaced the line listed above from list.x with

scm_c_define_gsubr (s_scm_list, 0, 0, 1, (SCM (*)()) scm_list);
And now the following C++ program runs and prints "Hello world":

#include <iostream>
#include "libguile.h"
#include "libguile\gh.h"

static void
main_with_guile (void *, int argc, char ** argv)
{
 std::cout << "Hello ";
 scm_c_eval_string("(display \"world!\n\")");
}

int main(int argc, char* argv[])
{
 scm_boot_guile (argc, argv, main_with_guile, 0);
 return 0;
}





_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: libguile on Windows
       [not found]   ` <00e301c5cdf5$02aa3d40$6b01a8c0@DORIAN>
@ 2005-10-11 22:37     ` Neil Jerram
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Jerram @ 2005-10-11 22:37 UTC (permalink / raw)
  Cc: Guile Users

"Dylan Nicholson" <dylannic@bigpond.net.au> writes:

> Would there be place or purpose to make publically available a version
> of libguile intended for compiling under MSVC?

As far as the core Guile distribution is concerned, I think it depends
on whether there is any practical difference between an MSVC-compiled
libguile DLL and one produced by the MinGW cross-compiler.  (This is
something I don't understand yet.)

If there isn't, the fact that (AFAIU) the MinGW approach already works
would make it difficult to justify maintaining an MSVC build approach
in the core distribution.

(Of course someone could maintain an MSVC build independently.)

> The only part I'd really like to fix is the snarfing part - it can *in
> principle* be done automatically, although I'm not exactly sure if the
> dependencies would function 100% reliably.
> Even if it's just a static snapshot of 1.6.5 until someone else can be
> bothered to come along and maintain it, there would surely at least be
> one or two other weirdos like me out there that prefer to work with MS
> products than GNU tools...

Even if you are going to compile using MSVC, the most practical way
(that I'm aware of) to do the snarfing is to do a partial build under
Cygwin first.  So GNU tools will always be involved, I think.

Regards,
        Neil



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-10-11 22:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-10 22:52 libguile on Windows Dylan Nicholson
2005-10-10 23:09 ` Neil Jerram
  -- strict thread matches above, loose matches on Subject: below --
2005-10-10 23:43 Dylan Nicholson
2005-10-10 23:23 Dylan Nicholson
2005-10-10 23:40 ` Neil Jerram
     [not found]   ` <00e301c5cdf5$02aa3d40$6b01a8c0@DORIAN>
2005-10-11 22:37     ` Neil Jerram
2005-10-10 22:38 Dylan Nicholson
     [not found] <001f01c5ca06$9a957db0$6401a8c0@DORIAN>
     [not found] ` <87vf07afac.fsf@ossau.uklinux.net>
2005-10-09 21:53   ` Dylan Nicholson
2005-10-10 16:47     ` Neil Jerram
2005-10-10 22:19       ` Dylan Nicholson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).