This is an archive of the discontinued LLVM Phabricator instance.

[openmp] Fix libomp.so copy in multi-config generators.
ClosedPublic

Authored by DavidTruby on Jul 20 2020, 4:18 AM.

Details

Summary

This changes the copy command for libomp.so to use the output of the target as
the source of the copy, rather than trying to find it based on
${LIBOMP_LIBRARY_DIR}, which appears to be incorrect in multi-config generator
builds.

Diff Detail

Event Timeline

DavidTruby created this revision.Jul 20 2020, 4:18 AM

I'm a little uncomfortable with this line copying things from the build directory to the source directory; I believe the source directory should be able to be immutable and builds should still work. Part of the principle of having out-of-tree builds is that the source tree should remain unmodified.
Regardless, I haven't changed the behaviour here as I don't know why the library gets copied to the source directory. Perhaps someone could clarify that? Until then I am just replicating the existing behaviour but with it also working for multi-config generators.

What would be needed to remove this strange copying step? Do the tests really rely on these directories?
I could run the tests successfully with cmake -DLIBOMP_COPY_EXPORTS=FALSE.

I think this export directory structure is a remainder from the original configure based Intel/OpenMP runtime.
@jlpeyton @AndreyChurbanov is this step still needed?

If Intel relies on this export directory, can we disable by default and you enable it for internal purpose?

I think this export directory structure is a remainder from the original configure based Intel/OpenMP runtime.
@jlpeyton @AndreyChurbanov is this step still needed?

If Intel relies on this export directory, can we disable by default and you enable it for internal purpose?

I think this is historical artifact that can be removed nowadays.
Maybe, to be on the safe side, we can set LIBOMP_COPY_EXPORTS to false by default, as you suggested.
Then later we can remove the copying functionality at all.

@DavidTruby please change the default to false and I'll accept the patch.

Disable libomp export copies by default.

This revision is now accepted and ready to land.Jul 21 2020, 7:14 AM
protze.joachim accepted this revision.EditedJul 21 2020, 2:51 PM

Thanks for the update, lgtm

Do you have commit rights to land the patch?

This revision was automatically updated to reflect the committed changes.