some path were missing the configuration name folder and the openmp build was failling
Details
Diff Detail
Event Timeline
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.
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 MonorepoCHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86419/new/
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?
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.
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. |
If I understand @AndreyChurbanov comment right, this change should only apply for MSVC instead of all WIN32, so an additional IF is necessary here.