Skip to content
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

Add CHPL_LLVM_SUPPORT and adjust quickstart #20396

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

mppf
Copy link
Member

@mppf mppf commented Aug 5, 2022

Follow-up to PR #19565.

This PR takes two steps to improve the situation after PR #19565.

First, it adds CHPL_LLVM_SUPPORT as a printchplenv variable. This variable indicates where to get the LLVM Support Library (which is currently required to build the compiler). It can be bundled or system. See issue #20380.

On the name of this variable, I wondered if CHPL_LLVM_SUPPORT_LIBRARY would be a better name? CHPL_LLVM_SUPPORT could be interpreted as "does Chapel build with LLVM support" but that is what CHPL_LLVM does. On the other hand, since it appears in printchplenv --all within the CHPL_LLVM block, I think CHPL_LLVM_SUPPORT is OK.

Second, it adjusts the quickstart scripts to set CHPL_LLVM=system if a compatible system LLVM is detected. See issue #20273.

Reviewed by @daviditen - thanks!

  • full local testing
  • make check with CHPL_LLVM unset where no system LLVM exists produces "Please set the environment variable CHPL_LLVM to a supported value." error
  • make check with CHPL_LLVM=none where no system LLVM exists
  • make check with CHPL_LLVM=none where a system LLVM exists
  • make check with CHPL_LLVM=bundled
  • make check with CHPL_LLVM=system

mppf added 2 commits August 5, 2022 17:41
---
Signed-off-by: Michael Ferguson <[email protected]>
to use a system LLVM if one is detected to be available

---
Signed-off-by: Michael Ferguson <[email protected]>
@mppf mppf requested a review from daviditen August 11, 2022 15:47
Copy link
Member

@daviditen daviditen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mppf mppf merged commit 454cdd0 into chapel-lang:main Aug 11, 2022
@mppf mppf deleted the chpl-llvm-support-var branch August 11, 2022 17:13
mppf added a commit that referenced this pull request Aug 11, 2022
Fix testReleaseHelp to check only Chapel version

Follow-up to PR #20396 to fix a test failure.

Test code was picking up the LLVM version as well
since now with LLVM support the output looks like this e.g.:

    chpl version 1.28.0 pre-release (e4f5b05)
      built with LLVM version 14.0.0

Fix that by adjusting a `grep` call used in buildReleaseHelp.

Reviewed by @daviditen - thanks!

- [x] `util/buildRelease/testRelease -debug` works
mppf added a commit that referenced this pull request Aug 12, 2022
Fix problems after LLVM configuration PRs

Follow-up to PRs #20396 and #20385 to address issues raised by nightly testing.

* build failures in cron-xc-wb-host-prgenv-cray-failure and
  xc-wb.prgenv-cray configurations: don't default to
  CHPL_LLVM_SUPPORT=system if all the LLVM dependencies are not
  installed. These configurations have just `llvm-config` but not the
  required headers.
* networking-packages failure with curl tests: update
  `common-quickstart.bash` to set `CHPL_LLVM=none`. The quickstart setup
  script can provide `CHPL_LLVM=none` or `CHPL_LLVM=system` but since we
  test `CHPL_LLVM=system` in most configurations, in the quickstart
  testing configuration, we want to test `CHPL_LLVM=none`. At the moment,
  the curl tests do not all work with the LLVM backend.
* darwin-m1 or other Mac OS testing failure with chpl-env-gen: fixed a
  sed portability issue between linux and Mac OS X.

Reviewed by @arezaii - thanks!

- [x] On Ubuntu, if llvm-14 is installed but not llvm-14-dev
  * default is CHPL_LLVM=unset and CHPL_LLVM_SUPPORT=bundled
  * setting CHPL_LLVM=system produces an error from printchplenv about a
    missing header
- [x] On Ubuntu, if we have the needed LLVM dependencies
  * default is CHPL_LLVM=system and CHPL_LLVM_SUPPORT=system
- [x] `make` functions on XC with PrgEnv-cray and GCC as the host
  compiler
- [x] `make` functions on XC with PrgEnv-cray and cray-prgenv-cray as the
  host compiler
- [x] full local testing
mppf added a commit that referenced this pull request Sep 1, 2022
avoid quickstart CHPL_LLVM=system on incompatible platforms

This is a follow-up to PR #20396.

In doing some portability testing, I noticed that the `quickstart`
configuration was not working on a 32-bit Debian 11 image. The problem
was that the image has the right LLVM/clang packages installed, but
Chapel does not support using LLVM on a 32-bit platform right now. The
result was that `quickstart` set CHPL_LLVM=system but that led to errors
later on from `printchplenv` / `make`.

This PR just adjusts the `chpl_llvm.py` code determining the quickstart
setting for CHPL_LLVM to use `none` if the platform is not supported for
Chapel+LLVM.

Reviewed by @bhavanijayakumaran and @daviditen - thanks!
mppf added a commit that referenced this pull request Sep 2, 2022
Update docs related to build changes

This PR includes docs updates related to PRs #19565 and #20396. This PR
documents:
 * changes to how quickstart works
 * CHPL_LLVM_SUPPORT and the llvm support library being required.

While there, I:
 * adjusted prereqs.rst to only list the supported LLVM versions once and
   to say it is "LLVM and clang" that is needed
 * added sections in chplenv.rst for CHPL_LLVM_SUPPORT, CHPL_LLVM_CONFIG,
   and CHPL_LLVM_GCC_PREFIX

Reviewed by @lydia-duncan - thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants