testsuite script error

Hi all

After fetching the latest version of the library from here:

origin http://llvm.org/git/openmp.git (fetch)

I started seeing the following error when I run “make ctest” in the testsuite directory:

Testing for “has_openmp”:
Generating sources …Could not open the sourcefile for the main program ompts_standaloneProc.c at ./template_parser_c.pl line 51.
Could not open the sourcefile for the main program ompts_standaloneProc.c at ./template_parser_c.pl line 51.
ERROR: Generation of sourcecode for the test failed.
ERROR: Generation of sourcecode for the crosstest failed.
… failed

for all tests. This happens equally on an Intel machine and a PCC64LE one.

What am I doing wrong?

Thanks

– Carlo

Hi Carlo

If you could simply use ‘make test’ from openmp/runtime folder, that is all that is needed.

Sorry if the 2 READMEs are creating a confusion.

Please drop us a note, if you have further issues.

Thanks
Sunita
P.S: Copied is our Ph.D. student here at UH.

Hi

Thanks for the quick answer.

Running “make test” in openmp/runtime on a x86 machine returns this error:

make[1]: *** No rule to make target /gsa/yktgsa/projects/l/llvm-coral-build/repos/ppc64le/libiomp/runtime/exports/common/include/ompt.h', needed by common’. Stop.

Still doing something wrong apparently, and I cannot figure out where that file comes from.

Thanks!

– Carlo

graycol.gifSunita Chandrasekaran —05/08/2015 03:58:04 PM—Hi Carlo If you could simply use ‘make test’ from openmp/runtime folder, that is all

That’s not a problem with the testsuite; it is a problem with our makefile. I’ll take a look at it.

– Johnny

graycol.gif

Here is the fix.

diff --git a/runtime/src/makefile.mk b/runtime/src/makefile.mk

index c3af993…8acdf44 100644

— a/runtime/src/makefile.mk

+++ b/runtime/src/makefile.mk

@@ -877,9 +877,16 @@ out_lib_files = $(addprefix $(out_lib_dir),$(lib_file) $(imp_file) $(pdb_file)

out_inc_files = $(addprefix $(out_ptf_dir)include_compat/,iomp_lib.h)

out_mod_files = \

$(addprefix $(out_ptf_dir)include/,omp_lib.mod omp_lib_kinds.mod)

+ifeq “$(OMPT_SUPPORT)” “on”

out_cmn_files = \

$(addprefix $(out_cmn_dir)include/,omp.h ompt.h omp_lib.h omp_lib.f omp_lib.f90) \

$(addprefix $(out_cmn_dir)include_compat/,iomp.h)

+else

+out_cmn_files = \

  • $(addprefix $(out_cmn_dir)include/,omp.h omp_lib.h omp_lib.f omp_lib.f90) \

  • $(addprefix $(out_cmn_dir)include_compat/,iomp.h)

+endif

graycol.gif

Hi,

This is clearly a problem, the header file should only be generated if needed
and the fix looks good (maybe just appending "ompt.h" if needed would be
enough...)

But this is only one half of the solution: The file "ompt.h.var" is missing
for OpenMP 4.1 (with CMake: make[2]: *** No rule to make target
`../src/include/41/ompt.h.var', needed by `ompt.h'. Stop.)
Could you please fix this as well?

Greets,
Jonas

I've attached a patch which I believe fixes both these issues. I have to wait till Andrey is in the office to get this committed.

-- Johnny

build_fixes.patch (24.6 KB)

Hi

After recent commits, I am now able to compile libiomp5.so and use it in the tests.
I noticed that the makefile in the runtime directory ultimately calls “make ctest” in the testsuite directory.

If I do this manually “make ctest” inside testsuite after having fixed the Makefile (again, in testuite), all selected tests are run and verified, but at the end I see this:

cd bin/; make -j
make[1]: Entering directory ‘/gsa/yktgsa-p6/05/llvm-coral-build/repos/ppc64le/libiomp/testsuite/bin’
clang -fopenmp -S -emit-llvm c/test_omp_sections_reduction.c -o c/test_omp_sections_reduction.ll
clang -fopenmp -S -emit-llvm c/orph_ctest_omp_lock.c -o c/orph_ctest_omp_lock.ll
clang -fopenmp -S -emit-llvm c/orph_ctest_omp_parallel_if.c -o c/orph_ctest_omp_parallel_if.ll

…more similar commands leading to errors…

Maybe I should not use the makefile in the testsuite directory, but apparently that is what the “make test” command does when run from the runtime directory.

Do you have any clues about the meaning of that “make -j” command? Why is it there and what is the intended for?
Maybe I am using a wrong repo for updating my local copy…

Thanks

– Carlo

graycol.gifSunita Chandrasekaran —05/08/2015 03:58:04 PM—Hi Carlo If you could simply use ‘make test’ from openmp/runtime folder, that is all

Hi Carlo,

I am responding on behalf of Sunita.

The “make test” command in the runtime folder does not only do the “make ctest”. The “make ctest” here actually tries to generate the LL files. And, these LL files are consumed afterwards by llvm-lit command to see whether the test is passed or not. So, “make test” command is not solely “make ctest” and the test part happens with another command. We did provide this rule, “make test”, to make your life easier.
The peace of code that you mentioned is actually generating the LL files.

At first, we proposed to put the testing rule (make test) in the testsuite. However, it was rejected. So, we tried to include it in the runtime folder for sake of OpenMP testers.

And make -j: Simply, it tries to build a package with multiple jobs in parallel in order to speedup building. For example, with (make -j 8), we are trying to speedup the build process with 8 jobs (threads) in parallel. If the number is not provided, like “make -j”, then there is no limit to number jobs and it tries to run it with as many as possible.

Bests Regards,
Millad Ghane

graycol.gif

Hi Millad

Thanks for your answer, now I see what is happening.

However, please correct me if I am saying something wrong, I see that these .ll files are generated by the Makefile in the testsuite/bin/ directory.
When I run “make test” in runtime, I get the following errors at the end, after all tests have been compiled and run:

Makefile:19: recipe for target ‘c/orph_ctest_omp_parallel_default’ failed
make[2]: *** [c/orph_ctest_omp_parallel_default] Error 1
In file included from c/test_omp_get_wtick.c:4:
c/omp_testsuite.h:11:10: fatal error: ‘omp.h’ file not found
#include <omp.h>
^
1 error generated.

and similar…

I guess this is because the setting of the include path is not working (at least on my machine). What is the right place to fix it? testsuite/bin/Makefile? Should I fix it by hand before running make test (in the sense that right now “make test” seems to do all the work for me)?

Also, running “make test” in runtime/ fills up my testsuite/ directory with .log files. Is this expected? Incidentally, the .log files for orphaned tests seem to be failing a lot (if not them all).

Thanks and apologies if I am missing some of the point

– Carlo

graycol.gifMillad Ghane —05/14/2015 08:46:51 PM—Hi Carlo, I am responding on behalf of Sunita.

Hi Carlo
Thanks for bringing this to our notice. We are checking things at our end, will write back to you shortly with a solution.
Cheers
Sunita

graycol.gif

Hi Carlo

Sorry for the delay. We were able to fix the problem by adding a line to the Makefile that will fetch omp.h for you, in case your system doesn’t find it by default. Not finding omp.h gave you those errors, it should go away now.

Jonathan: Could you please help us update the Makefile in openmp/runtime/ with the one attached?
If for some reason, you cannot access this Makefile, please pick it up from

https://www.dropbox.com/s/5qirpnb6rcupgwp/Makefile?dl=0

Once this Makefile is used, the tests will run for completion and the log files will automatically be deleted.

Also in /openmp/testsuite/README_LLVM_OPENMP, if you could please mention
make test compiler=clang
instead of
make test
in line 11.
This is more clear.

Thanks for pointing this out and hope this works.
Please let us know.

Sunita

graycol.gif

Makefile (2.52 KB)

I’m on it!

– Johnny

graycol.gif

Great! Let me wait for Jonathan to update the trunk and I will get it from there.

Thanks

– Carlo

graycol.gif"Peyton, Jonathan L" —05/18/2015 05:35:24 PM—I’m on it! – Johnny

Sounds good, Carlo!! Thanks much Jonathan!
-Sunita

graycol.gif

I have just committed this:

Index: runtime/Makefile

graycol.gif

Hi all,

Jonathan: Thanks for the commit.

Carlo: Sorry for late response. Sunita and I were looking to find a time slot to meet and discuss the problem. That’s why I didn’t respond to your email. Last email from Sunita was the solution to your problem. We are waiting for your feedback.

Regards,
Millad

graycol.gif

Hi Millad, Sunita

Thanks for your efforts and no worries for answering late.

I am afraid that this thing does not work yet, and I am surprised that it works at all on your system. Looking here:

http://llvm.org/svn/llvm-project/openmp/trunk/runtime/Makefile

you’ll read:

export INCLUDE_PATH=$(libiomp5_path)$(SLASH)…$(SLASH)…$(SLASH)common$(CLASH)include:$(INCLUDE_PATH) ; \

Can you see the CLASH use at the end of the string? That makes the include path wrong and CLASH is not defined anywhere.
Also, I am using clang as compiler for building libiomp and the tests and INCLUDE_PATH is not an input environment variable for it. This may also be true for gcc, I have not tried it yet.
I found out that C_INCLUDE_PATH is instead working for clang (found it here: https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html).

Once I fix that line to the following:

export C_INCLUDE_PATH=$(libiomp5_path)$(SLASH)…$(SLASH)…$(SLASH)common$(SLASH)include:$(INCLUDE_PATH) ; \

I still get an error, which (beware!) may be system or environment specific:

Testing for “has_openmp”:
Generating sources … success
Compiling soures … success
Running test with 8 threads .sh: ./bin/c/test_has_openmp: Permission denied
… failed 100% of the tests

Any clues?

Thanks!!

– Carlo

graycol.gifMillad Ghane —05/18/2015 06:51:01 PM—Hi all, Jonathan: Thanks for the commit.

Hi Carlo

Millad and I were discussing…

Very sorry about the $(CLASH) Typo!!
Yes, It should have been $(SLASH).

Jonathan: Sorry, attaching an updated Makefile with the typo corrected and C_INCLUDE_PATH…

I think this typo was not picked up at our end, since our machine recognized omp.h correctly. But thanks Carlo, for identifying this.

Regarding ‘permission denied’, it is perfectly fine, we get it too.
Please continue with the run and it should work OK, please let us know what you find.

Most likely you will see something like this:


PASS: OpenMPValidationSuite :: lin_32e/test_omp_test_lock.ll (120 of 122)
PASS: OpenMPValidationSuite :: lin_32e/test_omp_test_nest_lock.ll (121 of 122)
PASS: OpenMPValidationSuite :: lin_32e/test_omp_threadprivate.ll (122 of 122)
Testing Time: 132.75s

graycol.gif

Makefile (2.52 KB)

Not a problem, committed the update.

– Johnny

graycol.gif