[lttng-dev] [UST PATCH] Add a multi-thread version of the 'hello' test program

Alexandre Montplaisir alexmonthy at voxpopuli.im
Tue Jun 26 03:11:30 EDT 2012

On 12-06-26 02:03 AM, Mathieu Desnoyers wrote:
> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote:
>> [...]
>> diff --git a/tests/hello-mt/README b/tests/hello-mt/README
>> new file mode 100644
>> index 0000000..0584dca
>> --- /dev/null
>> +++ b/tests/hello-mt/README
>> @@ -0,0 +1,11 @@
>> +This is a multi-threaded version of the "hello" test program. It uses OpenMP for
>> +parallelization, and as such requires at least GCC 4.2.
> Hrm. This adds a dependency on gcc 4.2. The entire project will fail to
> build because of this test on other compiler, older gcc, right ? We
> should have a configure.ac check that tests openmp availability. So I
> won't merge this for now.

Staying up late, aren't we? ;)

Oh ok, I thought we said the other day that GCC 4.2 was old enough to
not be worth testing for. In any case, here's a patch to check for
OpenMP at configure time (goes on top of the previous one).

Two caveats however:
- Since the main part of the project doesn't use OpenMP, I don't think
we want to turn the "-fopenmp" CFLAG on for the whole thing. So I just
hard-coded "-fopenmp" for this test only. I don't know if any other
compiler uses some other flag to turn on the OpenMP support, but we only
support GCC anyway, don't we?

- The autoconf macro requires Autoconf 2.62. Current Debian stable has
2.67, I don't know if it's a big problem.

Good night,

> Thanks,
> Mathieu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Only-build-the-hello-mt-test-if-OpenMP-is-available.patch
Type: text/x-patch
Size: 2182 bytes
Desc: not available
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20120626/73ad3f29/attachment.bin>

More information about the lttng-dev mailing list