Skip to content

Commit

Permalink
Merge 3.2 to edge (#738)
Browse files Browse the repository at this point in the history
Note that this is unlikely to contain everything that 3.2 will have, but
it does contain the big ones like lagoon and directed messaging support
and I want to start testing all of this stuff with 411.
  • Loading branch information
pkova authored Oct 22, 2024
2 parents a537c85 + c337d9a commit 063f968
Show file tree
Hide file tree
Showing 68 changed files with 13,246 additions and 424 deletions.
1 change: 0 additions & 1 deletion .github/workflows/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:
-Dpace=${{inputs.pace}} \
--summary all
fi
- name: Run unit tests
run: |
zig build \
Expand Down
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
Empty file.
117 changes: 117 additions & 0 deletions bazel/third_party/softblas/softblas.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# FILEPATH: /home/neal/lagoon/vere/bazel/third_party/softblas/softblas.BUILD

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

cc_library(
name = "softblas",
visibility = ["//visibility:public"],
deps = select({
"@platforms//cpu:aarch64": [":softblas_aarch64"],
"@platforms//cpu:x86_64": [":softblas_x86_64"],
"//conditions:default": [],
}),
)

cc_library(
name = "softblas_aarch64",
visibility = ["//visibility:public"],
hdrs = ["include/softblas.h"],
includes = ["include"],
srcs = [
"include/softblas.h",
"src/softblas_state.c",
"src/blas/level1/sasum.c",
"src/blas/level1/dasum.c",
"src/blas/level1/hasum.c",
"src/blas/level1/qasum.c",
"src/blas/level1/saxpy.c",
"src/blas/level1/daxpy.c",
"src/blas/level1/haxpy.c",
"src/blas/level1/qaxpy.c",
"src/blas/level1/scopy.c",
"src/blas/level1/dcopy.c",
"src/blas/level1/hcopy.c",
"src/blas/level1/qcopy.c",
"src/blas/level1/sdot.c",
"src/blas/level1/ddot.c",
"src/blas/level1/hdot.c",
"src/blas/level1/qdot.c",
"src/blas/level1/snrm2.c",
"src/blas/level1/dnrm2.c",
"src/blas/level1/hnrm2.c",
"src/blas/level1/qnrm2.c",
"src/blas/level1/sscal.c",
"src/blas/level1/dscal.c",
"src/blas/level1/hscal.c",
"src/blas/level1/qscal.c",
"src/blas/level1/sswap.c",
"src/blas/level1/dswap.c",
"src/blas/level1/hswap.c",
"src/blas/level1/qswap.c",
"src/blas/level1/isamax.c",
"src/blas/level1/idamax.c",
"src/blas/level1/ihamax.c",
"src/blas/level1/iqamax.c",
"src/blas/level2/sgemv.c",
"src/blas/level2/dgemv.c",
"src/blas/level2/hgemv.c",
"src/blas/level2/qgemv.c",
"src/blas/level3/sgemm.c",
"src/blas/level3/dgemm.c",
"src/blas/level3/hgemm.c",
"src/blas/level3/qgemm.c"
],
deps = ["@softfloat"],
)

cc_library(
name = "softblas_x86_64",
visibility = ["//visibility:public"],
hdrs = ["include/softblas.h"],
includes = ["include"],
srcs = [
"include/softblas.h",
"src/softblas_state.c",
"src/blas/level1/sasum.c",
"src/blas/level1/dasum.c",
"src/blas/level1/hasum.c",
"src/blas/level1/qasum.c",
"src/blas/level1/saxpy.c",
"src/blas/level1/daxpy.c",
"src/blas/level1/haxpy.c",
"src/blas/level1/qaxpy.c",
"src/blas/level1/scopy.c",
"src/blas/level1/dcopy.c",
"src/blas/level1/hcopy.c",
"src/blas/level1/qcopy.c",
"src/blas/level1/sdot.c",
"src/blas/level1/ddot.c",
"src/blas/level1/hdot.c",
"src/blas/level1/qdot.c",
"src/blas/level1/snrm2.c",
"src/blas/level1/dnrm2.c",
"src/blas/level1/hnrm2.c",
"src/blas/level1/qnrm2.c",
"src/blas/level1/sscal.c",
"src/blas/level1/dscal.c",
"src/blas/level1/hscal.c",
"src/blas/level1/qscal.c",
"src/blas/level1/sswap.c",
"src/blas/level1/dswap.c",
"src/blas/level1/hswap.c",
"src/blas/level1/qswap.c",
"src/blas/level1/isamax.c",
"src/blas/level1/idamax.c",
"src/blas/level1/ihamax.c",
"src/blas/level1/iqamax.c",
"src/blas/level2/sgemv.c",
"src/blas/level2/dgemv.c",
"src/blas/level2/hgemv.c",
"src/blas/level2/qgemv.c",
"src/blas/level3/sgemm.c",
"src/blas/level3/dgemm.c",
"src/blas/level3/hgemm.c",
"src/blas/level3/qgemm.c"
],
deps = ["@softfloat"],
)
26 changes: 25 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");

const VERSION = "3.1";
const VERSION = "3.2";

const targets: []const std.Target.Query = &.{
.{ .cpu_arch = .aarch64, .os_tag = .macos, .abi = null },
Expand Down Expand Up @@ -283,6 +283,11 @@ fn build_single(
.optimize = optimize,
});

const softblas = b.dependency("softblas", .{
.target = target,
.optimize = optimize,
});

const softfloat = b.dependency("softfloat", .{
.target = target,
.optimize = optimize,
Expand Down Expand Up @@ -485,10 +490,12 @@ fn build_single(
pkg_noun.linkLibrary(pdjson.artifact("pdjson"));
pkg_noun.linkLibrary(sigsegv.artifact("sigsegv"));
pkg_noun.linkLibrary(softfloat.artifact("softfloat"));
pkg_noun.linkLibrary(softblas.artifact("softblas"));
if (t.os.tag == .linux)
pkg_noun.linkLibrary(unwind.artifact("unwind"));
pkg_noun.linkLibrary(urcrypt.artifact("urcrypt"));
pkg_noun.linkLibrary(whereami.artifact("whereami"));
pkg_noun.linkLibrary(zlib.artifact("z"));
pkg_noun.linkLibC();

pkg_noun.addIncludePath(b.path("pkg/noun"));
Expand Down Expand Up @@ -556,12 +563,16 @@ fn build_single(
"jets/c/can.c",
"jets/c/cap.c",
"jets/c/cat.c",
"jets/c/clz.c",
"jets/c/ctz.c",
"jets/c/cut.c",
"jets/c/dis.c",
"jets/c/dor.c",
"jets/c/dvr.c",
"jets/c/end.c",
"jets/c/gor.c",
"jets/c/ham.c",
"jets/c/hew.c",
"jets/c/lsh.c",
"jets/c/mas.c",
"jets/c/met.c",
Expand All @@ -575,6 +586,7 @@ fn build_single(
"jets/c/rap.c",
"jets/c/rep.c",
"jets/c/rev.c",
"jets/c/rig.c",
"jets/c/rip.c",
"jets/c/rsh.c",
"jets/c/sqt.c",
Expand Down Expand Up @@ -615,6 +627,8 @@ fn build_single(
"jets/e/argon2.c",
"jets/e/base.c",
"jets/e/blake.c",
"jets/e/chacha.c",
"jets/e/crc32.c",
"jets/e/cue.c",
"jets/e/ed_add_double_scalarmult.c",
"jets/e/ed_add_scalarmult_scalarmult_base.c",
Expand Down Expand Up @@ -678,12 +692,16 @@ fn build_single(
"jets/f/ut_mull.c",
"jets/f/ut_nest.c",
"jets/f/ut_rest.c",
"jets/g/plot.c",
"jets/i/lagoon.c",
"jets/tree.c",
"jets/137/tree.c",
"log.c",
"manage.c",
"nock.c",
"options.c",
"retrieve.c",
"ship.c",
"serial.c",
"trace.c",
"urth.c",
Expand Down Expand Up @@ -771,6 +789,7 @@ fn build_single(
vere.linkLibrary(libuv.artifact("libuv"));
vere.linkLibrary(lmdb.artifact("lmdb"));
vere.linkLibrary(openssl.artifact("ssl"));
vere.linkLibrary(urcrypt.artifact("urcrypt"));
vere.linkLibrary(zlib.artifact("z"));
vere.linkLibrary(pkg_c3);
vere.linkLibrary(pkg_ent);
Expand All @@ -797,6 +816,10 @@ fn build_single(
"io/hind.c",
"io/http.c",
"io/lick.c",
"io/lss.c",
"io/mesa.c",
"io/mesa/bitset.c",
"io/mesa/pact.c",
"io/term.c",
"io/unix.c",
"ivory/ivory.c",
Expand Down Expand Up @@ -873,6 +896,7 @@ fn build_single(
urbit.linkLibrary(lmdb.artifact("lmdb"));
urbit.linkLibrary(openssl.artifact("ssl"));
urbit.linkLibrary(sigsegv.artifact("sigsegv"));
urbit.linkLibrary(urcrypt.artifact("urcrypt"));
urbit.linkLibrary(whereami.artifact("whereami"));

urbit.addCSourceFiles(.{
Expand Down
3 changes: 3 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
.softfloat = .{
.path = "./ext/softfloat",
},
.softblas = .{
.path = "./ext/softblas",
},
.unwind = .{
.path = "./ext/unwind",
},
Expand Down
80 changes: 80 additions & 0 deletions ext/softblas/build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
const std = @import("std");

pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const lib = b.addStaticLibrary(.{
.name = "softblas",
.target = target,
.optimize = optimize,
});

const dep_c = b.dependency("softblas", .{
.target = target,
.optimize = optimize,
});

const softfloat = b.dependency("softfloat", .{
.target = target,
.optimize = optimize,
});

lib.addIncludePath(dep_c.path("include"));

lib.addCSourceFiles(.{
.root = dep_c.path(""),
.files = &.{
"src/softblas_state.c",
"src/blas/level1/sasum.c",
"src/blas/level1/dasum.c",
"src/blas/level1/hasum.c",
"src/blas/level1/qasum.c",
"src/blas/level1/saxpy.c",
"src/blas/level1/daxpy.c",
"src/blas/level1/haxpy.c",
"src/blas/level1/qaxpy.c",
"src/blas/level1/scopy.c",
"src/blas/level1/dcopy.c",
"src/blas/level1/hcopy.c",
"src/blas/level1/qcopy.c",
"src/blas/level1/sdot.c",
"src/blas/level1/ddot.c",
"src/blas/level1/hdot.c",
"src/blas/level1/qdot.c",
"src/blas/level1/snrm2.c",
"src/blas/level1/dnrm2.c",
"src/blas/level1/hnrm2.c",
"src/blas/level1/qnrm2.c",
"src/blas/level1/sscal.c",
"src/blas/level1/dscal.c",
"src/blas/level1/hscal.c",
"src/blas/level1/qscal.c",
"src/blas/level1/sswap.c",
"src/blas/level1/dswap.c",
"src/blas/level1/hswap.c",
"src/blas/level1/qswap.c",
"src/blas/level1/isamax.c",
"src/blas/level1/idamax.c",
"src/blas/level1/ihamax.c",
"src/blas/level1/iqamax.c",
"src/blas/level2/sgemv.c",
"src/blas/level2/dgemv.c",
"src/blas/level2/hgemv.c",
"src/blas/level2/qgemv.c",
"src/blas/level3/sgemm.c",
"src/blas/level3/dgemm.c",
"src/blas/level3/hgemm.c",
"src/blas/level3/qgemm.c",
},
.flags = &.{
"-fno-sanitize=all",
},
});

lib.installHeader(dep_c.path("include/softblas.h"), "softblas.h");

lib.linkLibC();
lib.linkLibrary(softfloat.artifact("softfloat"));
b.installArtifact(lib);
}
16 changes: 16 additions & 0 deletions ext/softblas/build.zig.zon
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.{
.name = "softblas",
.version = "0.0.1",
.dependencies = .{
.softfloat = .{
.path = "../softfloat",
},
.softblas = .{
.url = "https://github.com/urbit/SoftBLAS/archive/cbffb33f19ea02f9ffbd184d445123c57929ec53.tar.gz",
.hash = "1220617c11d869ef2316571a430f51f93470e2d714141deb3bdfaa6b578cf151f258",
},
},
.paths = .{
"",
},
}
Loading

0 comments on commit 063f968

Please sign in to comment.