Skip to content

Commit

Permalink
refactor: build-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev committed May 9, 2024
1 parent 690a94f commit b6f7715
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions cortex-cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ all:
# Build the Cortex engine
build:
ifeq ($(OS),Windows_NT)
@powershell -Command "cmake -S ./nitro_deps -B ./build_deps/nitro_deps;"
@powershell -Command "cmake --build ./build_deps/nitro_deps --config Release -j4;"
@powershell -Command "cmake -S ./cortex-cpp-deps -B ./build-deps/cortex-cpp-deps;"
@powershell -Command "cmake --build ./build-deps/cortex-cpp-deps --config Release -j4;"
@powershell -Command "mkdir -p build; cd build; cmake .. $(CMAKE_EXTRA_FLAGS); cmake --build . --config Release -j4;"
else ifeq ($(shell uname -s),Linux)
@./install_deps.sh;
Expand All @@ -31,9 +31,9 @@ endif

package:
ifeq ($(OS),Windows_NT)
@powershell -Command "mkdir -p cortex-cpp\engines\cortex.llamacpp\; cp build\engines\cortex.llamacpp\engine.dll cortex\engines\cortex.llamacpp\;"
@powershell -Command "cp build\Release\nitro.exe .\cortex-cpp\;"
@powershell -Command "cp build_deps\_install\bin\zlib.dll .\cortex-cpp\;"
@powershell -Command "mkdir -p cortex-cpp\engines\cortex.llamacpp\; cp build\engines\cortex.llamacpp\engine.dll cortex-cpp\engines\cortex.llamacpp\;"
@powershell -Command "cp build\Release\cortex-cpp.exe .\cortex-cpp\;"
@powershell -Command "cp build-deps\_install\bin\zlib.dll .\cortex-cpp\;"
@powershell -Command "cp ..\.github\patches\windows\msvcp140.dll .\cortex-cpp\;"
@powershell -Command "cp ..\.github\patches\windows\vcruntime140_1.dll .\cortex-cpp\;"
@powershell -Command "cp ..\.github\patches\windows\vcruntime140.dll .\cortex-cpp\;"
Expand Down
16 changes: 8 additions & 8 deletions cortex-cpp/main.cc
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#include "utils/cortex_utils.h"
#include <climits> // for PATH_MAX
#include <drogon/HttpAppFramework.h>
#include <drogon/drogon.h>
#include <climits> // for PATH_MAX
#include <iostream>
#include "utils/cortex_utils.h"

#if defined(__APPLE__) && defined(__MACH__)
#include <libgen.h> // for dirname()
#include <libgen.h> // for dirname()
#include <mach-o/dyld.h>
#elif defined(__linux__)
#include <libgen.h> // for dirname()
#include <unistd.h> // for readlink()
#include <libgen.h> // for dirname()
#include <unistd.h> // for readlink()
#elif defined(_WIN32)
#include <windows.h>
#undef max
#else
#error "Unsupported platform!"
#endif

int main(int argc, char *argv[]) {
int main(int argc, char* argv[]) {
int thread_num = 1;
std::string host = "127.0.0.1";
int port = 3928;
Expand All @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {

// Check for port argument
if (argc > 3) {
port = std::atoi(argv[3]); // Convert string argument to int
port = std::atoi(argv[3]); // Convert string argument to int
}

// Uploads folder path
Expand All @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {

int logical_cores = std::thread::hardware_concurrency();
int drogon_thread_num = std::max(thread_num, logical_cores);
cortex_utils::nitro_logo();
// cortex_utils::nitro_logo();
#ifdef CORTEX_CPP_VERSION
LOG_INFO << "cortex-cpp version: " << CORTEX_CPP_VERSION;
#else
Expand Down

0 comments on commit b6f7715

Please sign in to comment.