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.
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.
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
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.
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.
/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
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 updatesudo apt upgradebrew updatebrew upgrade recently?
About the version of libstdc++: on my test VM, I can see that Chapel is working with a 64-bit libstdc++:
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.
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: