27130, "jabraham17", "[Bug]: Ubuntu GASNet package complains about missing g++", "2025-04-21T16:33:13Z"
Using a brand new and clean Ubuntu 24 system (i.e. no extra dependencies), I installed Chapel as follows
sudo apt-get update
sudo apt-get install ./chapel-gasnet-udp-2.4.0-1.ubuntu24.amd64.deb
Compiling hello world results in the following errors
/bin/sh: 1: g++: not found
/bin/sh: 1: g++: not found
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -eq: unexpected operator
/bin/sh: 1: g++: not found
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -gt: unexpected operator
/bin/sh: 1: test: -gt: unexpected operator
/bin/sh: 1: test: -ge: unexpected operator
/bin/sh: 1: test: -eq: unexpected operator
/bin/sh: 1: test: -ge: unexpected operator
/bin/sh: 1: test: -ge: unexpected operator
/bin/sh: 1: test: -eq: unexpected operator
/bin/sh: 1: test: -eq: unexpected operator
/bin/sh: 1: test: -eq: unexpected operator
/bin/sh: 1: test: -ge: unexpected operator
This still results in a compiled binary that runs correctly (with the proper GASNet env variables set up), but the large number of "errors" is concerning.
The workaround to make these errors go away is to install g++, sudo apt-get install g++
.
I didn't full track down where this error is coming from, but I believe this issue is coming from printchplenv
/Makefiles checking for the presence of g++
. These Makefiles get invoked when building a launcher, so this issue only affects chapel-gasnet-udp
and chapel-ofi-slurm
packages, not the basic COMM=none package. The rest of the errors about -lt
is likely version checks that rely on g++
being there.
I think there are two ways to solve this
- Just add
g++
as a dependency in the package configuration, even though its not really needed - Adjust our build system for launchers to avoid checks that only matter for from source builds of the compiler, like the presence of
g++
/CHPL_HOST_CXX
. That is required to build the compiler, but is not required after that.
I think the second option is the more principled approach that actually gets at the root of the problem, but is much harder to achieve.
This also points to a hole in our package testing story. There is tests to make sure the compiler works and the resulting binaries can run, but nothing checks for this kinda of extraneous output