kherud/java-llama.cpp

How build project on windows?

Maxon081102 opened this issue · 4 comments

Hello, how build project on windows? instruction doesn't work, I run it through w64devkit

Hi @Maxon081102 can you please share what commands you typed in and what the error output was?

yes, @kherud
mvn compile

[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< de.kherud:llama >---------------------------
[INFO] Building de.kherud:llama 2.3.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ llama ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory XXX\llama\java-llama.cpp\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.11.0:compile (default-compile) @ llama ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 8 source files with javac [debug target 1.8] to target\classes
[WARNING] bootstrap class path not set in conjunction with -source 8
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.004 s
[INFO] Finished at: 2024-01-15T06:48:08-08:00
[INFO] ------------------------------------------------------------------------

mkdir build
cd build/

cmake ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.22621.
-- The CXX compiler identification is MSVC 19.29.30152.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is MSVC 19.29.30152.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: C:/Program Files/choco_packages/ide_git/cmd/git.exe (found version "2.39.1.windows.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- CMAKE_GENERATOR_PLATFORM:
-- x86 detected
-- Performing Test HAS_AVX_1
-- Performing Test HAS_AVX_1 - Success
-- Performing Test HAS_AVX2_1
-- Performing Test HAS_AVX2_1 - Success
-- Performing Test HAS_FMA_1
-- Performing Test HAS_FMA_1 - Success
-- Performing Test HAS_AVX512_1
-- Performing Test HAS_AVX512_1 - Failed
-- Performing Test HAS_AVX512_2
-- Performing Test HAS_AVX512_2 - Failed
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- CMAKE_GENERATOR_PLATFORM:
-- x86 detected
-- Found Java: C:/Program Files/choco_packages/jdk11/jdk-11.0.2/bin/java.exe (found version "11.0.2")
-- Installing files to XXX/llama/java-llama.cpp/src/main/resources/de/kherud/llama/Windows/x86_64
-- Configuring done (51.9s)
-- Generating done (0.2s)
-- Build files have been written to: XXX/llama/java-llama.cpp/build

cmake --build . --config Release

Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

1>Checking Build System
Generating build details from Git
-- Found Git: C:/Program Files/choco_packages/ide_git/cmd/git.exe (found version "2.39.1.windows.1")
Building Custom Rule XXX/llama/java-llama.cpp/build/_deps/llama.cpp-src/common/CMakeLists.txt
build-info.cpp
build_info.vcxproj -> XXX\llama\java-llama.cpp\build_deps\llama.cpp-build\common\build_info.dir\Release\build_info.lib
Building Custom Rule XXX/llama/java-llama.cpp/build/_deps/llama.cpp-src/CMakeLists.txt
ggml.c
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_search.h(188,5): warning C5105: macro expansion producing 'defined' has undefined behavior XXX\llama\java-llama.cpp\build_deps\llama.cpp-build\ggml.vcxproj]
...
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\propidlbase.h(378,37): error C2371: 'pvarVal': redefinition; different basic types [XXX\llama\java-
llama.cpp\build_deps\llama.cpp-build\ggml.vcxproj]

@kherud can you help me, please?

I just released version 3.0 of the library and will close this issue for now. Feel free to re-open if you still need help.