fix build?

This commit is contained in:
James Ravenscroft 2023-08-24 13:49:14 +01:00
parent 22f2993db4
commit f69a8f65d4
2 changed files with 22 additions and 13 deletions

View File

@ -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)

View File

@ -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)
target_link_libraries(${TURBOPILOT_TARGET} PRIVATE ggml argparse)