Hi Damian -
You can look at what Chapel is configured to use (based on your environment variables and chplconfig files) with ./util/printchplenv
. Adding --all
or even --all --internal
will get more and more information.
Regarding your challenges, it sounds like there are two problems:
- You have to set
LD_LIBRARY_PATH
to get chpl
to run at all.
- You are seeing link errors if the devtools-10 gcc is not in your path.
In my own testing, I have been including the following in my .bashrc to always use the newer GCC (11 in my case):
source scl_source enable devtoolset-11
However I would understand if that is not an acceptable solution for you.
I have been trying to reproduce a similar environment. Looks like I have to install cmake 3 myself to be able to build LLVM and then building the bundled LLVM will take some time.
For 1
I think it would be possible to solve with a -rpath
linker option, if you don't want to have to set the environment variable. I am uncertain whether or not this is a case where we could adjust the build system to do it automatically in this case.
For 2
I am thinking that perhaps it would be best to configure Chapel to build chpl
itself with the devtoolset compiler but to build the runtime with the bundled LLVM along with the regular gcc
libraries. Maybe this will help (replacing the devtoolset 11 path with your devtoolset 10 ones):
$ export CHPL_HOST_CC=/opt/rh/devtoolset-11/root/usr/bin/gcc
$ export CHPL_HOST_CXX=/opt/rh/devtoolset-11/root/usr/bin/g++
$ export CHPL_TARGET_COMPILER=llvm
$ export CHPL_LLVM=bundled
So now I have this
$ ./util/printchplenv --all
machine info: Linux localhost.localdomain 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64
CHPL_HOME: /home/vagrant/chapel *
script location: /home/vagrant/chapel/util/chplenv
CHPL_HOST_PLATFORM: linux64
CHPL_HOST_COMPILER: gnu
CHPL_HOST_CC: /opt/rh/devtoolset-11/root/usr/bin/gcc *
CHPL_HOST_CXX: /opt/rh/devtoolset-11/root/usr/bin/g++ *
CHPL_HOST_ARCH: x86_64
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm *
CHPL_TARGET_CC: /home/vagrant/chapel/third-party/llvm/install/linux64-x86_64-gnu/bin/clang
CHPL_TARGET_CXX: /home/vagrant/chapel/third-party/llvm/install/linux64-x86_64-gnu/bin/clang++
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_GPU_CODEGEN: none
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_HOST_MEM: cstdlib
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: none
CHPL_HWLOC: bundled
CHPL_RE2: none
CHPL_LLVM: bundled *
CHPL_LLVM_CONFIG: /home/vagrant/chapel/third-party/llvm/install/linux64-x86_64-gnu/bin/llvm-config
CHPL_AUX_FILESYS: none
CHPL_LIB_PIC: none
CHPL_SANITIZE: none
CHPL_SANITIZE_EXE: none
A totally different direction to go, if you want to use gcc 10/11 in your runtime build, is this
$ export CHPL_LLVM_GCC_PREFIX=/opt/rh/devtoolset-11/root/usr
Notes about CHPL_LLVM_GCC_PREFIX
. This variable is currently undocumented. To use it, you would export CHPL_LLVM_GCC_PREFIX=<something>
where for <something>
you would put the path to the devtools-10 gcc minus the bin/gcc part. You can get this if have devtoolset-10 loaded and you run ./util/printchplenv --all
and look at CHPL_TARGET_CC
-- there is e.g. a --gcc-toolchain=/some/path/to/gcc-8.3.0/x86_64
and that value after the =
is what you should set CHPL_LLVM_GCC_PREFIX
to.