Building cavestats

Wookey wookey at wookware.org
Thu Feb 3 15:12:00 GMT 2011


The CUCC website uses a C program called cavestats, which is a hacked
version of 3dtopos, written by dave loeffler I think. 

It's attached.

The existence of this (and the use of dump3d) has made the transfer of
the website to a new server rather harder, and effectively held it in
limbo for 18 months whilst someone (me) waited for a tuit.

Said tuit arrived last night but it was all a bit hacktastic and I'd
like to see if we can arrange a better solution.

The problem is that these progs are binaries and thus need to be built
for the architecture of the server machines, and they need to beuilt
against survex headers and .o files. Building cavestats and
dump3d requires approximately these actions:


apt-get source survex
sudo apt-get build-dep survex
pushd
cp cavestats.c survex-*/src
cd survex-*
dpkg-buildpackage
cd src
gcc -DHAVE_CONFIG_H -I. -I.. -DIMG_HOSTED   -Wall -W -Wunused -Wshadow
-Wpointer-arith      -Wmissing-prototypes -Wwrite-strings
-Wredundant-decls -Wnested-externs      -Wcast-align -g -O2 -O2 -MT
3dtopos.o -MD -MP namecmp.o img.o useful.o cmdline.o message.o
filename.o osdepend.o z_getopt.o getopt1.o -o cavestats cavestats.c -lm
cp cavestats <website>/noinfo/

to get dump3d also needs a 
cd survex-*
make dump3d
cp dump3d <website>/noinfo/prospecting_guide_scripts/

That needs sudo on the server which may not be forthcoming, and you
don't really want wxgtk-dev onthe server anyway (obviously it can be
tidied after the build, along with the survex sources). In fact doing
the build on my home amd64 machine and copying the binary over worked
OK, despite the server being lenny and my machine being squeeze, but
this is not guaranteed to work.

Solutions to this are either a) provide a survex-dev package which
install a library and headers such programs can use. (does the survex
build already have provision for making an img library?)

b) incorporate cavestats functionality and the dump3d binary into the
normal survex build (or another survex-utils package). So it can just
be installed.

I started looking at this in more detail but realised it was going to
take me a long time to sort and I _really_ needed to just make the
website work. It took about 4hrs last night to get it all going (there
was other breakage too). I didn't do that 18months ago in the belief
that it would be better to do it properly by sorting out a -dev
package, but I don't seem to have done that in the meantime, hence
this mail to see if we can make this more tractable in future.

If you want to look at how the progs are used in context it's here:
hg clone|pull ssh://expo@seagrass.goatchurch.org.uk/expoweb 

Makefile at top level, scripts mostly under noinfo dir. 

I think the -dev solution is actually quite straightforward 9(and may
well benfit other apps like therion too?), but it may be just as
simple to incorporate this code. I'm not quite sure if it something
others would find useful or it really is special-case hackery for
CUCC's website. 

Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/


More information about the Survex mailing list