Runtime has not been built for this configuration

i had uninstalled chapel ,then again installed using homebrew ,i get this error though

/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$ chpl -o hello hello.chpl
error: The runtime has not been built for this configuration. Run $CHPL_HOME/util/chplenv/printchplbuilds.py for information on available runtimes.

if i used homebrew , does
make
have to be used??

python printchplenv.py
Warning: Unknown compiler: "gnu"
machine info: Linux asusLaptop 5.15.0-92-generic #102~20.04.1-Ubuntu SMP Mon Jan 15 13:09:14 UTC 2024 x86_64
CHPL_HOME: /home/linuxbrew/.linuxbrew/opt/chapel *
script location: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/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: none
CHPL_HWLOC: bundled
CHPL_RE2: none
CHPL_LLVM: system
CHPL_AUX_FILESYS: none

what environment variable i should set here?

/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec$ chpl examples/hello3-datapar.chpl
/usr/bin/ld: cannot find -lstdc++
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
error: Make Binary - Linking

i am not able to execute the hello3-datapar program , i'm getting this error.

Hi @AnhaiK and welcome to Chapel Discourse!

Taking your questions out of order:

Was your previous installation of Chapel also homebrew, or was it a manual installation?

No, it should not (need to) be. brew install chapel followed by chpl myChplProgram.chpl should be sufficient with no additional steps.

You should also not need to manually set any CHPL_ environment variables, and I would suggest unsetting any that you might currently have set in your shell or dotfiles (checking for them in your session using env | grep CHPL).

From your printchplenv output:

it appears that CHPL_HOME might be set, but it need not be. I'm not aware that this would be problematic if it's set to the correct value for your homebrew installation, but I don't use linuxbrew, so can't easily verify its value. I don't think it should need to be set in any case.

Assuming no CHPL_* variables have been set, this error:

tends to occur most frequently when mixing the compiler from one installation and the runtime libraries from another. That makes me wonder whether you could be using the chpl from the new installation (say) and the $CHPL_HOME from the previous installation or vice-versa.

Again, clearing your environment of CHPL settings (or PATH settings related to old installations of Chapel) and starting from a fresh environment should fix such issues. You can also use chpl --print-chpl-home to see where your chpl compiler thinks $CHPL_HOME is and chpl --print-chpl-settings to print out its notion of a bunch of CHPL environment variables. And of course which chpl can be used to determine which chpl binary you're invoking.

The line:

is also a bit concerning, and I'm not sure offhand where it would be coming from. Do you also see it if you run chpl --print-chpl-settings? If you do env | grep gnu, what do you see?

A number of things can cause this error, including potentially mixing versions of chpl and $CHPL_HOME. Rather than taking guesses at what could be going wrong here, let's see if any of the previous steps make things better first. If they don't, seeing the output of chpl --print-commands examples/hello3-datapar.chpl might be useful.

-Brad

previously i had installed using make (manual installation) and i could "make" successfully so, used homebrew after that. I also had removed all the chapel files manually while uninstalling it, with the help of
sudo find / -type f -name 'chpl*' .so did i miss removing any other relevant file which might be causing issues now?
this is my current setting after reinstalling through brew

/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec$ chpl --print-chpl-home
/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec
asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec$ chpl --print-chpl-settings
CHPL_HOME: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec
CHPL_RUNTIME_LIB: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/lib
CHPL_RUNTIME_INCL: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include
CHPL_THIRD_PARTY: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party

machine info: Linux asusLaptop 5.15.0-92-generic #102~20.04.1-Ubuntu SMP Mon Jan 15 13:09:14 UTC 2024 x86_64
CHPL_HOME: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec *
script location: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/util/chplenv
CHPL_HOST_PLATFORM: linux64
CHPL_HOST_COMPILER: gnu
CHPL_HOST_CC: gcc
CHPL_HOST_CXX: g++
CHPL_HOST_ARCH: x86_64
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_CC: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang
CHPL_TARGET_CXX: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
CHPL_TARGET_LD: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none *
CHPL_TASKS: fifo *
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_HOST_MEM: cstdlib *
CHPL_MEM: cstdlib *
CHPL_ATOMICS: cstdlib
CHPL_GMP: none *
CHPL_HWLOC: none
CHPL_RE2: none *
CHPL_LLVM: system *
CHPL_LLVM_SUPPORT: system
CHPL_LLVM_CONFIG: /home/linuxbrew/.linuxbrew/opt/llvm@15/bin/llvm-config +
CHPL_LLVM_VERSION: 15
CHPL_AUX_FILESYS: none
CHPL_LIB_PIC: none
CHPL_SANITIZE: none
CHPL_SANITIZE_EXE: none

i'm getting this error.
/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec$ chpl --print-commands examples/hello3-datapar.chpl
error: The runtime has not been built for this configuration. Run $CHPL_HOME/util/chplenv/printchplbuilds.py for information on available runtimes.

also this is the output for
$CHPL_HOME/util/chplenv/printchplbuilds.py
0 1
CHPL_TARGET_PLATFORM: linux64 linux64 linux64
CHPL_TARGET_COMPILER: llvm llvm gnu*
CHPL_TARGET_ARCH: x86_64 x86_64 x86_64
CHPL_TARGET_CPU: native native native
CHPL_LOCALE_MODEL: flat flat flat
CHPL_COMM: none none none
CHPL_TASKS: fifo fifo fifo
CHPL_TASKS_DEBUG: - - -
CHPL_TIMERS: generic generic generic
CHPL_UNWIND: none none none
CHPL_MEM: cstdlib cstdlib cstdlib
CHPL_ATOMICS: cstdlib cstdlib cstdlib
CHPL_HWLOC: none none none
CHPL_RE2: none bundled* bundled*
CHPL_AUX_FILESYS: none none none
CHPL_LIB_PIC: none none none
CHPL_SANITIZE_EXE: none none none
MTIME: NA Dec 08 15:05 Dec 08 15:05

Hello @AnhaiK, the output of these commands is very helpful. I expect that you have CHPL_RE2 set in your environment. If you unset it or set it to bundled then the error should be resolved.

Vass

after rebooting my computer:

asus@asusLaptop:~$ chpl --print-chpl-settings
CHPL_HOME: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec
CHPL_RUNTIME_LIB: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/lib
CHPL_RUNTIME_INCL: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include
CHPL_THIRD_PARTY: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party

machine info: Linux asusLaptop 5.15.0-92-generic #102~20.04.1-Ubuntu SMP Mon Jan 15 13:09:14 UTC 2024 x86_64
CHPL_HOME: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec *
script location: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/util/chplenv
CHPL_HOST_PLATFORM: linux64
CHPL_HOST_COMPILER: gnu
CHPL_HOST_CC: gcc
CHPL_HOST_CXX: g++
CHPL_HOST_ARCH: x86_64
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_CC: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang
CHPL_TARGET_CXX: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
CHPL_TARGET_LD: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: fifo +
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_HOST_MEM: jemalloc
CHPL_MEM: cstdlib +
CHPL_ATOMICS: cstdlib
CHPL_GMP: system +
CHPL_HWLOC: none
CHPL_RE2: bundled +
CHPL_LLVM: system
CHPL_LLVM_SUPPORT: system
CHPL_LLVM_CONFIG: /home/linuxbrew/.linuxbrew/opt/llvm@15/bin/llvm-config +
CHPL_LLVM_VERSION: 15
CHPL_AUX_FILESYS: none
CHPL_LIB_PIC: none
CHPL_SANITIZE: none
CHPL_SANITIZE_EXE: none

CPL_RE2 is set to bundled itself but i get this : error when i compile an example program:

asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$ chpl -L/usr/lib/x86_64-linux-gnu/libstdc++.so.6 hello3-datapar.chpl
/usr/bin/ld: cannot find -lstdc++
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
error: Make Binary - Linking

@AnhaiK

  • What happens if you compile with chpl hello3-datapar.chpl (leaving off the manually added -L option)?

  • What happens with chpl --print-commands hello3-datapar.chpl?

  • Are you able to compile and link a C++ "hello world" style program with your linuxbrew llvm@15 installation? (i.e., using the compilers listed here:

    CHPL_TARGET_CC: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang
    CHPL_TARGET_CXX: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
    CHPL_TARGET_LD: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
    

Thanks,
-Brad

/usr/bin/ld: cannot find -lstdc++
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
child process exited with code 1
error: Make Binary - Linking

asus@asusLaptop:~$ clang++ home_cpp.cpp; ./home_cpp
home_cpp.cpp:1:10: fatal error: 'iostream' file not found
1 | #include
| ^~~~~~~~~~
1 error generated.
Hello, World!
asus@asusLaptop:~$ g++ -o home_cpp home_cpp.cpp
asus@asusLaptop:~$ ./home_cpp
Hello, World!

how do i change compiler to g++ in chapel?

i'm on a Ubuntu 20.04 operating system.

when i'm compiling a chapel code ,it is trying to look for libstdc++ under usr/bin/ld .
but my libstdc++ is available under lib32

how do i make chapel point to lib32?

You have a 64-bit OS so, Chapel will compile 64-bit programs, and those should be using a 64-bit libstdc++.

Do you have the Homebrew version of gcc / g++ installed? You can see what packages you have installed with brew list.

I'm trying to reproduce your environment.

Here is what I have

  • Ubuntu 20.04.6 LTS
  • linuxbrew installed with these packages
$ brew list
berkeley-db@5	 chapel    gcc	  krb5	   libnsl	       llvm@14	  mpfr	       readline  zlib
binutils	 cmake	   glibc  libedit  libtirpc	       llvm@15	  ncurses      sqlite	 zstd
bzip2		 elfutils  gmp	  libffi   libxcrypt	       lz4	  openssl@3    unzip
ca-certificates  expat	   isl	  libmpc   linux-headers@5.15  mpdecimal  python@3.11  xz
$ chpl --print-chpl-settings
CHPL_HOME: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec
CHPL_RUNTIME_LIB: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/lib
CHPL_RUNTIME_INCL: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include
CHPL_THIRD_PARTY: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party

machine info: Linux ubuntu-focal 5.4.0-170-generic #188-Ubuntu SMP Wed Jan 10 09:51:01 UTC 2024 x86_64
CHPL_HOME: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec *
script location: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/util/chplenv
CHPL_HOST_PLATFORM: linux64
CHPL_HOST_COMPILER: gnu
  CHPL_HOST_CC: gcc
  CHPL_HOST_CXX: g++
CHPL_HOST_ARCH: x86_64
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
  CHPL_TARGET_CC: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang
  CHPL_TARGET_CXX: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
  CHPL_TARGET_LD: /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: fifo +
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_HOST_MEM: jemalloc
CHPL_MEM: cstdlib +
CHPL_ATOMICS: cstdlib
CHPL_GMP: system +
CHPL_HWLOC: none
CHPL_RE2: bundled +
CHPL_LLVM: system
  CHPL_LLVM_SUPPORT: system
  CHPL_LLVM_CONFIG: /home/linuxbrew/.linuxbrew/opt/llvm@15/bin/llvm-config +
  CHPL_LLVM_VERSION: 15
CHPL_AUX_FILESYS: none
CHPL_LIB_PIC: none
CHPL_SANITIZE: none
CHPL_SANITIZE_EXE: none
// hello.chpl
writeln("hello");
$ chpl hello.chpl --print-commands
<internal clang code generation> -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/modules/standard -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/modules/packages -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/localeModels/flat -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/localeModels -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/comm/none -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/comm -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/tasks/fifo -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/qio -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/atomics/cstdlib -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/runtime/include/mem/cstdlib -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party/utf8-decoder -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party/re2/install/linux64-x86_64-native-llvm-none/include -I. -I/tmp/chpl-vagrant.deleteme-zXJNig -Werror=pointer-arith -Werror=write-strings -Werror=missing-declarations -Werror=missing-prototypes -Werror=strict-prototypes -Werror=missing-format-attribute -Wno-unused-function -Wno-strict-aliasing -I/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/modules/internal -DCHPL_GEN_CODE -pthread -I/home/linuxbrew/.linuxbrew/include -include sys_basic.h -include wctype.h -include ctype.h -include llvm/chapel_libc_wrapper.h 

# Make Binary - Linking
/home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++ /tmp/chpl-vagrant.deleteme-zXJNig/chpl__module.o /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/lib/linux64/llvm/x86_64/cpu-native/loc-flat/comm-none/tasks-fifo/tmr-generic/unwind-none/mem-cstdlib/atomics-cstdlib/hwloc-none/re2-bundled/fs-none/lib_pic-none/san-none/main.o -o /tmp/chpl-vagrant.deleteme-zXJNig/hello.tmp -L/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/lib/linux64/llvm/x86_64/cpu-native/loc-flat/comm-none/tasks-fifo/tmr-generic/unwind-none/mem-cstdlib/atomics-cstdlib/hwloc-none/re2-bundled/fs-none/lib_pic-none/san-none -lchpl -L/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party/re2/install/linux64-x86_64-native-llvm-none/lib -lre2 -Wl,-rpath,/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/third-party/re2/install/linux64-x86_64-native-llvm-none/lib -lm -lpthread -lgmp -L/home/linuxbrew/.linuxbrew/lib
rm -f hello
mv /tmp/chpl-vagrant.deleteme-zXJNig/hello.tmp hello

So, this is working for me.

sudo find / -type f -name 'chpl*' .so did i miss removing any other relevant file which might be causing issues now?

That's possible. I don't think that would completely remove an old installation. (Note we have a TODO to get make uninstall working; see make uninstall · Issue #6353 · chapel-lang/chapel · GitHub ).

Even so, the issues you are describing here sound more to me like a problem with some dependency (e.g. wrong libstdc++ installed, or some environment variable is disrupting the process of finding it). Are you setting any CHPL_ or C compiler related environment variables in a login script? Are your packages out of date in an incompatable way? Have you done sudo apt update sudo apt upgrade brew update brew upgrade recently?

About the version of libstdc++: on my test VM, I can see that Chapel is working with a 64-bit libstdc++:

$ chpl hello.chpl
$ ldd ./hello
	linux-vdso.so.1 (0x00007ffd945ef000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3f33ac8000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3f33aa5000)
	libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f3f33a21000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3f3383f000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3f33824000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3f33632000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f3f33d38000)
$ ./hello
hello

Also regarding this:

It would be a pretty severe problem if the clang++ Chapel is using can't compile C++ code. It works for me:

$ /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++ test.cpp
$ ./a.out
Hello from C++

Occasionally, users working with a different GCC need to set CHPL_LLVM_GCC_PREFIX to the prefix where a different GCC is installed. It leads Chapel to use a --gcc-toolchain=/some/path/to/gccInstall/ for clang++ commands when compiling. You can check if this will help you by adding it directly to a test compile with clang++ such as the above one.

asus@asusLaptop:~$ which gcc
/usr/bin/gcc
asus@asusLaptop:~$ which g++
/usr/bin/g++
asus@asusLaptop:~$ export CHPL_GCC_PREFIX=/usr/bin/gcc
asus@asusLaptop:~$ chpl myprogram.chpl
myprogram.chpl:2: syntax error: (no token given)
asus@asusLaptop:~$ /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++ home_cpp.cpp
home_cpp.cpp:1:10: fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 error generated.
asus@asusLaptop:~$ /usr/bin/g++ home_cpp.cpp
asus@asusLaptop:~$ ./a.out
Hello, World!
asus@asusLaptop:~$ ldd ./a.out
linux-vdso.so.1 (0x00007ffee8365000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fae53f56000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fae53d64000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fae53c15000)
/lib64/ld-linux-x86-64.so.2 (0x00007fae541e8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fae53bf0000)

i'm able to compile using g++ ,but the same isn't happening with the chapel file.

asus@asusLaptop:~$ brew list
berkeley-db@5 elfutils krb5 libxcrypt mpfr sqlite
binutils expat libedit linux-headers@5.15 ncurses unzip
bzip2 gcc libffi llvm openssl@3 xz
ca-certificates glibc libmpc llvm@15 python@3.11 z3
chapel gmp libnsl lz4 python@3.12 zlib
cmake isl libtirpc mpdecimal readline zstd

brew list output said this.

This error indicates whatever you put in myprogram.chpl isn't a valid Chapel program. I wouldn't expect it indicates any configuration /
installation problem.

I don't see how we can get Chapel to work if the C++ compiler is behaving this way. On my VM with a similar environment, clang++ was able to find C++ headers:

// test.cpp
#include <cstdio>
#include <iostream>

int main(int argc, char** argv) {
  printf("Hello from C++\n");
  return 0;
}
$ /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++  test.cpp
$ ./a.out
Hello from C++

Since it's hard to see how Chapel can work in this setting if clang++ is not working, I'd recommend you try to debug this problem first. Does /home/linuxbrew/.linuxbrew/Cellar/llvm@15/15.0.7/bin/clang++ test.cpp --gcc-toolchain=/usr/ change the behavior at all?

It might be some kind of Homebrew issue. Have you tried brew doctor? Could try uninstalling it and reinstalling it as well, but that seems like a big step.

Another totally different strategy is to ask Chapel to use the C backend rather than the LLVM backend. We default to LLVM but sometimes the C backend is easier to get working. It looks like the Homebrew package is built with support for the C backend as well. To request it, you can do:

$ CHPL_TARGET_COMPLIER=gnu chpl hello.chpl

or

$ chpl hello.chpl --target-compiler=gnu

the export didn't work....
asus@asusLaptop:~$ export CHPL_TARGET_COMPLIER=gnu
asus@asusLaptop:~$ chpl /home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples/hello3-datapar.chpl
/usr/bin/ld: cannot find -lstdc++
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
error: Make Binary - Linking

and CHPL_TARGET_COMPLIER=gnu chpl hello.chpl this gave the linking error

asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$ CHPL_TARGET_COMPLIER=gnu chpl hello.chpl
/usr/bin/ld: cannot find -lstdc++
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
error: Make Binary - Linking

but chpl hello.chpl --target-compiler=gnu worked

asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$ chpl hello.chpl --target-compiler=gnu
asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$

asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$ chpl hello3-datapar.chpl --target-compiler=gnu
asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$
------did compilation
asus@asusLaptop:/home/linuxbrew/.linuxbrew/Cellar/chapel/1.33.0/libexec/examples$ ./hello3-datapar
Hello, world! (from iteration 1 of 100)
Hello, world! (from iteration 51 of 100)
Hello, world! (from iteration 52 of 100)
Hello, world! (from iteration 53 of 100)
Hello, world! (from iteration 54 of 100)
Hello, world! (from iteration 55 of 100)
Hello, world! (from iteration 56 of 100)
Hello, world! (from iteration 57 of 100)
Hello, world! (from iteration 58 of 100)
Hello, world! (from iteration 59 of 100)
Hello, world! (from iteration 60 of 100)
Hello, world! (from iteration 61 of 100)
.
.
.
100 threads --done successfully

how do i set the target compiler as gnu in the environment seeing that export did not work??
Thank you

Hi, my apologies, the reason this didn't work is that there was a spelling error in my last post. It should be

export CHPL_TARGET_COMPILER=gnu

Hope that helps.

sorry, i didn't notice either.

it works, Thanks