[Vm-dev] Cog on linux

Eliot Miranda eliot.miranda at gmail.com
Thu Jul 15 18:52:22 UTC 2010


On Thu, Jul 15, 2010 at 5:57 AM, Rob Withers <reefedjib at yahoo.com> wrote:

>
> Linux version 2.6.33-5.19.BHsmp (kernel at bluehost.com) (gcc version 4.1.2
> 2008070                           4 (Red Hat 4.1.2-48))
>
> I have attached the error from make install...
>
> /home1/vawhigso/public_html/squeakelib/Cog/platforms/unix/vm/sqUnixHeartbeat.c:161:3:
> error: #error "no high res clock defined"
>

If you look at the code the error is pointing you at:

#if defined(__GNUC__) && ( defined(i386) || defined(__i386) ||
defined(__i386__)  \
            || defined(i486) || defined(__i486) || defined (__i486__) \
            || defined(intel) || defined(x86) || defined(i86pc) )
    __asm__ __volatile__ ("rdtsc" : "=A"(value));
#else
# error "no high res clock defined"
#endif

you'll see the system expects an x86.  Are you on an x86-64?  If so you need
to specify something like -m32 in the CFLAGS and/or supply a flag with te
same semantics to configure.


HTH
Eliot


> Rob
>
>
>
> --------------------------------------------------
> From: "Frank Shearar" <frank.shearar at angband.za.org>
> Sent: Thursday, July 15, 2010 8:30 AM
> To: <vm-dev at lists.squeakfoundation.org>
> Subject: Cog on FreeBSD (Re: [Vm-dev] Re: [squeak-dev] Re: Cog on linux)
>
>
>>
>
>
>  On 2010/07/14 23:29, Levente Uzonyi wrote:
>>
>>>
>>> On Wed, 14 Jul 2010, Frank Shearar wrote:
>>>
>>>  On 2010/07/13 23:04, Levente Uzonyi wrote:
>>>>
>>>>> On Tue, 13 Jul 2010, Rob Withers wrote:
>>>>>
>>>>>  Thanks Levente. Unfortunately it did not work:
>>>>>>
>>>>>> ./lib/squeak/3.9-7/squeak: /lib/libc.so.6: version `GLIBC_2.11' not
>>>>>> found (required by ./lib/squeak/3.9-7/squeak)
>>>>>>
>>>>>
>>>>> Seems like you have to build it yourself. Fortunately it's very easy,
>>>>> since Eliot commits the generated sources to the svn repo. So you can
>>>>> build a CogVM/StackVM without VMMaker. Here is how:
>>>>>
>>>>> "How to build the Cog Croquet VM on Unix
>>>>> -------------------------------
>>>>> 1. Install the tools (gcc, X11-devel, etc (e.g. libpng, libX11 & libxt
>>>>> source))
>>>>> 2. Check out the following sources from svn (if you haven't already -
>>>>> if
>>>>> you're
>>>>> reading this in unixbuild its likely you've already got the sources)
>>>>> svn co http://www.squeakvm.org/svn/squeak/branches/Cog/platforms
>>>>> svn co http://www.squeakvm.org/svn/squeak/branches/Cog/src
>>>>> svn co http://www.squeakvm.org/svn/squeak/branches/Cog/unixbuild
>>>>> 3. Open a shell, cd into the unixbuild/bld directory and execute
>>>>> ../../platforms/unix/config/configure CFLAGS="-g -O2 -msse2
>>>>> -D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1
>>>>> -DCOGMTVM=0" LIBS=-lpthread
>>>>> make install prefix=WhereYouWantTheVmToGo
>>>>> 4. At the end of it you'll get a new VM in the path provided via
>>>>> -prefix"
>>>>>
>>>>
>>>> Are there any additional requirements like gcc version, for instance?
>>>>
>>>> I ask because I get errors on the above instructions, on FreeBSD 6.4,
>>>> running gcc 3.4.6. I can attach configure's output and whatnot, if
>>>> you're interested.
>>>>
>>>
>>> If configure failed, then please attach the output and continue this
>>> thread on the vm-dev list.
>>>
>>
>> I didn't expect the instructions to work, since FreeBSD isn't Linux. So
>> having said that, I've attached the output from configure (which looks
>> fine, to my untrained eye) and the output from make install (which
>> generates errors).
>>
>> That first error:
>>
>> In file included from /usr/home/frank/temp/src/vm/gcc3x-cointerp.c:21:
>> /usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced
>> by <stdlib.h>"
>>
>> is probably the culprit, I suppose?
>>
>> frank
>>
>>
>>>
>>> Levente
>>>
>>>
>>>> frank
>>>>
>>>>  Levente
>>>>>
>>>>>
>>>>>> Rob
>>>>>>
>>>>>>
>>>>>>
>>>>>> ________________________________
>>>>>> From: Levente Uzonyi <leves at elte.hu>
>>>>>> To: The general-purpose Squeak developers list
>>>>>> <squeak-dev at lists.squeakfoundation.org>
>>>>>> Sent: Tue, July 13, 2010 3:21:43 PM
>>>>>> Subject: Re: Cog on linux (was: Re: [squeak-dev] Re: UI lockup in
>>>>>> Squeak 4.1)
>>>>>>
>>>>>> On Tue, 13 Jul 2010, Rob Withers wrote:
>>>>>>
>>>>>>  --------------------------------------------------
>>>>>>> From: "Levente Uzonyi" <leves at elte.hu>
>>>>>>> Sent: Tuesday, July 13, 2010 12:46 PM
>>>>>>> To: "The general-purpose Squeak developers list"
>>>>>>> <squeak-dev at lists.squeakfoundation.org>
>>>>>>> Subject: Cog on linux (was: Re: [squeak-dev] Re: UI lockup in Squeak
>>>>>>> 4.1)
>>>>>>>
>>>>>>>  On Tue, 13 Jul 2010, Rob Withers wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> --------------------------------------------------
>>>>>>>>> From: "Andreas Raab" <andreas.raab at gmx.de>
>>>>>>>>> Sent: Tuesday, July 13, 2010 11:29 AM
>>>>>>>>> To: "The general-purpose Squeak developers list"
>>>>>>>>> <squeak-dev at lists.squeakfoundation.org>
>>>>>>>>> Subject: [squeak-dev] Re: UI lockup in Squeak 4.1
>>>>>>>>>
>>>>>>>>>  On 7/13/2010 6:39 AM, Rob Withers wrote:
>>>>>>>>>>
>>>>>>>>>>> The low-space watcher is running, at least before the problem
>>>>>>>>>>> starts. I
>>>>>>>>>>> do eventually run out of memory, but the uninterruptable state
>>>>>>>>>>> happens
>>>>>>>>>>> before this.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> In which case you want to do the following:
>>>>>>>>>> * Launch your app and wait until it's in the "growing state"
>>>>>>>>>> * Hit F2 and from the VM's preference menu choose "Debug" and then
>>>>>>>>>> "Print all processes"
>>>>>>>>>>
>>>>>>>>>> This will dump a list of all the call stacks of all processes. One
>>>>>>>>>> of them is the culprit consuming memory and you'll probably be
>>>>>>>>>> able to tell quickly from just looking at it (if not, you can
>>>>>>>>>> email the output here but it typically takes a domain expert to
>>>>>>>>>> understand what's going wrong).
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> Thanks for this pointer, Andreas.
>>>>>>>>>
>>>>>>>>> This time it was a Cog VM which spasmed, which I use for my client
>>>>>>>>> (Squeak 4.1 for server for use with linux vm - I have no ability to
>>>>>>>>> compile a linux Cog vm: would love if someone posted one that could
>>>>>>>>> be launched headless for my webhost).
>>>>>>>>>
>>>>>>>>
>>>>>>>> Cog works, but i think you're trying to use the -headless switch,
>>>>>>>> which (is deprecated) and tells the vm to use the X11 display, but
>>>>>>>> with no window. Servers usually don't have X11, so it won't work.
>>>>>>>> You better use -vm-display-null (and -vm-sound-null). Try squeak
>>>>>>>> --help for further useful options (like tuning Cog).
>>>>>>>>
>>>>>>>>
>>>>>>> I am trying to use the -headless switch. Good to know it is
>>>>>>> deprecated. So you happen to have a Cog for linux binary (version 17
>>>>>>> - 20), which I could use?
>>>>>>>
>>>>>>
>>>>>> I have one, but I'm not sure it will work on your server. You can find
>>>>>> it here: http://leves.web.elte.hu/squeak/cog17.tar.gz . It's built on
>>>>>> ubuntu 10.04 and is optimized for core2.
>>>>>>
>>>>>>
>>>>>> Levente
>>>>>>
>>>>>>
>>>>>>> Thanks,
>>>>>>> Rob
>>>>>>>
>>>>>>>
>>>>>>>> Levente
>>>>>>>>
>>>>>>>>
>>>>>>>>> It started running at 100% and I did your F2 -> Debug Options ->
>>>>>>>>> Print all processes. It started dumping a LOT to the Debug Console,
>>>>>>>>> then it froze, still at 100%, but no increase in memory now and it
>>>>>>>>> went (Not Responding) and greyed out the window.
>>>>>>>>>
>>>>>>>>> Luckily, I was able to see enough of the stack that was causing
>>>>>>>>> problems. It is infinitely looping in this method:
>>>>>>>>>
>>>>>>>>> LanguageEnvironment class>>#localeID: localeID
>>>>>>>>> ^self knownEnvironments at: localeID ifAbsent: [self localeID:
>>>>>>>>> (LocaleID isoLanguage: 'en')]
>>>>>>>>>
>>>>>>>>> This has nothing to do with my code, except I must be calling
>>>>>>>>> something that enters this loop. It happens in both Cog (Windows)
>>>>>>>>> and Squeak4.1 (Linux <headless> and Windows).
>>>>>>>>>
>>>>>>>>> Not sure how to fix this.
>>>>>>>>>
>>>>>>>>> Rob
>>>>>>>>>
>>>>>>>>>  Cheers,
>>>>>>>>>> - Andreas
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100715/3c43fab7/attachment-0001.htm


More information about the Vm-dev mailing list