Is there a way to compile StackVM from XCode?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a way to compile StackVM from XCode?

Mariano Martinez Peck
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Thanks in advance,

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Eliot Miranda-2
 
Hi Mariano,

On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).

John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.

HTH
Eliot

Thanks in advance,

Mariano


Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

EstebanLM
 
Hi,
Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)

Cheers,
Esteban

El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:

Hi Mariano,

On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).

John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.

HTH
Eliot

Thanks in advance,

Mariano



Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

johnmci
 
There are some changes that are not integrated. 

readImageFromFileHeapSizeStartingAt
sqAllocateMemory
sqImageFileRead

See the Squeak VMMaker source for the change sets needed to alter the header for readImageFromFileHeapSizeStartingAt
and the new logic for sqAllocateMemory & sqImageFileRead that let's you mmap the image file in sqAllocateMemory and not assume you'll read the entire file into memory in sqImageFileRead


On 2010-12-10, at 10:11 AM, Esteban Lorenzano wrote:

Hi,
Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)

Cheers,
Esteban

El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:

Hi Mariano,

On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).

John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.

HTH
Eliot

Thanks in advance,

Mariano




--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Mariano Martinez Peck
In reply to this post by EstebanLM
 
Thanks Eliot. I did your idea and I could make progress. Then I have the errors that John said...so I am trying to compile the StackVM. Now, the error I have is:


Build Croquet of project CoreVM with configuration Development

Ld build/Development/Croquet.app/Contents/MacOS/Croquet normal i386
cd /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -F/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -filelist /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/Croquet.LinkFileList -mmacosx-version-min=10.5 -framework CoreFoundation -framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Foundation -framework SystemConfiguration -framework AppKit -prebind -o /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development/Croquet.app/Contents/MacOS/Croquet

ld: duplicate symbol _warning in /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/interp.o and /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/gcc3x-interp.o
collect2: ld returned 1 exit status
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1


I don't understand if the error is the "duplicate symbol _warning " or if there is really another error (I am a C newbie). 

thanks in advance for any help

Mariano

On Fri, Dec 10, 2010 at 7:11 PM, Esteban Lorenzano <[hidden email]> wrote:
 
Hi,
Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)

Cheers,
Esteban

El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:

Hi Mariano,

On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).

John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.

HTH
Eliot

Thanks in advance,

Mariano





Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Igor Stasenko

On 12 December 2010 13:27, Mariano Martinez Peck <[hidden email]> wrote:

>
> Thanks Eliot. I did your idea and I could make progress. Then I have the errors that John said...so I am trying to compile the StackVM. Now, the error I have is:
>
>
> Build Croquet of project CoreVM with configuration Development
>
> Ld build/Development/Croquet.app/Contents/MacOS/Croquet normal i386
> cd /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM
> setenv MACOSX_DEPLOYMENT_TARGET 10.5
> /Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -F/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -filelist /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/Croquet.LinkFileList -mmacosx-version-min=10.5 -framework CoreFoundation -framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Foundation -framework SystemConfiguration -framework AppKit -prebind -o /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development/Croquet.app/Contents/MacOS/Croquet
>
> ld: duplicate symbol _warning in /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/interp.o and /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/gcc3x-interp.o
> collect2: ld returned 1 exit status
> Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
>

it looks like there are some error in configuration, because linker
tries to link interp.o and gcc3x-interp.o
which are the same interpreter code, except that gcc3x-interp is
modified a little through 'gnuification' step.
Normally, for building VM with GCC you should use only gcc3x one, and
if you dare to build VM with another compiler,
use interp.o instead.

>
> I don't understand if the error is the "duplicate symbol _warning " or if there is really another error (I am a C newbie).
>

a duplicate symbol means that same symbol (function or variable name)
are defined (do not mix with declared) in two or more object files at
global scope.
So, when linker tries to link them together into a single binary file,
it has a collision.


> thanks in advance for any help
>
> Mariano
>
> On Fri, Dec 10, 2010 at 7:11 PM, Esteban Lorenzano <[hidden email]> wrote:
>>
>>
>> Hi,
>> Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)
>> Cheers,
>> Esteban
>>
>> El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:
>>
>> Hi Mariano,
>>
>> On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
>>>
>>>
>>> Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...
>>>
>>> So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.
>>>
>>> My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?
>>
>> Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).
>> John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.
>> HTH
>> Eliot
>>>
>>> Thanks in advance,
>>>
>>> Mariano
>>>
>>
>>
>>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Mariano Martinez Peck
 


On Sun, Dec 12, 2010 at 2:18 PM, Igor Stasenko <[hidden email]> wrote:

On 12 December 2010 13:27, Mariano Martinez Peck <[hidden email]> wrote:
>
> Thanks Eliot. I did your idea and I could make progress. Then I have the errors that John said...so I am trying to compile the StackVM. Now, the error I have is:
>
>
> Build Croquet of project CoreVM with configuration Development
>
> Ld build/Development/Croquet.app/Contents/MacOS/Croquet normal i386
> cd /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM
> setenv MACOSX_DEPLOYMENT_TARGET 10.5
> /Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -F/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -filelist /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/Croquet.LinkFileList -mmacosx-version-min=10.5 -framework CoreFoundation -framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Foundation -framework SystemConfiguration -framework AppKit -prebind -o /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development/Croquet.app/Contents/MacOS/Croquet
>
> ld: duplicate symbol _warning in /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/interp.o and /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/gcc3x-interp.o
> collect2: ld returned 1 exit status
> Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
>

it looks like there are some error in configuration, because linker
tries to link interp.o and gcc3x-interp.o
which are the same interpreter code, except that gcc3x-interp is
modified a little through 'gnuification' step.
Normally, for building VM with GCC you should use only gcc3x one, and
if you dare to build VM with another compiler,
use interp.o instead.


Thanks for the explanation Igor. I tried now to exlcude gcc3x-inter.c and use interp.c or vice-versa, but in any case I have the error:


Build Croquet of project CoreVM with configuration Development

Ld build/Development/Croquet.app/Contents/MacOS/Croquet normal i386
cd /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -F/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -filelist /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/Croquet.LinkFileList -mmacosx-version-min=10.5 -framework CoreFoundation -framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Foundation -framework SystemConfiguration -framework AppKit -prebind -o /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development/Croquet.app/Contents/MacOS/Croquet

Undefined symbols:
  "_dumpPrimTraceLog", referenced from:
      _error in sqMacMain.o
ld: symbol(s) not found
collect2: ld returned 1 exit status



So....I will continue trying to see what the problem is.
 
>
> I don't understand if the error is the "duplicate symbol _warning " or if there is really another error (I am a C newbie).
>

a duplicate symbol means that same symbol (function or variable name)
are defined (do not mix with declared) in two or more object files at
global scope.
So, when linker tries to link them together into a single binary file,
it has a collision.



excelent. Thanks for the explanations :)
 

> thanks in advance for any help
>
> Mariano
>
> On Fri, Dec 10, 2010 at 7:11 PM, Esteban Lorenzano <[hidden email]> wrote:
>>
>>
>> Hi,
>> Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)
>> Cheers,
>> Esteban
>>
>> El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:
>>
>> Hi Mariano,
>>
>> On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
>>>
>>>
>>> Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...
>>>
>>> So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.
>>>
>>> My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?
>>
>> Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).
>> John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.
>> HTH
>> Eliot
>>>
>>> Thanks in advance,
>>>
>>> Mariano
>>>
>>
>>
>>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Igor Stasenko

On 12 December 2010 14:49, Mariano Martinez Peck <[hidden email]> wrote:

>
>
>
> On Sun, Dec 12, 2010 at 2:18 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> On 12 December 2010 13:27, Mariano Martinez Peck <[hidden email]> wrote:
>> >
>> > Thanks Eliot. I did your idea and I could make progress. Then I have the errors that John said...so I am trying to compile the StackVM. Now, the error I have is:
>> >
>> >
>> > Build Croquet of project CoreVM with configuration Development
>> >
>> > Ld build/Development/Croquet.app/Contents/MacOS/Croquet normal i386
>> > cd /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM
>> > setenv MACOSX_DEPLOYMENT_TARGET 10.5
>> > /Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -F/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -filelist /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/Croquet.LinkFileList -mmacosx-version-min=10.5 -framework CoreFoundation -framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Foundation -framework SystemConfiguration -framework AppKit -prebind -o /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development/Croquet.app/Contents/MacOS/Croquet
>> >
>> > ld: duplicate symbol _warning in /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/interp.o and /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/gcc3x-interp.o
>> > collect2: ld returned 1 exit status
>> > Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
>> >
>>
>> it looks like there are some error in configuration, because linker
>> tries to link interp.o and gcc3x-interp.o
>> which are the same interpreter code, except that gcc3x-interp is
>> modified a little through 'gnuification' step.
>> Normally, for building VM with GCC you should use only gcc3x one, and
>> if you dare to build VM with another compiler,
>> use interp.o instead.
>>
>
> Thanks for the explanation Igor. I tried now to exlcude gcc3x-inter.c and use interp.c or vice-versa, but in any case I have the error:
>
>
> Build Croquet of project CoreVM with configuration Development
>
> Ld build/Development/Croquet.app/Contents/MacOS/Croquet normal i386
> cd /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM
> setenv MACOSX_DEPLOYMENT_TARGET 10.5
> /Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -F/Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development -filelist /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/CoreVM.build/Development/Croquet.build/Objects-normal/i386/Croquet.LinkFileList -mmacosx-version-min=10.5 -framework CoreFoundation -framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Foundation -framework SystemConfiguration -framework AppKit -prebind -o /Users/mariano/PhD/Marea/usedBit/CogVM/Cog/macbuildStackVM/build/Development/Croquet.app/Contents/MacOS/Croquet
>
> Undefined symbols:
>   "_dumpPrimTraceLog", referenced from:
>       _error in sqMacMain.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
>
oh.. this method is defined in CoInterpreter, but not in StackInterpreter.

So, you can fix that in two ways:
- add empty dumpPrimTraceLog  for StackInterpreter. Like follwoing:
dumpPrimTraceLog
        "The prim trace log is a circular buffer of entries. If there is
         an entry at primTraceLogIndex \\ PrimTraceLogSize it has entries.
         If there is something at primTraceLogIndex it has wrapped."
        <api>
        <inline: false>
  "do nothing"

or, in
sqMacMain.c
use #ifdefs and detect if you building coInterpreter or stack
interpreter , in order to avoid using this function, because its not
available  in StackInterpreter.

I think best would be to simply add it to StackInterpreter and don't
mess with C code.


>
> So....I will continue trying to see what the problem is.
>
>>
--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

johnmci
In reply to this post by Mariano Martinez Peck
 
mmmm 
SqueakPureObjcCogVM.xcodeproj
pick 
SqueakNoOGLIPhone

done? 
Well not quite, just need the image side changes for image open/read to build the proper interp.c 


On 2010-12-12, at 4:27 AM, Mariano Martinez Peck wrote:

Thanks Eliot. I did your idea and I could make progress. Then I have the errors that John said...so I am trying to compile the StackVM. Now, the error I have is:

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Mariano Martinez Peck
In reply to this post by Igor Stasenko
 

> Undefined symbols:
>   "_dumpPrimTraceLog", referenced from:
>       _error in sqMacMain.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
>
oh.. this method is defined in CoInterpreter, but not in StackInterpreter.

So, you can fix that in two ways:
- add empty dumpPrimTraceLog  for StackInterpreter. Like follwoing:
dumpPrimTraceLog
       "The prim trace log is a circular buffer of entries. If there is
        an entry at primTraceLogIndex \\ PrimTraceLogSize it has entries.
        If there is something at primTraceLogIndex it has wrapped."
       <api>
       <inline: false>
 "do nothing"


Thanks Igor. This did the trick :)
Now it compiles and I can even start an image!
 

or, in
sqMacMain.c
use #ifdefs and detect if you building coInterpreter or stack
interpreter , in order to avoid using this function, because its not
available  in StackInterpreter.

I think best would be to simply add it to StackInterpreter and don't
mess with C code.


>
> So....I will continue trying to see what the problem is.
>
>>
--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

Mariano Martinez Peck
In reply to this post by johnmci
 


On Fri, Dec 10, 2010 at 8:57 PM, John M McIntosh <[hidden email]> wrote:
 
There are some changes that are not integrated. 

readImageFromFileHeapSizeStartingAt
sqAllocateMemory
sqImageFileRead

See the Squeak VMMaker source for the change sets needed to alter the header for readImageFromFileHeapSizeStartingAt
and the new logic for sqAllocateMemory & sqImageFileRead that let's you mmap the image file in sqAllocateMemory and not assume you'll read the entire file into memory in sqImageFileRead


Hi John. Where are exactly these changes you are talking about (sqAllocateMemory & sqImageFileRead )

thanks in advance,

Mariano
 

On 2010-12-10, at 10:11 AM, Esteban Lorenzano wrote:

Hi,
Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)

Cheers,
Esteban

El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:

Hi Mariano,

On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).

John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.

HTH
Eliot

Thanks in advance,

Mariano




--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to compile StackVM from XCode?

johnmci
 
 VMMaker-dtl.109  for the image read/alloc changes

I've also  attached the iPhone changes to allow the VM to pass up objects versus integers in the primitiveGetNextEvent


On 2010-12-17, at 2:29 AM, Mariano Martinez Peck wrote:



On Fri, Dec 10, 2010 at 8:57 PM, John M McIntosh <[hidden email]> wrote:
 
There are some changes that are not integrated. 

readImageFromFileHeapSizeStartingAt
sqAllocateMemory
sqImageFileRead

See the Squeak VMMaker source for the change sets needed to alter the header for readImageFromFileHeapSizeStartingAt
and the new logic for sqAllocateMemory & sqImageFileRead that let's you mmap the image file in sqAllocateMemory and not assume you'll read the entire file into memory in sqImageFileRead


Hi John. Where are exactly these changes you are talking about (sqAllocateMemory & sqImageFileRead )

thanks in advance,

Mariano
 

On 2010-12-10, at 10:11 AM, Esteban Lorenzano wrote:

Hi,
Yep, the iOS StackVM is on the trunk, but still not compiling out of the box (at least for me...). I'm working on that now :)

Cheers,
Esteban

El 10/12/2010, a las 2:49p.m., Eliot Miranda escribió:

Hi Mariano,

On Fri, Dec 10, 2010 at 6:57 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi eliot. I am using CoreVM.xcodeproj  to compile a CogVM. I have integrated several of my own changes that I used to have in standard vm into cog...As expected, I have several errors/crash and so I thought that a first step would be to make it work with StackVM and then in Cog...

So, I want to compile and debug the StackVM using XCode. I tried using the CoreVM.xcodeproj but it seems it is prepared for CogVM. For example, it expects de files cogit.c and cogit.h  althought they are not generated when creating a StackVM.

My question is, is there somewhere a .xcodeproj for the stackVM? or some option inside the CoreVM.xcodeproj   to say that I want to compile a StackVM ?

Take a copy of the macbuild directory, call it e.g. macstackbuild, and point the new CoreVM xcode project at ../stacksrc instead of ../src, and to compile gcc3x-interp.c instead of cogit.c and gcc3x-cointerp.c and you should be able to build a stack vm.  You can do this either by editing the CoreVM.xcodeproj/project.pbxproj file by hand (it has UUIDs for files so it can be tedious) or using Xcode itself (it has an arcane way of specifying include paths and #defines, so it can be tedious).

John McIntosh has already built a stackvm and is using it routinely on the iPhone.  I'm not sure if the build directory or xcode project is in svn, but knowing john it probably is.

HTH
Eliot

Thanks in advance,

Mariano




--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





JMMFixBackToTrunk.1.cs (4K) Download Attachment