Skip to content

llvm built with system gcc missing gcc-toolchain #16689

@ye-luo

Description

@ye-luo

I'd like to use the system gcc and spack install llvm.
However, the built clang/clang++ cannot build codes because of missing gcc-toolchain configuration.

Steps to reproduce the issue

$ spack install llvm
$ module load llvm-10.0.0-gcc-9.3.0-brezhrw
$ clang++ -std=c++11 -g -O3 -fopenmp -o gemv-omp.cpp.x -I ../../common gemv-omp.cpp
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:19: gemv-omp.cpp.x] Error 1
$ # Now add --gcc-toolchain=/usr works
$ clang++ --gcc-toolchain=/usr -std=c++11 -g -O3 -fopenmp -o gemv-omp.cpp.x -I ../../common gemv-omp.cpp
$

Information on your system

Ubuntu 20.04 with gcc 9.3

Additional information

  • I have searched the issues of this repo and believe this is not a duplicate
    Note: searching issues of this repo is not easy. issue titles are not verbose enough. It is almost impossible to go through every issue comments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions