Skip to content

Commit b992ff6

Browse files
committed
Merge and fix workspace.bzl for cmake, makefile use.
2 parents 9c11fe2 + 2aecc55 commit b992ff6

399 files changed

Lines changed: 20731 additions & 4407 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
instead of graph.proto.
1818
* ops.NoGradient was renamed ops.NotDifferentiable. ops.NoGradient will
1919
be removed soon.
20+
* dot.h / DotGraph was removed (it was an early analysis tool prior
21+
to TensorBoard, no longer that useful). It remains in history
22+
should someone find the code useful.
2023

2124
# Release 0.10.0
2225

avro.BUILD

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ package(default_visibility = ["//visibility:public"])
22

33
licenses(["notice"]) # Apache 2.0
44

5-
prefix_dir = "avro-cpp-1.8.0"
6-
75
cc_library(
86
name = "avrocpp",
97
srcs = glob(
108
[
11-
prefix_dir + "/impl/**/*.cc",
12-
prefix_dir + "/impl/**/*.hh",
9+
"impl/**/*.cc",
10+
"impl/**/*.hh",
1311
],
1412
exclude = [
15-
prefix_dir + "/impl/avrogencpp.cc",
13+
"impl/avrogencpp.cc",
1614
],
1715
),
18-
hdrs = glob([prefix_dir + "/api/**/*.hh"]),
19-
includes = [prefix_dir + "/api"],
16+
hdrs = glob(["api/**/*.hh"]),
17+
includes = ["api"],
2018
deps = [
2119
"@boost_archive//:boost",
2220
"@boost_archive//:filesystem",
@@ -27,7 +25,7 @@ cc_library(
2725

2826
cc_binary(
2927
name = "avrogencpp",
30-
srcs = [prefix_dir + "/impl/avrogencpp.cc"],
28+
srcs = ["impl/avrogencpp.cc"],
3129
deps = [
3230
":avrocpp",
3331
"@boost_archive//:program_options",

boost.BUILD

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,19 @@ package(default_visibility = ["@avro_archive//:__subpackages__"])
1010

1111
licenses(["notice"]) # Boost software license
1212

13-
prefix_dir = "boost_1_61_0"
14-
1513
cc_library(
1614
name = "boost",
1715
hdrs = glob([
18-
prefix_dir + "/boost/**/*.hpp",
19-
prefix_dir + "/boost/**/*.h",
20-
prefix_dir + "/boost/**/*.ipp",
16+
"boost/**/*.hpp",
17+
"boost/**/*.h",
18+
"boost/**/*.ipp",
2119
]),
22-
includes = [prefix_dir],
20+
includes = ["."],
2321
)
2422

2523
cc_library(
2624
name = "filesystem",
27-
srcs = glob([prefix_dir + "/libs/filesystem/src/*.cpp"]),
25+
srcs = glob(["libs/filesystem/src/*.cpp"]),
2826
deps = [
2927
":boost",
3028
":system",
@@ -33,7 +31,7 @@ cc_library(
3331

3432
cc_library(
3533
name = "iostreams",
36-
srcs = glob([prefix_dir + "/libs/iostreams/src/*.cpp"]),
34+
srcs = glob(["libs/iostreams/src/*.cpp"]),
3735
deps = [
3836
":boost",
3937
"@bzip2_archive//:bz2lib",
@@ -43,16 +41,12 @@ cc_library(
4341

4442
cc_library(
4543
name = "program_options",
46-
srcs = glob([prefix_dir + "/libs/program_options/src/*.cpp"]),
47-
deps = [
48-
":boost",
49-
],
44+
srcs = glob(["libs/program_options/src/*.cpp"]),
45+
deps = [":boost"],
5046
)
5147

5248
cc_library(
5349
name = "system",
54-
srcs = glob([prefix_dir + "/libs/system/src/*.cpp"]),
55-
deps = [
56-
":boost",
57-
],
50+
srcs = glob(["libs/system/src/*.cpp"]),
51+
deps = [":boost"],
5852
)

bzip2.BUILD

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,27 @@ package(default_visibility = ["//visibility:public"])
22

33
licenses(["notice"]) # BSD derivative
44

5-
prefix_dir = "bzip2-1.0.6"
6-
7-
BZ2LIB_SRCS = [
8-
# these are in the same order as their corresponding .o files are in OBJS in
9-
# Makefile (rather than lexicographic order) for easy comparison (that they
10-
# are identical).
11-
"blocksort.c",
12-
"huffman.c",
13-
"crctable.c",
14-
"randtable.c",
15-
"compress.c",
16-
"decompress.c",
17-
"bzlib.c",
18-
]
19-
205
cc_library(
216
name = "bz2lib",
22-
srcs = [prefix_dir + "/" + source for source in BZ2LIB_SRCS] +
23-
[prefix_dir + "/bzlib_private.h"],
24-
hdrs = [prefix_dir + "/bzlib.h"],
25-
includes = [prefix_dir],
7+
srcs = [
8+
# These are in the same order as their corresponding .o files are in
9+
# OBJS in Makefile (rather than lexicographic order) for easy
10+
# comparison (that they are identical.)
11+
"blocksort.c",
12+
"huffman.c",
13+
"crctable.c",
14+
"randtable.c",
15+
"compress.c",
16+
"decompress.c",
17+
"bzlib.c",
18+
"bzlib_private.h",
19+
],
20+
hdrs = ["bzlib.h"],
21+
includes = ["."],
2622
)
2723

2824
cc_binary(
2925
name = "bzip2",
30-
srcs = [
31-
"bzip2.c",
32-
],
33-
deps = [
34-
":bz2lib",
35-
],
26+
srcs = ["bzip2.c"],
27+
deps = [":bz2lib"],
3628
)

eigen.BUILD

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,70 @@
1-
package(default_visibility = ["//visibility:public"])
1+
# Description:
2+
# Eigen is a C++ template library for linear algebra: vectors,
3+
# matrices, and related algorithms.
4+
5+
licenses([
6+
# Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code.
7+
# We've taken special care to not reference any restricted code.
8+
"reciprocal", # MPL2
9+
"notice", # Portions BSD
10+
])
11+
12+
# License-restricted (i.e. not reciprocal or notice) files inside Eigen/...
13+
EIGEN_RESTRICTED_FILES = [
14+
"Eigen/src/OrderingMethods/Amd.h",
15+
"Eigen/src/SparseCholesky/**",
16+
]
17+
18+
# Notable transitive dependencies of restricted files inside Eigen/...
19+
EIGEN_RESTRICTED_DEPS = [
20+
"Eigen/Eigen",
21+
"Eigen/IterativeLinearSolvers",
22+
"Eigen/MetisSupport",
23+
"Eigen/Sparse",
24+
"Eigen/SparseCholesky",
25+
"Eigen/SparseLU",
26+
]
27+
28+
# Note: unsupported/Eigen is unsupported and might go away at any time.
29+
EIGEN_FILES = [
30+
"Eigen/**",
31+
"unsupported/Eigen/CXX11/**",
32+
"unsupported/Eigen/FFT",
33+
"unsupported/Eigen/KroneckerProduct",
34+
"unsupported/Eigen/src/FFT/**",
35+
"unsupported/Eigen/src/KroneckerProduct/**",
36+
"unsupported/Eigen/MatrixFunctions",
37+
"unsupported/Eigen/SpecialFunctions",
38+
"unsupported/Eigen/src/SpecialFunctions/**",
39+
]
40+
41+
# List of files picked up by glob but actually part of another target.
42+
EIGEN_EXCLUDE_FILES = [
43+
"Eigen/src/Core/arch/AVX/PacketMathGoogleTest.cc",
44+
]
45+
46+
# Files known to be under MPL2 license.
47+
EIGEN_MPL2_HEADER_FILES = glob(
48+
EIGEN_FILES,
49+
exclude = EIGEN_EXCLUDE_FILES +
50+
EIGEN_RESTRICTED_FILES +
51+
EIGEN_RESTRICTED_DEPS + [
52+
# Guarantees any file missed by excludes above will not compile.
53+
"Eigen/src/Core/util/NonMPL2.h",
54+
"Eigen/**/CMakeLists.txt",
55+
],
56+
)
257

358
cc_library(
459
name = "eigen",
5-
hdrs = glob(["**/*.h", "unsupported/Eigen/*", "unsupported/Eigen/CXX11/*", "Eigen/*"]),
6-
includes = [ '.' ],
60+
hdrs = EIGEN_MPL2_HEADER_FILES,
61+
defines = [
62+
# This define (mostly) guarantees we don't link any problematic
63+
# code. We use it, but we do not rely on it, as evidenced above.
64+
"EIGEN_MPL2_ONLY",
65+
# TODO(jart): Use EIGEN_USE_NONBLOCKING_THREAD_POOL but first add an
66+
# eigen_initialize.cc file and alwayslink=1.
67+
],
68+
includes = ["."],
769
visibility = ["//visibility:public"],
870
)

farmhash.BUILD

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
package(default_visibility = ["//visibility:public"])
2-
3-
prefix_dir = "farmhash-34c13ddfab0e35422f4c3979f360635a8c050260"
4-
5-
genrule(
6-
name = "configure",
7-
srcs = glob(
8-
["**/*"],
9-
exclude = [prefix_dir + "/config.h"],
10-
),
11-
outs = [prefix_dir + "/config.h"],
12-
cmd = "pushd external/farmhash_archive/%s; workdir=$$(mktemp -d -t tmp.XXXXXXXXXX); cp -a * $$workdir; pushd $$workdir; ./configure; popd; popd; cp $$workdir/config.h $(@D); rm -rf $$workdir;" % prefix_dir,
13-
)
1+
licenses(["notice"]) # MIT
142

153
cc_library(
164
name = "farmhash",
17-
srcs = [prefix_dir + "/src/farmhash.cc"],
18-
hdrs = [prefix_dir + "/src/farmhash.h"] + [":configure"],
19-
includes = [prefix_dir],
20-
visibility = ["//visibility:public"]
5+
srcs = ["farmhash.cc"],
6+
hdrs = ["farmhash.h"],
7+
includes = ["."],
8+
visibility = ["//visibility:public"],
219
)

gif.BUILD

Lines changed: 34 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,44 @@
1-
SOURCES = [
2-
"dgif_lib.c",
3-
"egif_lib.c",
4-
"gif_font.c",
5-
"gif_hash.c",
6-
"gifalloc.c",
7-
"openbsd-reallocarray.c",
8-
"gif_err.c",
9-
"quantize.c",
10-
]
1+
# Description:
2+
# A library for decoding and encoding GIF images
113

12-
HEADERS = [
13-
"gif_hash.h",
14-
"gif_lib.h",
15-
"gif_lib_private.h",
16-
]
4+
licenses(["notice"]) # MIT
175

18-
config_setting(
19-
name = "windows",
20-
values = {
21-
"cpu": "x64_windows_msvc",
22-
},
23-
visibility = ["//visibility:public"],
6+
cc_library(
7+
name = "gif",
8+
srcs = [
9+
"dgif_lib.c",
10+
"egif_lib.c",
11+
"gif_err.c",
12+
"gif_font.c",
13+
"gif_hash.c",
14+
"gif_hash.h",
15+
"gif_lib_private.h",
16+
"gifalloc.c",
17+
"openbsd-reallocarray.c",
18+
"quantize.c",
19+
],
20+
hdrs = ["gif_lib.h"],
21+
includes = ["."],
22+
visibility = ["//visibility:public"],
23+
deps = select({
24+
":windows": [":windows_polyfill"],
25+
"//conditions:default": [],
26+
}),
2427
)
2528

26-
prefix_dir = "giflib-5.1.4/lib"
27-
prefix_dir_windows = "windows/giflib-5.1.4/lib"
28-
29-
genrule(
30-
name = "srcs_without_unistd",
31-
srcs = [prefix_dir + "/" + source for source in SOURCES],
32-
outs = [prefix_dir_windows + "/" + source for source in SOURCES],
33-
cmd = "for f in $(SRCS); do " +
34-
" sed 's/#include <unistd.h>//g' $$f > $(@D)/%s/$$(basename $$f);" % prefix_dir_windows +
35-
"done",
29+
cc_library(
30+
name = "windows_polyfill",
31+
hdrs = ["windows/unistd.h"],
32+
includes = ["windows"],
3633
)
3734

3835
genrule(
39-
name = "hdrs_without_unistd",
40-
srcs = [prefix_dir + "/" + hdrs for hdrs in HEADERS],
41-
outs = [prefix_dir_windows + "/" + hdrs for hdrs in HEADERS],
42-
cmd = "for f in $(SRCS); do " +
43-
" sed 's/#include <unistd.h>//g' $$f > $(@D)/%s/$$(basename $$f);" % prefix_dir_windows +
44-
"done",
36+
name = "windows_unistd_h",
37+
outs = ["windows/unistd.h"],
38+
cmd = "touch $@",
4539
)
4640

47-
cc_library(
48-
name = "gif",
49-
srcs = select({
50-
"//conditions:default" : [prefix_dir + "/" + source for source in SOURCES],
51-
":windows" : [":srcs_without_unistd"],
52-
}),
53-
hdrs = select({
54-
"//conditions:default" : [prefix_dir + "/" + hdrs for hdrs in HEADERS],
55-
":windows" : [":hdrs_without_unistd"],
56-
}),
57-
includes = select({
58-
"//conditions:default" : [prefix_dir],
59-
":windows" : [prefix_dir_windows],
60-
}),
61-
defines = [
62-
"HAVE_CONFIG_H",
63-
],
64-
visibility = ["//visibility:public"],
41+
config_setting(
42+
name = "windows",
43+
values = {"cpu": "x64_windows_msvc"},
6544
)

0 commit comments

Comments
 (0)