[ts-gen] Unable to compile current shim version on Ubuntu
Bill Pippin
pippin at owlriver.net
Fri Nov 16 19:23:49 EST 2007
Paolo,
With respect to my post suggesting that you needed ruby, it was my pleasure.
Answering posts such as yours pays off big to us when you respond with
messages such as the following:
> Please note ruby is not mentioned at all within the "INSTALL" file
> (being a newbie to compilation I simply tried to follow it step by step)
> among the listed "Prerequisites", nor does the Makefile issue any kind
> of error message when compiling, such as: "Error: ruby not found".
First, I've updated the INSTALL file to note the dependency on Ruby. We
use continuous testing to maintain software quality, but, once past
automatically generated figures and the like, documentation quality
ultimately depends on human proofreading. Thank you very much for pointing
out the conflict.
Now, about the Makefile. Your feedback about problems with the .i -> .h
dependency was even more critical here. Although I had checked that
make stops on our system when I mispelled the interpreter name in
generation.rb, e.g.:
shim-071116$ make
make -j12 shim
make[1]: Entering directory `/home/pippin/src/shim-071116'
bin/generation.rb src/generation.i > src/generation.h
/bin/sh: bin/generation.rb: /usr/bin/rUby: bad interpreter:
No such file or directory
make[1]: *** [src/generation.h] Error 126
make[1]: Leaving directory `/home/pippin/src//shim-071116'
make: *** [all] Error 2
I did not realize that make left the incorrectly generated header file
around, so that the error message above would only occur once.
It seems that although make does discard target files on signals,
for historical reasons it leaves them alone when the generating program
fails, which is arguably wrong. There is, however, a gnu make target
DELETE_ON_ERROR to change this behavior, so the empty headers get deleted,
and I've added that to the Makefile, so that make will fail repeatedly
if your system lacks ruby.
In addition, I added additional error message text about ruby when the
script fails, the displayed line in the middle of the cruft below:
shim-071116$ make
make -j12 shim
make[1]: Entering directory `/home/pippin/src/tws/src/tsd'
/bin/sh: bin/generation.rb: /usr/bin/rUby: bad interpreter:
No such file or directory
Ruby must be installed; it's used to generate: generation.h
make[1]: *** [src/../lib/generation.h] Error 1
make[1]: *** Deleting file `src/generation.h'
make[1]: Leaving directory `/home/pippin/src//shim-071116'
make: *** [all] Error 2
The new message comes at a minor cost; for reasons having to do with
limitations in gnu make (only entire lines can be silenced, and the
choice function must be all one logical line, so that both branches of
a conditional are echoed, or not), I've silenced command echo for
header preprocessing. As a consequence, the following text no longer
appears when the command is successful:
bin/generation.rb src/generation.i > src/generation.h
In other words, no news is good news.
Thanks,
Bill
More information about the ts-general
mailing list