mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-01-26 17:20:01 +00:00
Fix windows build with CUDA (#1101)
Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
@@ -8,9 +8,6 @@ set(CMAKE_WARN_UNUSED_CLI YES)
|
|||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED true)
|
set(CMAKE_CXX_STANDARD_REQUIRED true)
|
||||||
if(MSVC)
|
|
||||||
add_compile_options(/permissive- /Zc:__cplusplus)
|
|
||||||
endif()
|
|
||||||
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0)
|
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0)
|
||||||
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
|
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
|
||||||
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
|
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
|
||||||
|
|||||||
@@ -96,11 +96,5 @@ endif()
|
|||||||
if (WIN32)
|
if (WIN32)
|
||||||
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
|
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC)
|
|
||||||
set_target_properties(${TARGET} PROPERTIES
|
|
||||||
CXX_STANDARD 17
|
|
||||||
CXX_STANDARD_REQUIRED ON
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_features(${TARGET} PRIVATE cxx_std_17)
|
target_compile_features(${TARGET} PRIVATE cxx_std_17)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ struct DatabaseHandle {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
using json = nlohmann::ordered_json;
|
using json = nlohmann::ordered_json;
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
bool server_verbose = false;
|
bool server_verbose = false;
|
||||||
bool server_log_json = true;
|
bool server_log_json = true;
|
||||||
@@ -1310,7 +1311,6 @@ int main(int argc, char ** argv) {
|
|||||||
|
|
||||||
const auto list_saved_prompts = [&ctx_server, ¶ms](const httplib::Request& req, httplib::Response& res) {
|
const auto list_saved_prompts = [&ctx_server, ¶ms](const httplib::Request& req, httplib::Response& res) {
|
||||||
json response = json::array();
|
json response = json::array();
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (const auto& entry : fs::directory_iterator(params.slot_save_path)) {
|
for (const auto& entry : fs::directory_iterator(params.slot_save_path)) {
|
||||||
|
|||||||
@@ -1540,6 +1540,12 @@ target_compile_definitions(ggml PRIVATE $<$<CONFIG:Release>:NDEBUG>)
|
|||||||
target_include_directories(ggml PUBLIC ../include)
|
target_include_directories(ggml PUBLIC ../include)
|
||||||
target_include_directories(ggml PRIVATE . ${GGML_EXTRA_INCLUDES})
|
target_include_directories(ggml PRIVATE . ${GGML_EXTRA_INCLUDES})
|
||||||
target_link_directories(ggml PRIVATE ${GGML_EXTRA_LIBDIRS})
|
target_link_directories(ggml PRIVATE ${GGML_EXTRA_LIBDIRS})
|
||||||
|
if(MSVC)
|
||||||
|
set_target_properties(ggml PROPERTIES
|
||||||
|
CUDA_STANDARD 17
|
||||||
|
CUDA_STANDARD_REQUIRED ON
|
||||||
|
)
|
||||||
|
endif()
|
||||||
target_compile_features (ggml PRIVATE c_std_11) # don't bump
|
target_compile_features (ggml PRIVATE c_std_11) # don't bump
|
||||||
|
|
||||||
target_link_libraries(ggml PRIVATE Threads::Threads ${GGML_EXTRA_LIBS})
|
target_link_libraries(ggml PRIVATE Threads::Threads ${GGML_EXTRA_LIBS})
|
||||||
|
|||||||
@@ -78,12 +78,12 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cplusplus >= 202000L
|
//#if __cplusplus >= 202000L
|
||||||
#define LU8(x) (const char*)(u8##x)
|
// #define LU8(x) (const char*)(u8##x)
|
||||||
#else
|
//#else
|
||||||
#define LU8(x) u8##x
|
// #define LU8(x) u8##x
|
||||||
#endif
|
//#endif
|
||||||
|
#define LU8(x) (const char*)(u8##x)
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|||||||
Reference in New Issue
Block a user