-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Further improve LLVM building #18606
Conversation
And also adjust makefiles to remove cases for LLVM 9/10 now as 11 is the current requirement. --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
Need to check that this works OK -- e334bb3 enabled this logic and said "Otherwise if the PrgEnv module isn't loaded, problems finding libstdc++." If we can't use the dylib on Crays then we will need to put back in the static library link strings for the clang libraries. --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
Removes util/config/gather-cray-prgenv-arguments.bash util/config/gather-pe-chapel-pkgconfig-libs.bash and makes adjustments to Makefiles and chplenv scripts to allow that. --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
I haven't seen a problem with it yet but I don't want to get in to changing it in this PR. See PR chapel-lang#3531 and PR chapel-lang#11615 for some history in this area. --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
Only does something with e.g. make CHPL_LLVM_DYNAMIC=0 --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
to address failures with gasnet-mpi configurations --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
@@ -1,5 +1,12 @@ | |||
include $(THIRD_PARTY_DIR)/llvm/Makefile.share-bundled | |||
|
|||
# Link statically on Cray systems to avoid problems with | |||
# finding libstdc++ with different PrgEnv compilers. | |||
CHPL_LLVM_DYNAMIC := 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for reviewer: Given that we weren't linking dynamically before and such linking can lead to rpath issues, should we switch to always statically linking with the bundled LLVM for now until the rpath issues are resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be fine sticking with static linking for the bundled version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that's what I've done
endif | ||
# these should already be gathered in CHPL_LLVM_CLANG_COMPILE_ARGS | ||
# by printchplenv. | ||
CHPL_UGNI_PRGENV_CFLAGS := $(CHPL_MAKE_LLVM_CLANG_COMPILE_ARGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the above comment and conditionals or can we just always set this (wondering if CHPL_MAKE_LLVM_CLANG_COMPILE_ARGS
is empty when the above conditions aren't set)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we could always set it and I'd expect it to be empty if the above conditions aren't set. For now though I will leave this as-is in the PR.
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
I thought I left a comment along this lines here, but I'm not seeing it now -- How often do you expect we'll need to make change like this to adapt to new llvm versions or different packaging on different OS's? Do you think it'd be worthwhile to add testing on a bunch of different OS's with a system llvm? (Either through automated vagrant testing or fixed VMs?) |
In this particular case, we're adapting to what the LLVM project recommends (at least, according to https://archives.gentoo.org/gentoo-dev/message/6d3cf88d858fcf3fbb11818ce5d6ea42 ). I don't expect we'll need a lot of changes like this for different OSes. However I think it would absolutely be worthwhile to add testing for a bunch of different OSes with system LLVM. For that I am hoping we use vagrant or docker or singularity or something along those lines. (I have done some testing with vagrant stuff we have on different OSes with system LLVMs, but it's more spot-checking). I prefer these approaches to fixed VMs because the OSes to test change over time as some of them become end-of-life'd. |
👍 Can we capture this on an existing vagrant issue or create a new one to capture it? |
Improve LLVM configuration on Mac OS X Follow-up to PR #18606 * Add isysroot argument even for system llvm * This appears to be necessary on Mac OS X 11.6.1 with Homebrew llvm version 11.1.0. * Link clang statically for Mac OS X with system LLVM * note that we were already linking statically with the LLVM binaries, but previously were linking clang dynamically * intended to resolve problems building mason (Cray/chapel-private#2702) * Add -I and -L paths according to sysroot * The `-L` path at least seems to be necessary on Mac OS 11.6 and newer. See https://developer.apple.com/forums/thread/666700 for some background in this area. Even though the `-isysroot` path covers it, the linking call does not seem to use it. - [x] homebrew system LLVM 11.1 functions on Big Sur - [x] homebrew system LLVM 11.1 functions on Catalina - [x] homebrew system LLVM functions on Mojave - [x] bundled LLVM functions on Big Sur and Catalina - [x] full local testing Reviewed by @ronawho - thanks!
For #18589
Continuing #18551
About static vs dynamic linking of LLVM libraries:
cmake
command to configure LLVM.This PR addresses #18589 by adjusting the
chpl
link to use-lclang-cpp
(which is a dynamic library) instead of several static libraries when usingCHPL_LLVM=system
. It adjustschpl
to always link statically with LLVM and Clang libraries when usingCHPL_LLVM=bundled
.Additionally, it handles a few follow-ups to #18551 including removing code that is not needed and addressing an issue with gasnet-mpi configurations with a custom GCC.
About the presence of
-clang-cpp
on various system-installs of LLVM:Future work:
make install
-- https://github.com/Cray/chapel-private/issues/2629chpl
builds on a CLE 6 Cray XCmake
succeeds andhello
builds and runs on an XCReviewed by @ronawho - thanks!