Qhull and scripts/geometry
Jaroslav Hajek
highegg at gmail.com
Tue Feb 3 02:05:00 CST 2009
On Wed, Jan 21, 2009 at 11:35 PM, Petr Mikulik <mikulik at physics.muni.cz> wrote:
> On Tue, 20 Jan 2009, John W. Eaton wrote:
>
>> On 20-Jan-2009, Petr Mikulik wrote:
>>
>> | Yes; configuring Qhull with
>> | CFLAGS="-fno-strict-aliasing -O2" ./configure $*
>> | does not crash the testing command
>> | rbox c D3 | qconvex s G
>> |
>> |
>> | Could Octave's ./configure test the Qhull library? I propose that if the
>> | above test command (or some C++ source test case) crashes, then Octave does
>> | not link to Qhull library and writes a hint like
>> | Crashing Qhull found; please recompile the Qhull library by
>> | CFLAGS="-fno-strict-aliasing -O2" ./configure; make
>>
>> Can you provide an autoconf macro that does the test and does not
>> require an external program? My Debian sysstem has the library but
>> the test programs are not installed.
>>
>> There is also the issue that running test programs limits the
>> usefulness of configure scripts when cross-compiling. In this case, I
>> guess we would just have to assume that the library works when cross
>> compiling.
>
> I've prepared the shortest code that leads to crash if the Qhull library has
> been compiled without the appropriate CFLAGS.
>
> Usage:
> gcc -o QhullCrashTest QhullCrashTest.c -lqhull -lm
> echo "2 4 -0.5 -0.5 -0.5 0.5 0.5 -0.5 0.5 0.5" | ./QhullCrashTest
>
> If it crashes, nothing is written on stdout.
> If it does not crash, an "OK message" is written on stdout.
>
> Could this testing program be used in the Octave configure?
> I don't know how to write an autoconf macro for it.
>
Hi Petr,
I'll take care of the inclusion into configure. However, for best
suitability for autoconf macros (AC_RUN_IFELSE), please modify the
test program in the following manner:
1. make the inputs part of the source
2. indicate success by returning exit code zero. If you can do it, to
make the test more complete, I suggest also to check the results for
correctness (if a crash doesn't happen on some system, but instead
incorrect results are produced).
cheers
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
More information about the Bug-octave
mailing list