automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I force 'make install' to depend on 'make test'?


From: Dr. David Kirkby
Subject: Re: Can I force 'make install' to depend on 'make test'?
Date: Mon, 31 Mar 2003 01:21:05 +0100

Guido Draheim wrote:
> 
> install-data-local : check
> 
> That's the answer. In reality I have a last line in the configure.ac
> that says "echo '#' make && make check && make install" - it does
> remind a casual install-from-source guy to do a "make check" before
> going to "make install". 't works pretty well, since many do a simple
> mousing copy-n-paste of that line in the terminal. It makes that
> `make check` also optional, possibly reducing time for your own
> development cycles with the same source tree (but perhaps you current
> `make check` is quick enough to be run always). Instead I have a
> rpm spec along that uses `make check` always - the rpm build is also
> a great way to check that off-develdir builds will succeed as well.
> 
> have fun, guido
>

Thanks a lot for your advice. To date I have never used a configure.ac
file, only configure.in, but I will look at configure.ac too, as I
like your idea of reminding the user to run 'make check'.

After thinking about it a lot more, with most people on the mailing
list suggesting i should distribute the bitmaps, I decided to
distribute them, rather than build them, so there is no need to force
'make install' to be dependant on 'make check'.

Doing the above increases the package size from about 1.5 to 2.5 Mb
due to the extra bitmaps, but means that once uncompressed, the source
tree is now 190 Mb, which is considerably larger than the 5 or so Mb
before. Since the bitmaps are quite simple (see a few examples at 
http://atlc.sourceforge.net/examples.html
they compress very well, with about a 75:1 compression ratio. Still,
if the user was to do a 'make check' they would have been built
anyway, so the disk space is needed at some point. 

I've now configured 'make check' to build the bitmaps but delete them
as soon as they are confirmed to have the correct checksum. So all the
bitmaps get distributed with the package *and* all the bitmap get
built, but the built versions are quickly deleted as soon as their
checksums are confirmed to be okay. Hence the maximum disk space
needed at any one time is probably about 210 Mb or so. 

The 'make check' is quite slow, so not running it is quite attractive. 


 
> Dr. David Kirkby schrieb:
> > Ronald Landheer-Cieslak wrote:
> >
> >>Though I really don't think it's a good idea, have you tried just adding
> >>install : check to your Makefile.am?
> >>
> >
> >
> > No, I had not, I might try that - but see below.
> >
> >
> >>Anyways, the reason I don't think it's a good idea is that it will break
> >>cross-compiling, as your test programs will probably not run on the build
> >>host in that case..
> >
> >
> > Can you suggest a better way? I'm open to suggestions, as I'm not convinced 
> > my current method is optimal at all. I had not even considered 
> > cross-compilation issues.
> >
> > In fact, I would *much appreciate* any suggestions for a better method(s). 
> > I'm sure what I am trying to do is not the best way, but don't know of a 
> > better one.
> >
> > Basically I will have several source (.c) files that will create 10 
> > platform dependant binary files (executables). All except one of these 10 
> > binary files are designed to quickly produce bitmaps of simple shapes. 
> > (i.e. a circle inside a rectangle, a rectangle insider a circle ...)
> >
> > Next I want to check the 9 binaries are indeed producing the correct 
> > bitmaps, so I check the md5 checksum of the bitmaps produced by the 9 
> > binaries. So a test is basically like this (must simplified)
> >
> > create_bitmap_for_rect_in_rect foo.bmp
> > MD5SUM=`md5 foo.bmp`
> > if [ $MD5SUM != bdfb21053d9af7302bb587b1b89c113a ] ; then
> >   exit 1
> > else
> >   exit 0
> > fi
> >
> > If the md5 checksum of the bitmaps agree with what I expect, I can assume 
> > the 9 binaries are functioning properly.
> >
> > After creating the bitmaps with these 9 executables, another program (the 
> > 10th binary, called 'atlc') will run a long cpu intensive numerical 
> > simulation based on the contents of each bitmap. The output of 'atlc' 
> > consists of 6 further bitamps and a text file.
> >
> > I was expecting for the output from 10th binary (atlc) to be useful it two 
> > ways.
> >
> > 1) I can check the checkum of the output files, confirming atlc works okay.
> > 2) I can install some of the files produced by atlc, for the purpose of 
> > examples.
> >
> > Hence my dilemma. It seems sensible to me that 'make install' requires that 
> > 'make check' has already been run, but I'm open to suggestions of how to be 
> > structure this.
> >
> > Should the tests just create files, check their checksum, then remove the 
> > files? Or is it better to leave the files around, so they can be installed 
> > as examples? Since I want to install these as examples and generating them 
> > is time consuming, it seems sensible to do it only once.
> >
> > Any help appreciated.
> >

-- 
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]