From: Georgi Gerganov Date: Sat, 29 Apr 2023 16:13:53 +0000 (+0300) Subject: ggml : fix SHARED build X-Git-Tag: upstream/0.0.1642~1506 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=b237714db49cc09b63a372aeb33ca83bc56b3977;p=pkg%2Fggml%2Fsources%2Fggml ggml : fix SHARED build --- diff --git a/include/ggml/ggml.h b/include/ggml/ggml.h index 38ae9a6e..c1c5495c 100644 --- a/include/ggml/ggml.h +++ b/include/ggml/ggml.h @@ -701,8 +701,8 @@ extern "C" { struct ggml_tensor * c1); // Mapping operations - GGML_API typedef void (*ggml_unary_op_f32_t)(const int, float *, const float *); - GGML_API typedef void (*ggml_binary_op_f32_t)(const int, float *, const float *, const float *); + typedef void (*ggml_unary_op_f32_t)(const int, float *, const float *); + typedef void (*ggml_binary_op_f32_t)(const int, float *, const float *, const float *); GGML_API struct ggml_tensor * ggml_map_unary_f32( struct ggml_context * ctx, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c3754040..26f14b1f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -212,6 +212,10 @@ if (BUILD_SHARED_LIBS) target_compile_definitions(${TARGET} PUBLIC GGML_SHARED ) + + target_compile_definitions(${TARGET} PRIVATE + GGML_BUILD + ) endif() target_compile_definitions(${TARGET} PUBLIC diff --git a/src/ggml.c b/src/ggml.c index 6b923718..ebbaf11c 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -9124,7 +9124,7 @@ static void ggml_compute_forward_alibi_f32( //const int nb3 = src0->nb[3]; assert(nb0 == sizeof(float)); - assert(ne1+n_past == ne0); + assert(ne1 + n_past == ne0); (void) n_past; // add alibi to src0 (KQ_scaled) const int n_heads_log2_floor = 1 << (int) floor(log2(n_head)); @@ -9185,7 +9185,7 @@ static void ggml_compute_forward_alibi_f16( //const int nb3 = src0->nb[3]; assert(nb0 == sizeof(ggml_fp16_t)); - assert(ne1+n_past == ne0); + assert(ne1 + n_past == ne0); (void) n_past; // add alibi to src0 (KQ_scaled) const int n_heads_log2_floor = 1 << (int) floor(log2(n_head));