From f69a8f65d4e061f44809316cb058ae52348ce696 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Thu, 24 Aug 2023 13:49:14 +0100 Subject: [PATCH] fix build? --- CMakeLists.txt | 24 ++++++++++++++++++------ src/CMakeLists.txt | 11 ++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13fa8e9..45a9fe7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,14 @@ cmake_minimum_required (VERSION 3.0) project(turbopilot VERSION 0.1.0) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED true) +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED true) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) -option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) + +# option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS "on") @@ -31,17 +38,22 @@ endif() -if (GGML_STATIC) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a") - SET(BUILD_SHARED_LIBS OFF) - SET(CMAKE_EXE_LINKER_FLAGS "-static") -endif() add_subdirectory(extern/ggml) add_subdirectory(extern/argparse) add_subdirectory(extern/spdlog) +if (GGML_STATIC) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + SET(BUILD_SHARED_LIBS OFF) + SET(CMAKE_EXE_LINKER_FLAGS "-static") + + # if(GGML_OPENBLAS) + # set(BLA_STATIC ON) + # endif() +endif() + add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dc4e493..d2c687e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,8 +17,8 @@ add_executable(${TURBOPILOT_TARGET} ../include/turbopilot/starcoder.hpp ) -set(THREADS_PREFER_PTHREAD_FLAG TRUE) -find_package(Threads REQUIRED) +#set(THREADS_PREFER_PTHREAD_FLAG TRUE) +#find_package(Threads REQUIRED) target_include_directories(${TURBOPILOT_TARGET} PRIVATE @@ -27,9 +27,6 @@ target_include_directories(${TURBOPILOT_TARGET} PRIVATE ../extern/crow/include ) +#target_compile_features(${TURBOPILOT_TARGET} PRIVATE cxx_std_11) - -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 +target_link_libraries(${TURBOPILOT_TARGET} PRIVATE ggml argparse) \ No newline at end of file