File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ install_deps() {
3131 install_zlib
3232
3333 install_rdkafka
34+
35+ install_rust
3436}
3537
3638install_dev_deps () {
@@ -61,6 +63,7 @@ ENABLE_STATIC=yes
6163 --with-rdkafka \
6264 --enable-jchash \
6365 --enable-simdjson \
66+ --enable-llm \
6467 --with-openssl --with-zlib --with-zip \
6568 --enable-filter \
6669 --with-curl \
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ SWOOLE_REV="3e1a1f89930ba0bbea1f5ee31bcd0ee701a87aab"
1414RDKAFKA_REV=" 53398031f1cd96e437e9705b67b4dc19d955acb6"
1515JCHASH_REV=" 8ed50cc8c211effe1c214eae1e3240622e0f11b0"
1616SIMDJSON_REV=" 9a2745669fea733a40f9443b1a793846d0759b89"
17+ LLM_REV=" 5d31060ec962d4b13b3e429cbfe4aaca38711047"
1718SKIP_SYSTEM_DEPS=" $2 "
1819BUILD_DEV=" $3 "
1920BUILD_STATIC=1 # Always build static but dev
7980fi
8081cd ..
8182
83+ # llm
84+ git clone https://github.com/manticoresoftware/llm-php-ext.git llm
85+ cd llm && git checkout " $LLM_REV "
86+ cd ..
87+
88+ # Build llm extension statically
89+ cd ext/llm
90+ if [ " $( uname) " == " Darwin" ]; then
91+ # macOS: Use LLVM 17 from Homebrew
92+ LIBCLANG_PATH=" /opt/homebrew/opt/llvm@17/lib"
93+ LLVM_CONFIG_PATH=" /opt/homebrew/opt/llvm@17/bin/llvm-config"
94+ LLVM_PATH=" /opt/homebrew/opt/llvm@17/bin"
95+ LIBCLANG_PATH=" $LIBCLANG_PATH " LLVM_CONFIG_PATH=" $LLVM_CONFIG_PATH " PATH=" $LLVM_PATH :$PATH " cargo build --release --features static
96+ else
97+ # Linux
98+ cargo build --release --features static
99+ fi
100+ cd ../..
101+
82102cd ..
83103
84104BUILD_EXTRA=()
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ set -xe
1818install_deps () {
1919 sudo apt-get update -y
2020 sudo apt-get install -y curl build-essential autoconf automake bison re2c libzstd-dev pkg-config git libssl-dev zlib1g-dev libzip-dev libonig-dev cmake libcurl4-openssl-dev libzip-dev librdkafka-dev libiconv-hook-dev
21+
22+ install_rust
2123}
2224
2325install_dev_deps () {
@@ -47,6 +49,7 @@ ENABLE_STATIC=yes
4749 --with-rdkafka \
4850 --enable-jchash \
4951 --enable-simdjson \
52+ --enable-llm \
5053 --with-openssl --with-zlib --with-zip --with-iconv \
5154 --enable-filter \
5255 --with-curl \
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ install_deps() {
2121 export CPPFLAGS=" -I${OPENSSL_PREFIX} /include -I${LIBRDKAFKA_PREFIX} /include -I${ICONV_PREFIX} /include"
2222
2323 export PKG_CONFIG_PATH=" ${OPENSSL_PREFIX} /lib/pkgconfig"
24+
25+ install_rust
2426}
2527
2628install_dev_deps () {
@@ -95,6 +97,7 @@ chmod +x configure
9597 --with-rdkafka \
9698 --enable-jchash \
9799 --enable-simdjson \
100+ --enable-llm \
98101 --with-openssl --with-zlib --with-zip --with-iconv=$( brew --prefix libiconv) \
99102 --enable-filter \
100103 --with-curl \
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -ex
33
4+ install_rust () {
5+ # Install Rust toolchain
6+ curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
7+ # Source cargo environment
8+ . " $HOME /.cargo/env"
9+ # Install cargo-php for building PHP extensions
10+ cargo install cargo-php --locked
11+ }
12+
413install_curl () {
514 test -d curl-8.0.0 && rm -fr " $_ "
615 curl -sSL https://github.com/curl/curl/releases/download/curl-8_0_0/curl-8.0.0.tar.gz | tar -xzf -
You can’t perform that action at this time.
0 commit comments