From e8beac34e74b147526eec941650e0e2224c6c7e7 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Thu, 24 Aug 2023 13:17:51 +0100 Subject: [PATCH] more attempts to build with boost threads --- CMakeLists.txt | 10 +++++++--- src/CMakeLists.txt | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22c174d..13fa8e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required (VERSION 3.0) project(turbopilot VERSION 0.1.0) +option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) + + set(CMAKE_EXPORT_COMPILE_COMMANDS "on") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") @@ -27,9 +30,6 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES endif() -add_subdirectory(extern/ggml) -add_subdirectory(extern/argparse) -add_subdirectory(extern/spdlog) if (GGML_STATIC) SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a") @@ -38,6 +38,10 @@ if (GGML_STATIC) endif() +add_subdirectory(extern/ggml) +add_subdirectory(extern/argparse) +add_subdirectory(extern/spdlog) + add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a13809..dc4e493 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,6 +17,9 @@ add_executable(${TURBOPILOT_TARGET} ../include/turbopilot/starcoder.hpp ) +set(THREADS_PREFER_PTHREAD_FLAG TRUE) +find_package(Threads REQUIRED) + target_include_directories(${TURBOPILOT_TARGET} PRIVATE ../include @@ -26,7 +29,7 @@ target_include_directories(${TURBOPILOT_TARGET} PRIVATE -target_link_libraries(${TURBOPILOT_TARGET} PRIVATE ggml argparse Boost::thread) +target_link_libraries(${TURBOPILOT_TARGET} PRIVATE ggml argparse Threads::Threads) #target_link_libraries(${TURBOPILOT_TARGET} PRIVATE spdlog::spdlog_header_only) \ No newline at end of file