Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find -lstdc++ errors #24819

Open
bradcray opened this issue Apr 10, 2024 · 3 comments
Open

cannot find -lstdc++ errors #24819

bradcray opened this issue Apr 10, 2024 · 3 comments

Comments

@bradcray
Copy link
Member

With some (low but unsettling) frequency, we have been getting reports from users of the form:

/usr/bin/ld: cannot find -lstdc++: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Make Binary - Linking

(or variations on this theme). My understanding is that this usually suggests something is wrong with the underlying C/C++ compilers, or how we invoke them. For example, today's instance was due to gcc-12 being installed without one of g++-12 or libstdc++-12-dev also being installed.

This issue asks what we could be doing to make this issue easier to diagnose (for users, or for ourselves to help users) when it occurs.

  • Update the prereqs doc to contain additional dependencies? (but how to do this given that it seems to be sensitive to gcc versions?)
  • Create a "test the back-end compiler" command that emulates the one(s) our compiler will uses to try to catch and warn about such issues? (e.g., "It seems your C/C++ installation is broken, we couldn't successfully do gcc ...) But when would we run this?
  • Make the compiler itself smarter about catching such errors and printing such a message?

In the meantime, perhaps it can start serving as a place to store information about cases we hit and how to sort them out.

@jabraham17
Copy link
Member

Create a "test the back-end compiler" command that emulates the one(s) our compiler will uses to try to catch and warn about such issues? (e.g., "It seems your C/C++ installation is broken, we couldn't successfully do gcc ...) But when would we run this?

This seems attractive to me, where CMake already does something like this for CHPL_HOST_*, we could also do this for CHPL_TARGET_* as a part of the build process

@mppf
Copy link
Member

mppf commented Apr 11, 2024

But when would we run this?

IMO it would be sufficient for make check to run this before compiling a Chapel program, or possibly after failing to compile a Chapel program.

Also, noting that another option available to us is to use LLVM's libc++. There are flags to ask clang to use that and we could make it a prerequisite / bundle it. In principle, this should make it easier for clang to figure out where to find the C++ standard library, but it's also possible that it will bring new problems.

@bradcray
Copy link
Member Author

IMO it would be sufficient for make check to run this before compiling a Chapel program, or possibly after failing to compile a Chapel program.

If we were to pursue this approach, we'd also need to add a make check step to the quickstart instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants