Compilation

7 views
Skip to first unread message

faruque

unread,
May 19, 2009, 9:02:48 AM5/19/09
to Syx general discussion
Hi,
I have a strange issue when compiling Src.syx-0.1.7.zip.
When I have compiled the exe from source using syx.sln, I cant seem to
get any fileIn's to work.
Once compiled if I perform these operations

...\syx>dbg\syx.exe -s -r=.
...\syx>dbg\syx.exe examples\basic\helloworld.st

I get no output where as if I use the exe in the binary distribution
it works.

...\syx>"c:\Program Files\Syx\syx.exe" examples\basic\helloworld.st

I get

'Hello world'
Hello world displayed
Hello world again

any pointers would be appreciated.
Im compiling in MS VS 2005 with no changes to the source files.

Thanks
Faruque

Luca Bruno

unread,
May 19, 2009, 3:20:23 PM5/19/09
to syx-d...@googlegroups.com, faruque
On Tue, May 19, 2009 at 06:02:48AM -0700, faruque wrote:
>
> Hi,
> I have a strange issue when compiling Src.syx-0.1.7.zip.
> When I have compiled the exe from source using syx.sln, I cant seem to
> get any fileIn's to work.
> Once compiled if I perform these operations
>
> ...\syx>dbg\syx.exe -s -r=.
> ...\syx>dbg\syx.exe examples\basic\helloworld.st

First of all -s shouldn't exit but give you a Smalltalk shell. So I'd start
understanding why it exits. What if you perform syx.exe -s -r . using the
precompiled win32 binaries?

> I get no output where as if I use the exe in the binary distribution
> it works.
>
> ...\syx>"c:\Program Files\Syx\syx.exe" examples\basic\helloworld.st
>
> I get
>
> 'Hello world'
> Hello world displayed
> Hello world again

What's the source of helloworld.st? Do you get 3 times Hello world?

> any pointers would be appreciated.
> Im compiling in MS VS 2005 with no changes to the source files.

I've never compiled Syx under MSVC as it's been contributed, so I think
you should give us more information.

Best regards,

--
http://syx.googlecode.com - Smalltalk YX
http://lethalman.blogspot.com - Thoughts about computer technologies
http://www.debian.org - The Universal Operating System

signature.asc

faruque

unread,
May 19, 2009, 5:44:53 PM5/19/09
to Syx general discussion
Hi

>What if you perform syx.exe -s -r . using the precompiled win32 binaries?

The behaviour of syx.exe -s -r . in the binary distribuion is the same
as the version compiled by me.
The program exits once it creates the image file.
I dont get a shell in both cases.

> What's the source of helloworld.st? Do you get 3 times Hello world?
The source of the helloworld.st is Src.syx-0.1.7.zip, in the examples
\basic\ folder of the zip file.
I get no output from the version I compiled, but I get 3 "hello world"
from the exe in the binary distribution.

Can you please let me know what compiler ( and version ) was used to
produce the exe in the windows binary distribution?

Thanks for the quick response.
Faruque
>  signature.asc
> < 1KViewDownload

Luca Bruno

unread,
May 20, 2009, 3:33:53 PM5/20/09
to syx-d...@googlegroups.com, faruque
On Tue, May 19, 2009 at 02:44:53PM -0700, faruque wrote:
> The behaviour of syx.exe -s -r . in the binary distribuion is the same
> as the version compiled by me.
> The program exits once it creates the image file.
> I dont get a shell in both cases.

Oh yes that's a bug of 0.1.7, my bad. Anyway you get an image of the same
size?

> The source of the helloworld.st is Src.syx-0.1.7.zip, in the examples
> \basic\ folder of the zip file.

So the output is right.

> I get no output from the version I compiled, but I get 3 "hello world"
> from the exe in the binary distribution.

That needs some debug on whether the interpreter runs the startup method and
it reads the file from the console arguments.
Could you test if:
o syx_initialize_system is being called (in syx/syx-init.c)
o test if the code under /* Now schedule to startup */ (in src/main.c) is
being called
o try doing commandLine commandLineArguments printNl under
st/kernel/SystemDictionary.st in the startupSystem method

> Can you please let me know what compiler ( and version ) was used to
> produce the exe in the windows binary distribution?

I use SCons as build system and MingW as compiler, for both win32 and wince.

> Thanks for the quick response.

Thanks for your interest and the help.

signature.asc

Gulam Faruque

unread,
May 20, 2009, 7:20:32 PM5/20/09
to syx-d...@googlegroups.com, faruque
>Anyway you get an image of the same
size?

Yes in both cases the image is exactly the same size.
1,187,418 bytes


>o  syx_initialize_system is being called (in syx/syx-init.c)
>o  test if the code under /* Now schedule to startup */ (in src/main.c) is
  being called
>o  try doing commandLine commandLineArguments printNl under
  st/kernel/SystemDictionary.st in the startupSystem method

1) I updated syx_initialize_system  as below

syx_initialize_system (void)
{
  SyxOop context;
  SyxOop process;
  SyxOop arguments = syx_array_new_size (_syx_argc);
  syx_varsize i;

 printf("syx_initialize_system\n");
  for (i=0; i < _syx_argc; i++)

2) I updated the   /* Now schedule to startup */ code as below



      /* Now schedule to startup */
      printf("Begin schedule startup\n");
      process = syx_process_new ();
      context = syx_send_unary_message (syx_globals, "startupSystem");
      syx_interp_enter_context (process, context);
      SYX_PROCESS_SUSPENDED (process) = syx_false;
      SYX_OBJECT_VARS(syx_globals)[3] = process;
      printf("End schedule startup\n");

3) I updated the startupSystem as below

startupSystem
    | continueStartup evalString |
    commandLine commandLineArguments printNl.
    commandLine parse: #(c e:).
    continueStartup := commandLine options at: #c ifAbsent: [ false ].
    evalString := commandLine options at: #e: ifAbsent: [ nil ].


I re compiled the exe, and recreated the image default.sim and ran the helloworld.st.
output as below


...\syx>dbg\syx.exe examples\basic\helloworld.st
syx_initialize_system
Begin schedule startup
End schedule startup
Array ('examples\basic\helloworld.st' )

Hope this narrows down the issue.

Im not familiar with SCons or MingW so I wont try to recreate that environment for now.

Thanks.
Faruque

2009/5/20 Luca Bruno <letha...@gmail.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoUWyAACgkQw9Qjꓜ䡶'훛�㧱됙ﯛ湎壺�
1ysAniJcosotX/GRSRov0hz1i/LDkKlX
=Fe9i
-----END PGP SIGNATURE-----


Luca Bruno

unread,
May 21, 2009, 4:33:02 PM5/21/09
to syx-d...@googlegroups.com
On Thu, May 21, 2009 at 12:20:32AM +0100, Gulam Faruque wrote:
> >Anyway you get an image of the same
> size?
>
> Yes in both cases the image is exactly the same size.
> 1,187,418 bytes
>
> >o syx_initialize_system is being called (in syx/syx-init.c)
> >o test if the code under /* Now schedule to startup */ (in src/main.c) is
> being called
> >o try doing commandLine commandLineArguments printNl under
> st/kernel/SystemDictionary.st in the startupSystem method
>
> 1) I updated syx_initialize_system as below
>
> syx_initialize_system (void)
> {
> SyxOop context;
> SyxOop process;
> SyxOop arguments = syx_array_new_size (_syx_argc);
> syx_varsize i;
>
> * printf("syx_initialize_system\n");
> * for (i=0; i < _syx_argc; i++)

>
> 2) I updated the /* Now schedule to startup */ code as below
>
>
> /* Now schedule to startup */
> *printf("Begin schedule startup\n");*

> process = syx_process_new ();
> context = syx_send_unary_message (syx_globals, "startupSystem");
> syx_interp_enter_context (process, context);
> SYX_PROCESS_SUSPENDED (process) = syx_false;
> SYX_OBJECT_VARS(syx_globals)[3] = process;
> *printf("End schedule startup\n")*;

>
> 3) I updated the startupSystem as below
>
> startupSystem
> | continueStartup evalString |
> *commandLine commandLineArguments printNl.*

> commandLine parse: #(c e:).
> continueStartup := commandLine options at: #c ifAbsent: [ false ].
> evalString := commandLine options at: #e: ifAbsent: [ nil ].
>
>
> I re compiled the exe, and recreated the image default.sim and ran the
> helloworld.st.
> output as below
>
> ...\syx>dbg\syx.exe examples\basic\helloworld.st
> syx_initialize_system
> Begin schedule startup
> End schedule startup
> Array ('examples\basic\helloworld.st' )
>
> Hope this narrows down the issue.
>
> Im not familiar with SCons or MingW so I wont try to recreate that
> environment for now.
>

Seems to work correctly. The only problem then can be in fileIn. What if you
manually run:

syx.exe
> FileStream fileIn: 'examples\basic\helloworld.st'!

Thanks.

signature.asc

Gulam Faruque

unread,
May 21, 2009, 7:42:48 PM5/21/09
to syx-d...@googlegroups.com
See output below.

Smalltalk YX 0.1.7 is ready.
Type "help!" to get help.

> FileStream fileIn: 'examples\basic\helloworld.st'!
a FileStream
>

2009/5/21 Luca Bruno <letha...@gmail.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoVun4ACgkQw9Qj+8Kak3G1LwCfWHsNv0Jtd20PijxOMH5xloNY
G3AAnj682CGXV+G1P9OomUVmKUXtBF3r
=qMX0
-----END PGP SIGNATURE-----


Luca Bruno

unread,
May 22, 2009, 1:15:35 PM5/22/09
to syx-d...@googlegroups.com, Gulam Faruque
On Fri, May 22, 2009 at 12:42:48AM +0100, Gulam Faruque wrote:
> See output below.
>
> Smalltalk YX 0.1.7 is ready.
> Type "help!" to get help.
> > FileStream fileIn: 'examples\basic\helloworld.st'!
> a FileStream
> >
>

Maybe I've understood the problem... fstat.
FileStream upToEnd needs to know the size of the file, which currently can
be obtained only using fstat (in syx/syx-primitives.c; FileStream_fileOp
primitive; case 7). I didn't look for anything similar on Windows due to
lack of time, please consider reporting the bug, and if you want, creating a patch.
If MSVC has an fstat function, defining HAVE_FSTAT under msvc/syx-config.h
could be enough.

Let me know, thanks for you help.

signature.asc

Gulam Faruque

unread,
May 22, 2009, 4:53:23 PM5/22/09
to syx-d...@googlegroups.com, Gulam Faruque
You are correct, defining HAVE_FSTAT  in msvc/syx-config.h did the trick

I added the  line

#define HAVE_FSTAT 1

to msvc/syx-config.h, recompiled and it now works.

Thanks for your help.
Faruque

2009/5/22 Luca Bruno <letha...@gmail.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoW3bYACgkQw9Qj+8Kak3Gf9ACdG0ee1CSBzwLU+8BigGBYatxo
02AAnRdNnjSziDH0eeG5wqD8Dqp6EQ8X
=7aTp
-----END PGP SIGNATURE-----


Reply all
Reply to author
Forward
0 new messages