all:
make -C org.argeo.tp.sys
+ make -C org.argeo.tp.ml
+
install:
make -C org.argeo.tp.sys install
+ make -C org.argeo.tp.ml install
uninstall:
make -C org.argeo.tp.sys uninstall
+ make -C org.argeo.tp.ml uninstall
clean:
make -C org.argeo.tp.sys clean
+ make -C org.argeo.tp.ml clean
\ No newline at end of file
A2_CATEGORY = org.argeo.tp.ml
+JLAMA_JNI_SRC=jni/com_github_tjake_jlama
+JLAMA_TARGET_EXEC=libjlama.so
+
## FIXME - DON'T FORGET TO UPDATE THE VERSION IN THE RELATED bnd.bnd FILE!
JLLAMA_BRANCH=3.3
JLLAMA_VERSION=$(JLLAMA_BRANCH).0
LLAMA3_COMMIT=5f602500beb593dce2726df7e2dd08b0803aa86b
LLAMA3_VERSION=0.1.0
-all: retrieve-jllama retrieve-llama3 osgi
+JLAMA_BRANCH=0.2
+JLAMA_VERSION=$(JLAMA_BRANCH).1
+
+all: retrieve-jllama retrieve-llama3 retrieve-jlama osgi jni-jlama
mkdir -p $(SDK_BUILD_BASE)/a2/$(TARGET_ARCH_CATEGORY_PREFIX)/$(A2_CATEGORY)
mv $(SDK_BUILD_BASE)/a2/$(A2_CATEGORY)/de.kherud.llama.$(JLLAMA_BRANCH).jar $(SDK_BUILD_BASE)/a2/$(TARGET_ARCH_CATEGORY_PREFIX)/$(A2_CATEGORY)
+ mv $(SDK_BUILD_BASE)/a2/$(A2_CATEGORY)/com.github.tjake.jlama.native.$(JLAMA_BRANCH).jar $(SDK_BUILD_BASE)/a2/$(TARGET_ARCH_CATEGORY_PREFIX)/$(A2_CATEGORY)
install:
mkdir -p $(A2_NATIVE_INSTALL_TARGET)/$(A2_CATEGORY)
git -C $(SRC_DIR) checkout $(LLAMA3_COMMIT)
rm -rf $(SRC_DIR)/.git
+retrieve-jlama: SRC_DIR=src/jlama
+retrieve-jlama:
+ rm -rf $(SRC_DIR)
+ mkdir -p $(SRC_DIR)
+ git clone --branch v$(JLAMA_VERSION) https://github.com/tjake/Jlama.git $(SRC_DIR)
+ rm -rf $(SRC_DIR)/.git
+ rsync -a --delete --exclude module-info.java $(SRC_DIR)/jlama-native/src/main/java/ com.github.tjake.jlama.native/src
+ # future: rsync -a --delete --exclude module-info.java $(SRC_DIR)/jlama-native/src/main/java21/ com.github.tjake.jlama.native/src
+ rsync -a --delete --exclude module-info.java $(SRC_DIR)/jlama-native/src/main/c/ $(JLAMA_JNI_SRC)
+
BUNDLES = \
de.kherud.llama \
com.llama4j \
+com.github.tjake.jlama.native \
+
clean:
rm -rf $(BUILD_BASE)
+DEP_CATEGORIES = \
+log/syslogger/org.argeo.tp \
+org.argeo.tp.ml
+
include $(SDK_SRC_BASE)/sdk/argeo-build/osgi.mk
+
+A2_NATIVE_CATEGORY=$(A2_OUTPUT)/lib/linux/$(shell uname -m)/$(A2_CATEGORY)
+
+jni-jlama:
+ mkdir -p $(A2_NATIVE_CATEGORY)
+ $(CC) -o $(A2_NATIVE_CATEGORY)/$(JLAMA_TARGET_EXEC) \
+ -O3 -mavx2 -march=native -Werror -Wno-attributes -fPIC -fno-omit-frame-pointer -Wunused-variable \
+ -shared -fPIC -fpic -Wl,-soname,$(JLAMA_TARGET_EXEC).$(JLAMA_BRANCH) \
+ -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(JLAMA_JNI_SRC)/*.c
--- /dev/null
+Manifest-Version: 1.0\r
+Bundle-ManifestVersion: 2\r
+Export-Package: com.github.tjake.jlama.tensor.operations;uses:="com.gith\r
+ ub.tjake.jlama.safetensors,com.github.tjake.jlama.tensor",com.github.tj\r
+ ake.jlama.tensor.operations.cnative\r
+Import-Package: com.github.tjake.jlama.safetensors,com.github.tjake.jlam\r
+ a.tensor,com.github.tjake.jlama.tensor.operations.cnative,com.github.tj\r
+ ake.jlama.util,java.io,java.lang,java.lang.foreign,java.lang.invoke,jav\r
+ a.net,java.nio.file,java.nio.file.attribute,java.util,java.util.functio\r
+ n,org.slf4j\r
+Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=20))"\r
+Bundle-RequiredExecutionEnvironment: JavaSE-20\r
+Bundle-Version: 0.2.1.next\r
+Automatic-Module-Name: com.github.tjake.jlama.native\r
+Bundle-SymbolicName: com.github.tjake.jlama.native\r
+Bundle-Name: com.github.tjake.jlama.native\r
+\r
--- /dev/null
+
+major: 0
+minor: 2
+micro: 1
+
+Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=20))"
+Bundle-RequiredExecutionEnvironment: JavaSE-20
\ No newline at end of file
--- /dev/null
+*.h
+*.c
+*.sh
+com_github_tjake_jlama
org.argeo.tp.jcr \
org.argeo.tp.office \
org.argeo.tp.earth \
+org.argeo.tp.ml \
crypto/full/org.argeo.tp.crypto \
install-for-minimal-cms:
--- /dev/null
+#FIXME: keep version in sync with sys!
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.1
+Argeo-Origin-NoMetadataGeneration: true
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: com.google.re2j:re2j:1.7
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: com.hubspot.jinjava:jinjava:2.7.2
+Import-Package:\
+*;resolution:="optional"
--- /dev/null
+Argeo-Origin-M2: com.github.tjake:jlama-core
+Import-Package:\
+org.jctools.queues,\
+*
--- /dev/null
+Argeo-Origin-M2: com.github.tjake:jlama-native
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: :0.2.1
+Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=20))"
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: :0.33.0
--- /dev/null
+Argeo-Origin-M2: dev.langchain4j:langchain4j
--- /dev/null
+Argeo-Origin-M2: dev.langchain4j:langchain4j-core
--- /dev/null
+Argeo-Origin-M2: dev.langchain4j:langchain4j-jlama
+Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=20))"
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: :2.4.0
--- /dev/null
+Argeo-Origin-M2: org.apache.opennlp:opennlp-tools
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: org.jctools:jctools-core:4.0.5
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: org.yaml:snakeyaml:2.3
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+# Note: Used only by langchain
+Argeo-Origin-M2: com.google.code.gson:gson:2.11.0
SPDX-License-Identifier: Apache-2.0
-# Note: Used only by h2gis
+# Note: Used only by h2gis and jlama
Argeo-Origin-M2: com.google.guava:guava:33.2.1-jre
Bundle-Version: 33.2.1.jre
Import-Package:\
--- /dev/null
+SPDX-License-Identifier: MIT
+Argeo-Origin-M2: org.jsoup:jsoup:1.18.1
--- /dev/null
+SPDX-License-Identifier: Apache-2.0
+Argeo-Origin-M2: org.jspecify:jspecify:1.0.0
<location path="${project_loc:argeo-tp}/../output/a2/org.argeo.tp.earth" type="Directory"/>
<location path="${project_loc:argeo-tp}/../output/a2/osgi/equinox/org.argeo.tp.eclipse" type="Directory"/>
<location path="${project_loc:argeo-tp}/../output/a2/org.argeo.tp.jcr" type="Directory"/>
+ <location path="${project_loc:argeo-tp}/../output/a2/org.argeo.tp.ml" type="Directory"/>
+ <location path="${project_loc:argeo-tp}/../output/a2/lib/linux/x86_64/org.argeo.tp.ml" type="Directory"/>
<location type="Target" uri="file:${project_loc:argeo-tp}/sdk/output-argeo-tp-platform.target"/>
</locations>
</target>
\ No newline at end of file