This is an archive of the discontinued LLVM Phabricator instance.

fix omp post-generation event statement error on windows
Needs RevisionPublic

Authored by ahmidou on Aug 23 2020, 5:52 AM.

Details

Summary

some path were missing the configuration name folder and the openmp build was failling

Diff Detail

Event Timeline

ahmidou created this revision.Aug 23 2020, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2020, 5:52 AM
ahmidou requested review of this revision.Aug 23 2020, 5:52 AM

This change causes standalone Windows build to fail:

LINK : fatal error LNK1181: cannot open input file '\$$(ConfigurationName)/libomp.dll.lib'
make[2]: * [runtime/src/libomp.lib] Error 157
make[1]:
* [runtime/src/CMakeFiles/ompimp.dir/all] Error 2
make: *** [all] Error 2

Looks like there is no ConfigurationName variable set my build.

This revision is now accepted and ready to land.May 17 2021, 2:08 PM

Hi,
So is the standalone Windows build not failing anymore?

Thanks

Le lun. 17 mai 2021 à 17:08, Andrey Churbanov via Phabricator <
reviews@reviews.llvm.org> a écrit :

AndreyChurbanov accepted this revision.
AndreyChurbanov added a comment.
This revision is now accepted and ready to land.

LGTM

Repository:

rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION

https://reviews.llvm.org/D86419/new/

https://reviews.llvm.org/D86419

AndreyChurbanov requested changes to this revision.May 19 2021, 5:25 PM

Hi,
So is the standalone Windows build not failing anymore?

Sorry, I've accepted the patch prematurely I think.
With this patch build is fixed for cmake generators "Visual Studio...", but is broken for e.g. "Unix Makefiles" (I guess this is regardless of whether the build is standalone).
I've accepted the patch when I tried to build clang and standalone libomp using "Visual Studio 16 2019" cmake generator. But "Unix Makefiles" generator still does not work.
Searching for ConfigurationName I found the page https://cmake.org/cmake/help/latest/variable/CMAKE_CFG_INTDIR.html that suggests to use CMAKE_CFG_INTDIR.
And indeed the CMAKE_CFG_INTDIR has the value "$(ConfigurationName)" for "Visual Studio 16 2019" generator and the value "." for "Unix Makefiles" generator, thus the build works for both generators if I replaced $(ConfigurationName) with ${CMAKE_CFG_INTDIR} in your patch.
Could you please check if this replacement works for you?

This revision now requires changes to proceed.May 19 2021, 5:25 PM

I'm sorry for resurrecting this old patch, but I'm encountering the same problem when building OpenMP on Windows with MSVC.
Applying the patch (to different lines, as the code meanwhile expanded a bit) made the compilation to succeed, so I think it may be worth landing this to the main branch.

Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2022, 5:55 AM
protze.joachim added inline comments.
openmp/runtime/cmake/LibompExports.cmake
92

If I understand @AndreyChurbanov comment right, this change should only apply for MSVC instead of all WIN32, so an additional IF is necessary here.