Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CHPL_LLVM_GCC_INSTALL_DIR as an alternative to CHPL_LLVM_GCC_PREF…
…IX (#25913) This PR adds `CHPL_LLVM_GCC_INSTALL_DIR` as an alternative to `CHPL_LLVM_GCC_PREFIX`. This PR is motivated by the discussion in https://chapel.discourse.group/t/cannot-make-gpu-enabled-chapel/37046/12 . `CHPL_LLVM_GCC_PREFIX` allows one to select a GCC installation. The trouble is, on some systems (E.g. Ubuntu 24.04), there can be multiple versions of GCC installed at the same time, with the same prefix (`/usr` in this case). `clang` actually supports `--gcc-install-dir` as of `clang` 16. That flag can be used to request a particular version of GCC on Ubuntu. To understand what one might want to include: * run `clang++ -v hello.cc` where `hello.cc` might just contain `int main() { return 0; }` * you can see the GCC installations it considers at the beginning, e.g. ``` Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/14 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/14 ``` * you can try to change which version should be used, e.g. with `clang++ -v hello.cc --gcc-install-dir=/usr/bin/../lib/gcc/x86_64-linux-gnu/13 ` Reviewed by @e-kayrakli - thanks! - [x] able to build a GPU-enabled runtime on Ubuntu 24.04 with GCC 14 installed - [x] full comm=none testing
- Loading branch information