From fdeefc0edce71be0d94697ec71d52683ac807e60 Mon Sep 17 00:00:00 2001 From: rabidcopy Date: Tue, 11 Apr 2023 13:47:43 -0500 Subject: [PATCH 1/2] fix compile error? --- expose.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/expose.cpp b/expose.cpp index 04ff404d455..96e41c6f731 100644 --- a/expose.cpp +++ b/expose.cpp @@ -36,8 +36,8 @@ extern "C" int devices = inputs.clblast_info%10; std::string platformenv = "KCPP_CLBLAST_PLATFORM="+std::to_string(platform); std::string deviceenv = "KCPP_CLBLAST_DEVICES="+std::to_string(devices); - putenv(platformenv.c_str()); - putenv(deviceenv.c_str()); + putenv(const_cast(platformenv.c_str())); + putenv(const_cast(deviceenv.c_str())); if(file_format==FileFormat::GPTJ_1 || file_format==FileFormat::GPTJ_2 || file_format==FileFormat::GPTJ_3) { @@ -103,4 +103,4 @@ extern "C" return llama_generate(inputs, output); } } -} \ No newline at end of file +} From 7d5ee6bef78983bdf8d1c79c26835cbf20ac89ea Mon Sep 17 00:00:00 2001 From: rabidcopy Date: Tue, 11 Apr 2023 18:09:10 -0500 Subject: [PATCH 2/2] Update expose.cpp --- expose.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/expose.cpp b/expose.cpp index 96e41c6f731..6893882dafc 100644 --- a/expose.cpp +++ b/expose.cpp @@ -36,8 +36,8 @@ extern "C" int devices = inputs.clblast_info%10; std::string platformenv = "KCPP_CLBLAST_PLATFORM="+std::to_string(platform); std::string deviceenv = "KCPP_CLBLAST_DEVICES="+std::to_string(devices); - putenv(const_cast(platformenv.c_str())); - putenv(const_cast(deviceenv.c_str())); + putenv((char*)platformenv.c_str()); + putenv((char*)deviceenv.c_str()); if(file_format==FileFormat::GPTJ_1 || file_format==FileFormat::GPTJ_2 || file_format==FileFormat::GPTJ_3) {