Skip to content

Compile bug: undefined reference to ggml_backend_is_cpu #15598

@pwilkin

Description

@pwilkin

Git commit

version: 6268 (0d5a470)

Operating systems

Linux

GGML backends

CPU

Problem description & steps to reproduce

I started building my project with -DGGML_CPU_ALL_VARIANTS=ON -DGGML_BACKEND_DL=ON and got this beauty. It happens when linking test-opt:

First Bad Commit

No response

Compile command

cmake -B build  -DGGML_CUDA=ON -DGGML_CUDA_FORCE_CUBLAS=OFF -DGGML_CUDA_FORCE_MMQ=OFF -DGGML_CUDA_FA_ALL_QUANTS=1 -DCMAKE_CUDA_ARCHITECTURES=86 -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DGGML_CPU_ALL_VARIANTS=ON -DGGML_BACKEND_DL=ON -DCMAKE_BUILD_TYPE=Release

Relevant log output

/usr/bin/ld: CMakeFiles/test-opt.dir/test-opt.cpp.o: in function `main':
test-opt.cpp:(.text.startup+0x118): undefined reference to `ggml_backend_is_cpu'
/usr/bin/ld: test-opt.cpp:(.text.startup+0x12d): undefined reference to `ggml_backend_cpu_set_n_threads'
collect2: error: ld returned 1 exit status
gmake[2]: *** [tests/CMakeFiles/test-opt.dir/build.make:122: bin/test-opt] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:3522: tests/CMakeFiles/test-opt.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

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