Skip to content

Building llama.cpp in Linux for Linux and WIndows #1839

Answered by SlyEcho
thesimpleone asked this question in Q&A
Discussion options

You must be logged in to vote

Yes.

You need to use the MinGW cross compilers, here's an example Dockerfile that I made some time ago:

Dockerfile
FROM debian AS build

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
        g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 cmake build-essential

WORKDIR /src
RUN printf '\
# the name of the target operating system\n\
set(CMAKE_SYSTEM_NAME Windows)\n\
set(CMAKE_SYSTEM_PROCESSOR x86_64)\n\
\
# which compilers to use for C and C++\\n\
set(CMAKE_C_COMPILER   /usr/bin/x86_64-w64-mingw32-gcc-posix)\n\
set(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++-posix)\n\
\
# where is the target environment located\n\
set(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@thesimpleone
Comment options

@SlyEcho
Comment options

SlyEcho Jun 20, 2023
Collaborator

Answer selected by thesimpleone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants