Iyer, Balaji V wrote:
What I ideally wanted to do with my testsuite files was that I want
all the Cilk keywords test to compile no matter what the architecture
is, but it should only run in certain architectures where the runtime
is enabled (this is known statically and thus the testsuite doesn't
have to do anything to figure it out.). Can someone please tell me how
do I do this?
Which is a bit orthogonal to my patch, which helps that the tests pass
on systems which are supported. – Thus, let's start with the question
what do you think of that patch?
On the other hand, one could use the existence of libcilkrts* as
detected by the patch to decide whether to link or not: If the library
is there, one can link – if not found, it is unlikely to work (unless it
is, e.g. found in /usr/lib).
* * *
Regarding compile vs. run: I think one possibility would be to have no
"dg-do" in the files and simply change the default to compile or run,
depending whether the architecture is supported. On the other hand, that
can be confusing as an explicit "dg-do run" will break it on some systems.
* * *
Actually, I was wondering whether -fcilkplus should always automatically
link libcilkrts – akin to -fopenmp which links libgomp. Currently, one
has to specify it manually.*
Or are the features which do not need libcilkplus common enough that one
doesn't always want to link it?
[For OpenMP, GCC will have -fopenmp-simd [patch posted, 1], which
doesn't link libgomp. I could imagine that one would like to have Cilk
Plus' "#pragma simd" and the array syntax without enabling threads
(cilk_sync, cilk_spawn, cilk_for, reducers – and thus libcilkrts linkage).]
Tobias
* libgomp is handled via spec files – including one which adds "librt"
when libgomp is linked.
[1] -fopenmp-simd: http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02275.html