Skip to content

Compile bug: [Bug] server-http.h: missing #include <unordered_map> breaks build on macOS Catalina (10.15) with Clang 14 #22920

@kanedev

Description

@kanedev

Git commit

Latest master (tested on 2026-05-10), last working commit: a290ce6 (b9046)

Operating systems

Mac

GGML backends

CPU

Problem description & steps to reproduce

Build fails on macOS Catalina (10.15) with Clang 14 when compiling tools/server/server-context.cpp.

The file server-http.h uses std::unordered_map but is missing the explicit #include <unordered_map>.
On recent macOS SDKs this header is pulled in transitively, but on the MacOSX10.15.sdk with Clang 14
it must be included explicitly, causing a hard build error.

Steps to reproduce:

  1. Clone the latest master on a Mac running macOS 10.15.7 (Intel)
  2. Use Clang 14 with MacOSX10.15.sdk
  3. Run the cmake command below and build with ninja

Proposed fix: add the following line at the top of tools/server/server-http.h:
#include <unordered_map>

First Bad Commit

The bug was not present in commit a290ce6 (version b9046).
It was introduced sometime after that commit during the server refactoring
(split into server-context.cpp / server-http.h).

Compile command

cmake .. -DGGML_METAL=OFF -DGGML_RPC=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBUILD_SHARED_LIBS=OFF -G Ninja

Relevant log output

[265/501] Building CXX object tools/server/CMakeFiles/server-context.dir/server-context.cpp.o
FAILED: tools/server/CMakeFiles/server-context.dir/server-context.cpp.o
In file included from /Users/walid/DEV/llama.cpp/tools/server/server-context.cpp:2:
In file included from /Users/walid/DEV/llama.cpp/tools/server/server-context.h:3:
/Users/walid/DEV/llama.cpp/tools/server/server-http.h:72:18: error: no template named 'unordered_map' in namespace 'std'
    mutable std::unordered_map<std::string, handler_t> handlers;
            ~~~~~^
1 warning and 1 error generated.
ninja: build stopped: subcommand failed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions