From 6d479decd7854118b2a608e8f6ae5b243f99a453 Mon Sep 17 00:00:00 2001 From: Chad Brewbaker Date: Mon, 3 Apr 2023 17:21:51 -0500 Subject: [PATCH] Added support to compile MPI on Darwin --- Makefile | 8 ++++++++ ggml.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 2f828bf10..b4ce1f7ff 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,14 @@ ifdef LLAMA_GPROF CFLAGS += -pg CXXFLAGS += -pg endif +ifdef LLAMA_MPI_DARWIN + CFLAGS += -I/opt/homebrew/include + CXXFLAGS += -I/opt/homebrew/include + CC = mpicc + CXX = mpic++ +endif + + ifneq ($(filter aarch64%,$(UNAME_M)),) CFLAGS += -mcpu=native CXXFLAGS += -mcpu=native diff --git a/ggml.h b/ggml.h index ec28d828b..a2b73c863 100644 --- a/ggml.h +++ b/ggml.h @@ -176,7 +176,10 @@ extern "C" { #include #include #include + +#ifdef LLAMA_MPI_DARWIN #include +#endif #define GGML_MAX_DIMS 4 #define GGML_MAX_NODES 4096