Skip to content

Commit

Permalink
Merge branch 'Mozilla-Ocho:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tybalex committed Jun 29, 2024
2 parents 519de53 + b2f587c commit bfb377e
Show file tree
Hide file tree
Showing 120 changed files with 564,808 additions and 352 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ include build/rules.mk

include llamafile/BUILD.mk
include llama.cpp/BUILD.mk
include stable-diffusion.cpp/BUILD.mk
include double-conversion/BUILD.mk
include stb/BUILD.mk

# the root package is `o//` by default
# building a package also builds its sub-packages
.PHONY: o/$(MODE)/
o/$(MODE)/: o/$(MODE)/llama.cpp o/$(MODE)/llamafile o/$(MODE)/depend.test
o/$(MODE)/: o/$(MODE)/llamafile \
o/$(MODE)/llama.cpp \
o/$(MODE)/stb \
o/$(MODE)/depend.test

# for installing to `make PREFIX=/usr/local`
.PHONY: install
Expand Down
9 changes: 5 additions & 4 deletions build/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘

PREFIX = /usr/local
COSMOCC = .cosmocc/3.3.10
COSMOCC = .cosmocc/3.5.1
TOOLCHAIN = $(COSMOCC)/bin/cosmo

AR = $(TOOLCHAIN)ar
Expand All @@ -13,7 +13,8 @@ MKDEPS = $(COSMOCC)/bin/mkdeps
INSTALL = install

ARFLAGS = rcsD
CCFLAGS = -g -O3 -fexceptions -fsignaling-nans
CXXFLAGS = -frtti -std=gnu++23
CCFLAGS = -g -ggdb -O3 -fexceptions -fsignaling-nans -ffunction-sections -fdata-sections
CPPFLAGS_ = -iquote. -mcosmo -DGGML_MULTIPLATFORM -Wno-attributes -DLLAMAFILE_DEBUG
TARGET_ARCH = -Xx86_64-mavx -Xx86_64-mtune=znver4

Expand Down Expand Up @@ -51,5 +52,5 @@ clean:; rm -rf o
.PHONY: distclean
distclean:; rm -rf o .cosmocc

.cosmocc/3.3.10:
build/download-cosmocc.sh $@ 3.3.10 00d61c1215667314f66e288c8285bae38cc6137fca083e5bba6c74e3a52439de
.cosmocc/3.5.1:
build/download-cosmocc.sh $@ 3.5.1 ea1f47cd4ead6ce3038551be164ad357bd45a4b5b7824871c561d2af23f871d6
9 changes: 5 additions & 4 deletions build/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ o/$(MODE)/%.o: %.cc $(COSMOCC)
@mkdir -p $(@D)
$(COMPILE.cc) -o $@ $<

o/$(MODE)/%.o: %.cc $(COSMOCC)
@mkdir -p $(@D)
$(COMPILE.cc) -o $@ $<

o/$(MODE)/%.o: %.cpp $(COSMOCC)
@mkdir -p $(@D)
$(COMPILE.cc) -o $@ $<
Expand All @@ -41,8 +45,5 @@ o/$(MODE)/%.zip.o: % $(COSMOCC)
$(ZIPOBJ) $(ZIPOBJ_FLAGS) -a aarch64 -o $(dir $@)/.aarch64/$(notdir $@) $<

$(PREFIX)/bin/ape: $(COSMOCC) # cosmocc toolchain setup in restricted ci context
# Install ape loader
$(INSTALL) $(COSMOCC)/bin/ape-$(ARCH).elf $(PREFIX)/bin/ape

# Config binfmt_misc to use ape loader for ape.elf files
echo ':APE:M::MZqFpD::/usr/bin/ape:' > /proc/sys/fs/binfmt_misc/register
echo ':APE:M::MZqFpD::/usr/bin/ape:' > /proc/sys/fs/binfmt_misc/register
1 change: 1 addition & 0 deletions double-conversion/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.os
16 changes: 16 additions & 0 deletions double-conversion/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Below is a list of people and organizations that have contributed
# to the double-conversion project. Names should be added to the
# list like so:
#
# Name/Organization <email address>

Google Inc.
Mozilla Foundation

Jeff Muizelaar <[email protected]>
Mike Hommey <[email protected]>
Martin Olsson <[email protected]>
Kent Williams <[email protected]>
Elan Ruusamäe <[email protected]>
Colin Hirsch <[email protected]>
Zhenyi Peng <[email protected]>
16 changes: 16 additions & 0 deletions double-conversion/BUILD.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘

PKGS += DOUBLE_CONVERSION

DOUBLE_CONVERSION_FILES := $(wildcard double-conversion/*)
DOUBLE_CONVERSION_HDRS = $(filter %.h,$(DOUBLE_CONVERSION_FILES))
DOUBLE_CONVERSION_SRCS = $(filter %.cc,$(DOUBLE_CONVERSION_FILES))
DOUBLE_CONVERSION_OBJS = $(DOUBLE_CONVERSION_SRCS:%.cc=o/$(MODE)/%.o)

o/$(MODE)/double-conversion/double-conversion.a: $(DOUBLE_CONVERSION_OBJS)

$(DOUBLE_CONVERSION_OBJS): double-conversion/BUILD.mk

.PHONY: o/$(MODE)/double-conversion
o/$(MODE)/double-conversion: o/$(MODE)/double-conversion/double-conversion.a
26 changes: 26 additions & 0 deletions double-conversion/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright 2006-2011, the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions double-conversion/README.llamafile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DESCRIPTION

Converts floating point numbers to strings

LICENSE

BSD-3

ORIGIN

[email protected]:google/double-conversion.git
75b48d66ac835da2c1678926f7d61d6cb2992922
Tue May 21 10:45:11 2024 +0200

LOCAL MODIFICATIONS

- Ignored compiler warning
12 changes: 12 additions & 0 deletions double-conversion/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
double_conversion_sources = [
'bignum.cc',
'bignum-dtoa.cc',
'cached-powers.cc',
'double-to-string.cc',
'fast-dtoa.cc',
'fixed-dtoa.cc',
'string-to-double.cc',
'strtod.cc'
]
Return('double_conversion_sources')
Loading

0 comments on commit bfb377e

Please sign in to comment.