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

libstdc++ version must be at least 5.1. #1122

Open
bryancantero opened this issue Sep 2, 2023 · 4 comments
Open

libstdc++ version must be at least 5.1. #1122

bryancantero opened this issue Sep 2, 2023 · 4 comments
Labels
discussion General discussion about something

Comments

@bryancantero
Copy link

bryancantero commented Sep 2, 2023

Hi guys,

I'm installing LLVM previous to HipSYCL package to run it on a AMD RX 6600 XT RDNA 2 GPU, I'm getting this error message from the terminal,

CMake Error at cmake/modules/CheckCompilerVersion.cmake:97 (message):
libstdc++ version must be at least 5.1.
Call Stack (most recent call first):
cmake/config-ix.cmake:13 (include)
CMakeLists.txt:655 (include)

When running

g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Also, I've

clang++ --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

From the CMakeError file,

The output was:
1
/usr/bin/ld: no se puede encontrar -lstdc++: No existe el archivo o el directorio
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)":
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Detecting CXX compiler ABI info failed to compile with the following output:
Change Dir: /root/git/llvm-vanilla/build/CMakeFiles/CMakeTmp

Appreciate your help on this one, thank you,

@bryancantero bryancantero added the discussion General discussion about something label Sep 2, 2023
@illuhad
Copy link
Collaborator

illuhad commented Sep 3, 2023

Hi, do you have a recent libstdc++ version installed? Cmake complains that it cannot link the the C++ standard library:

/usr/bin/ld: no se puede encontrar -lstdc++: No existe el archivo o el directorio

Perhaps you are missing a package like libstdc++-dev or similar? Having the compiler installed does not necessarily mean that the C++ standard library is installed too.

@bryancantero
Copy link
Author

Hi, I tried looking with sudo apt-get install libstdc++-dev
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias... Hecho
Leyendo la información de estado... Hecho
El paquete libstdc++-dev es un paquete virtual provisto por:
libstdc++-9-dev 9.5.0-1ubuntu122.04
libstdc++-12-dev 12.3.0-1ubuntu1
22.04
libstdc++-10-dev 10.5.0-1ubuntu122.04
libstdc++-11-dev 11.4.0-1ubuntu1
22.04
Necesita seleccionar explícitamente uno para instalar.

E: El paquete «libstdc++-dev» no tiene un candidato para la instalación

I specificed the version #6 and the most recent one, 11th, and, I got this,

sudo apt-get install libstdc++-11-dev
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias... Hecho
Leyendo la información de estado... Hecho
libstdc++-11-dev ya está en su versión más reciente (11.4.0-1ubuntu1~22.04).
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 0 no actualizados.

By re-trying the command again I get,

sudo bash install-llvm.sh
The build directory already exists, do you want to use /root/git/llvm-vanilla anyways?[y]y
Using the exisiting directory
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is enabled
-- debuginfo-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- libcxx project is disabled
-- libcxxabi project is disabled
-- libunwind project is disabled
-- lld project is enabled
-- lldb project is disabled
-- mlir project is disabled
-- openmp project is enabled
-- parallel-libs project is disabled
-- polly project is disabled
-- pstl project is disabled
-- flang project is disabled
CMake Error at cmake/modules/CheckCompilerVersion.cmake:97 (message):
libstdc++ version must be at least 5.1.
Call Stack (most recent call first):
cmake/config-ix.cmake:13 (include)
CMakeLists.txt:655 (include)

-- Configuring incomplete, errors occurred!
See also "/root/git/llvm-vanilla/build/CMakeFiles/CMakeOutput.log".
See also "/root/git/llvm-vanilla/build/CMakeFiles/CMakeError.log".

@illuhad
Copy link
Collaborator

illuhad commented Sep 3, 2023

Can you find libstdc++.so somewhere on your system?

@illuhad
Copy link
Collaborator

illuhad commented Sep 3, 2023

sudo bash install-llvm.sh

Is this the install-llvm.sh that we ship? If so, don't use it, it's deprecated.
Please install LLVM as described here: https://github.com/OpenSYCL/OpenSYCL/blob/develop/doc/install-llvm.md
Note that the recommendation is to to just try the LLVM that comes packaged in your Linux distribution first. If that one is recent enough, it is generally not necessary to build your own.

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

No branches or pull requests

2 participants