Skip to content

Commit

Permalink
Update to Halide 2017/05/03 release; fix Android link opts
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-johnson committed May 16, 2017
1 parent f8614ff commit 026a5b3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion example/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
git_repository(
name = "halide_bazel",
remote = "https://github.com/halide/halide_bazel",
tag = "v0.1.6"
tag = "v0.1.7"
)
load("@halide_bazel//:halide_configure.bzl", "halide_configure")
halide_configure()
4 changes: 2 additions & 2 deletions example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ int main(int argc, char **argv) {
constexpr int kEdge = 30;
constexpr float kMax = kEdge * kEdge;

Halide::Buffer<float> input(kEdge, kEdge);
Halide::Runtime::Buffer<float> input(kEdge, kEdge);
for (int x = 0; x < kEdge; ++x) {
for (int y = 0; y < kEdge; ++y) {
input(x, y) = static_cast<float>(x + y) / kMax;
}
}

const float kScale = 0.5f;
Halide::Buffer<float> output(kEdge, kEdge);
Halide::Runtime::Buffer<float> output(kEdge, kEdge);
int result = example(input, kScale, output);
if (result != 0) {
fprintf(stderr, "Failure: %d\n", result);
Expand Down
16 changes: 8 additions & 8 deletions halide_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ _HOST_DEFAULTS_DARWIN = {
"copts": _COPTS_DEFAULT,
"linkopts": _LINKOPTS_DEFAULT,
"http_archive_info": [
"https://github.com/halide/Halide/releases/download/release_2016_10_25/halide-mac-64-trunk-aa5d5514f179bf0ffe1a2dead0c0eb7300b4069a.tgz",
"7cc502ebeabd1890f9ab12c186e59745c9f524ce74b325931103ef7a1136ca2a",
"https://github.com/halide/Halide/releases/download/release_2017_05_03/halide-mac-64-trunk-06ace54101cbd656e22243f86cce0a82ba058c3b.tgz",
"8c8a5e005991265311554d33e0d91b988e2a7083f6f250bbc0180e5b292b19b1",
]
}

Expand All @@ -30,8 +30,8 @@ _HOST_DEFAULTS_PIII = {
"linkopts": _LINKOPTS_DEFAULT,
"http_archive_info": [
# TODO: we default to gcc4.8 on Linux; is this the best choice?
"https://github.com/halide/Halide/releases/download/release_2016_10_25/halide-linux-32-gcc48-trunk-aa5d5514f179bf0ffe1a2dead0c0eb7300b4069a.tgz",
"ab0545ebd8fff816676522fbfc434956ecd43b6fc1d46c4847ca9009223106e4",
"https://github.com/halide/Halide/releases/download/release_2017_05_03/halide-linux-32-gcc48-trunk-06ace54101cbd656e22243f86cce0a82ba058c3b.tgz",
"d29f6ef4a1e72110bbc8b30a188e424a190c54a2e3eb18574e8ef16fdb96693e",
]
}

Expand All @@ -41,8 +41,8 @@ _HOST_DEFAULTS_K8 = {
"linkopts": _LINKOPTS_DEFAULT,
"http_archive_info": [
# TODO: we default to gcc4.8 on Linux; is this the best choice?
"https://github.com/halide/Halide/releases/download/release_2016_10_25/halide-linux-64-gcc48-trunk-aa5d5514f179bf0ffe1a2dead0c0eb7300b4069a.tgz",
"f2c47f9ec4bcad0d8195e12653048ee49dbce0e828e0273242562813197a6c4b",
"https://github.com/halide/Halide/releases/download/release_2017_05_03/halide-linux-64-gcc48-trunk-06ace54101cbd656e22243f86cce0a82ba058c3b.tgz",
"c4038b651ddff5deb08de84e6aad165af1943b7cf4afc843c3117f2c7559db5b",
]
}

Expand All @@ -51,8 +51,8 @@ _HOST_DEFAULTS_WIN64 = {
"copts": _COPTS_DEFAULT,
"linkopts": [],
"http_archive_info": [
"https://github.com/halide/Halide/releases/download/release_2016_10_25/halide-win-64-trunk-aa5d5514f179bf0ffe1a2dead0c0eb7300b4069a.zip",
"17910e65edd9c7a3df74db73b11bc3bca021186f81beab82c245529839e45e98",
"https://github.com/halide/Halide/releases/download/release_2017_05_03/halide-win-64-distro-trunk-06ace54101cbd656e22243f86cce0a82ba058c3b.zip",
"acff86d010e40a06c32006452a383a0fcd70eaa57612360273b8da4f2b7f728e",
]
}

Expand Down
25 changes: 18 additions & 7 deletions halide_library.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,30 @@ def halide_library(name,

# Batch up the .h and all the .o files into a cc_library (with the appropriate
# select() in place to make things work well).
_posix_opts = [
"-ldl",
"-lm",
"-lpthread",
"-lz",
]
_android_opts = [
"-landroid",
"-llog",
]
_msvc_opts = []
native.cc_library(
name=name,
srcs=select(conditional_srcs) + [":%s" % header_output],
deps=["@halide_distrib//:halide_runtime"] + filter_deps,
# TODO: these linkopts will probably need to be conditionalized
# for various platforms; they are correct for OSX and Linux.
linkopts= select({
"@halide_distrib//:config_x86_64_windows": [],
"//conditions:default": [
"-ldl",
"-lm",
"-lpthread",
"-lz",
]}),
"@halide_distrib//:config_arm_32_android": _android_opts,
"@halide_distrib//:config_arm_64_android": _android_opts,
"@halide_distrib//:config_x86_32_android": _android_opts,
"@halide_distrib//:config_x86_64_android": _android_opts,
"@halide_distrib//:config_x86_64_windows": _msvc_opts,
"//conditions:default": _posix_opts
}),
hdrs=["%s.h" % name],
visibility=visibility)

0 comments on commit 026a5b3

Please sign in to comment.