On Fri, 2 Jun 2023 at 12:30, Jonathan Wakely <jwak...@redhat.com> wrote:

>
>
> On Fri, 2 Jun 2023 at 10:47, François Dumont <frs.dum...@gmail.com> wrote:
>
>> Ok, push done.
>>
>
> Thanks.
>
>
>> Even after full rebuild those tests are still UNRESOLVED on my system.
>>
> What is the error in the log?
>
> What is your system? How and where did you install "OMP"?
>
> Does the libgomp directory exist in the GCC build tree, at the same level
> as libstdc++-v3?
>
> e.g. in $objdir/x86_64-pc-linux-gnu/libgomp or equivalent?
>
> That directory should contain omp.h and .libs/libgomp.* which will be used
> by the libstdc++ testsuite for the check-parallel target (see the
> libgomp_flags variable which sets the paths to find libgomp in the build
> tree).
>
> But because that test only runs for normal mode (not parallel mode) it
> doesn't use libgomp_flags, and so it will only find omp.h if it already
> exists in the compiler's default include paths, which will happen if you've
> already run "make install" on the GCC built with libgomp enabled.
>
> If you haven't enabled libgomp, or you haven't installed the new GCC yet,
> then the __has_include(<omp.h>) should fail, and so the test does nothing
> and so should just PASS. If it's UNRESOLVED for you then that implies it's
> finding an <omp.h> header, but probably not the one from GCC, so it fails
> to compile. I think that's due to how you've installed "OMP" (whatever that
> means ... I don't think you've installed libgomp and so I don't think you
> should have done that ... maybe you installed Clang's libomp headers
> instead and GCC is finding those somehow?)
>

Since we already have dg-require-parallel-mode that is used for most
parallel mode tests, I don't think it's worth adding a new "openmp"
effective-target just for these three tests. But it would be helpful if I
added this comment to them instead:

--- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
@@ -19,6 +19,12 @@
// { dg-do compile { target c++14 } }
// { dg-require-normal-mode "" }

+// In order to improve coverage this test is run by the normal 'make check'
+// target, not only the infrequently-tested check-parallel target. That
means
+// the makefile variable $(libgomp_flags) is not used, so the libgomp files
+// in the build tree will not be found. The parallel mode headers will only
+// be able to include <omp.h> if libgomp has already been installed to the
+// $prefix of the GCC being tested, so use __has_include to fail
gracefully.
#if __has_include(<omp.h>)
# define _GLIBCXX_PARALLEL 1
# include <bits/extc++.h>

Or we could just remove those tests and ensure that somebody runs 'make
check-parallel' at least once every six months.

N.B. running 'make check-parallel' would have found the problem with the
missing #include in <parallel/algobase.h>, even without an installed
libgomp.

Reply via email to