[Vm-dev] Gnuification fails when compiling unix VM with latest VMMaker source

Adrian Lienhard adi at netstyle.ch
Mon Mar 8 17:55:03 UTC 2010

Thanks for the advice, David.

I finally managed to get back to this issue. Sorry for the late reply... I figured out what the problem with the gnuification is (in case somebody runs into the same problems):

The first problem I had was that gawk didn't properly work because I generated the C sources with VMMaker running on a unix VM that was set to MacRoman encoding and hence the interp.c had wrong linefeeds. Generating the sources from a Mac VM solved that problem.

The second issue was that the gawk output didn't compile because the jump table macros were all like "CASE(0)", i.e., the argument was not incremented. In cmake/gnuify.awk I commented out the line
	print "	CASE(" (($NF) + 0) ")";
and commented in the line
	print "	CASE(" $3 ")";
This solved the problem. Not sure why $NF doesn't work, though. Does this ring any bells? Apparently somebody else has had a problem with this since the code that works for me is already there but commented out.


PS: I used r2151 and VMMaker-dtl.159

On Jan 26, 2010, at 13:26 , David T. Lewis wrote:

> On Tue, Jan 26, 2010 at 12:07:54PM +0100, Adrian Lienhard wrote:
>> Hi all,
>> I'm trying to build a unix VM (on OSX) with the latest trunk (r2148) and the latest VMMaker version (VMMaker-dtl.156) but apparently the gnuification fails:
>> [ 80%] Building C object CMakeFiles/squeakvm.dir/gnu-interp.c.o
>> /Users/adrian/Desktop/vmbuilding/platforms/build/gnu-interp.c:6:2: error: #error GNUIFICATION FAILED ( 0 )
>> make[2]: *** [CMakeFiles/squeakvm.dir/gnu-interp.c.o] Error 1
>> make[1]: *** [CMakeFiles/squeakvm.dir/all] Error 2
>> make: *** [all] Error 2
>> When compiling with r2135, in which no gnuification is done, it works. From the above error output I have no clue as to what went wrong.
>> To narrow down the problem I went to http://www.squeakvm.org/unix/ and downloaded the VMMaker image that Ian uses for the unix builds. I can compile with the cmake configuration of r2148 and the source that this VMM produces. So I assume there is a source change in VMMaker-dtl.156 that is not compatible with gnuification. The only question is, which one? The VMM version found in this image is VMMaker-tpr.58 (this version is many years old!) with lots of uncommitted changes. Diffing against VMMaker-dtl.156 I get tons of changed methods so I'm kind of lost here too. Why is the maintained VMMaker package not used for unix VMs?
>> The following benchmarks show that gnuification makes a significant difference (MacBook Pro with 2.4Ghz, i686-apple-darwin10-gcc-4.2.1):
>> 1 pre-compiled VM [1]:		'248543689 bytecodes/sec; 8117987 sends/sec'
>> 2 compiled from source r2135 			'411244979 bytecodes/sec; 10560900 sends/sec'
>> 3 VMMaker-dtl.156 compiled with cmake r2135:	'313533374 bytecodes/sec; 11534330 sends/sec'
>> 4 compiled from source r2148			'487619047 bytecodes/sec; 13257851 sends/sec'
>> 5 provided VMMaker image [2] with r2148		'493256262 bytecodes/sec; 13200950 sends/sec'
>> 6 VMMaker-dtl.156 compiled with r2148		??? cannot compile...
>> [1] http://www.squeakvm.org/unix/release/Squeak-
>> [2] http://www.squeakvm.org/unix/release/unix-
>> 1, 2, and 3 are compiled with the configuration of cmake from trunk revision 2135, hence without gnuification. 4 and 5 probably are from identical source: 4 from the svn trunk, the other, 5, generated through the VMM image provided by Ian.
>> Any help to make 6 work is very welcome!
> Hi Adrian,
> There is one issue with VMMaker-dtl.156 that I need to make you aware of.
> It is temporarily out of sync with the Subversion sources, as we are in
> the process of applying some patches to make SoundPlugin work on 64 bit
> platforms.  You can back up to version VMMaker-dtl.155 if this is an issue.
> I did not look at the image that you downloaded, but Ian definitely uses up
> to date VMMaker versions, and VMMaker-tpr.58 is (as you noticed) very ancient.
> So there must be some confusion here (I don't have time to check right now).
> I don't have a Mac to check, but AFAIK the unix build should work fine on OS X.
> A couple of things to double check:
> - Make sure that you are using platforms/unix/cmake/configure, and not the
> older platforms/unix/config/configure. I think there may be some documentation
> issues here. The older configure no longer works, and might result in the
> kind of problem you are seeing.
> - Do the configure/make from a completely empty build directory. I'm not sure
> that cmake figures out all of the dependencies properly, and I've found
> that cleaning out the build directory and starting over is sometimes necessary.
> - When you run configure, make sure that it specifies the correct source
> directory. By default it will try to find the source files in platforms/unix/src
> which is not what you want if you are building an up to date VM (I always
> generate sources to a ../src32 directory outside of the ../platforms code).
> Use the --src flag to specify source directory, and also look at the output
> of "../platforms/unix/cmake/configure --help" for other options.
> HTH,
> Dave

More information about the Vm-dev mailing list