18083, "stonea", "printchplenv: unhelpful error message when CHPL_LLVM='system' and llvm is not in path", "2021-07-20T20:04:13Z"
If I run util/printchplenv on chapcs11 with CHPL_LLVM='system' and I don't have llvm in my path I get the following error message:
chapcs11@[/users/stonea/chapel]> export CHPL_DEVELOPER=0
chapcs11@[/users/stonea/chapel]> util/printchplenv
Error: command not found:
With CHPL_DEBUG=1 we get a more verbose message, but still not very helpful message:
chapcs11@[/data/cf/chapel/stonea/chapel]> util/printchplenv
Traceback (most recent call last):
File "/data/cf/chapel/stonea/chapel/util/chplenv/printchplenv.py", line 475, in <module>
main()
File "/data/cf/chapel/stonea/chapel/util/chplenv/printchplenv.py", line 464, in main
compute_all_values()
File "/data/cf/chapel/stonea/chapel/util/chplenv/printchplenv.py", line 149, in compute_all_values
target_compiler_c = chpl_compiler.get_compiler_command('target', 'c')
File "/data/cf/chapel/stonea/chapel/util/chplenv/utils.py", line 33, in memoize_wrapper
cache[args] = func(*args)
File "/data/cf/chapel/stonea/chapel/util/chplenv/chpl_compiler.py", line 302, in get_compiler_command
command = chpl_llvm.get_llvm_clang(lang_upper)
File "/data/cf/chapel/stonea/chapel/util/chplenv/utils.py", line 33, in memoize_wrapper
cache[args] = func(*args)
File "/data/cf/chapel/stonea/chapel/util/chplenv/chpl_llvm.py", line 213, in get_llvm_clang
bindir = get_system_llvm_config_bindir()
File "/data/cf/chapel/stonea/chapel/util/chplenv/utils.py", line 33, in memoize_wrapper
cache[args] = func(*args)
File "/data/cf/chapel/stonea/chapel/util/chplenv/chpl_llvm.py", line 186, in get_system_llvm_config_bindir
bindir = run_command([llvm_config, '--bindir']).strip()
File "/data/cf/chapel/stonea/chapel/util/chplenv/utils.py", line 68, in run_command
error("command not found: {0}".format(command[0]), OSError)
File "/data/cf/chapel/stonea/chapel/util/chplenv/utils.py", line 17, in error
raise exception(msg)
OSError: command not found:
If I set CHPL_LLVM="bundled" the command will work as expected. Here's my other values in case they're relevant:
chapcs11@[/users/stonea/chapel]> util/printchplenv
machine info: Linux chapcs11 4.4.103-6.38-default #1 SMP Mon Dec 25 20:44:33 UTC 2017 (e4b9067) x86_64
CHPL_HOME: /users/stonea/chapel *
script location: /data/cf/chapel/stonea/chapel/util/chplenv
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: bundled *
CHPL_AUX_FILESYS: none