-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add repo and dependencies for math (#46)
* Add repo and dependencies for utils Signed-off-by: Michael Carroll <[email protected]> * Add repo and dependencies for math Signed-off-by: Michael Carroll <[email protected]> * Change to release branch Signed-off-by: Michael Carroll <[email protected]> --------- Signed-off-by: Michael Carroll <[email protected]>
- Loading branch information
Showing
5 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
load("@gz//bazel/lint:lint.bzl", "add_lint_tests") | ||
|
||
add_lint_tests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright 2018 The Cartographer Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Description: | ||
# Eigen is a C++ template library for linear algebra: vectors, | ||
# matrices, and related algorithms. | ||
|
||
licenses([ | ||
# Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. | ||
# We've taken special care to not reference any restricted code. | ||
"reciprocal", # MPL2 | ||
"notice", # Portions BSD | ||
]) | ||
|
||
exports_files(["COPYING.MPL2"]) | ||
|
||
EIGEN_FILES = [ | ||
"include/eigen3/Eigen/**", | ||
"include/eigen3/unsupported/Eigen/CXX11/**", | ||
"include/eigen3/unsupported/Eigen/FFT", | ||
"include/eigen3/unsupported/Eigen/KroneckerProduct", | ||
"include/eigen3/unsupported/Eigen/src/FFT/**", | ||
"include/eigen3/unsupported/Eigen/src/KroneckerProduct/**", | ||
"include/eigen3/unsupported/Eigen/MatrixFunctions", | ||
"include/eigen3/unsupported/Eigen/SpecialFunctions", | ||
"include/eigen3/unsupported/Eigen/src/MatrixFunctions/**", | ||
"include/eigen3/unsupported/Eigen/src/SpecialFunctions/**", | ||
] | ||
|
||
# List of files picked up by glob but actually part of another target. | ||
EIGEN_EXCLUDE_FILES = [ | ||
"include/eigen3/Eigen/src/Core/arch/AVX/PacketMathGoogleTest.cc", | ||
] | ||
|
||
EIGEN_MPL2_HEADER_FILES = glob( | ||
EIGEN_FILES, | ||
exclude = EIGEN_EXCLUDE_FILES, | ||
) | ||
|
||
cc_library( | ||
name = "eigen3", | ||
hdrs = EIGEN_MPL2_HEADER_FILES, | ||
includes = ["include/eigen3"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
load("@gz//bazel/workspace:os.bzl", "determine_os") | ||
|
||
def _impl(repository_ctx): | ||
os_result = determine_os(repository_ctx) | ||
|
||
if os_result.error != None: | ||
fail(os_result.error) | ||
|
||
if os_result.is_ubuntu: | ||
repository_ctx.symlink("/usr/include/eigen3/Eigen", "include/eigen3/Eigen") # noqa | ||
repository_ctx.symlink("/usr/include/eigen3/unsupported", "include/eigen3/unsupported") # noqa | ||
|
||
# Add the BUILD file. | ||
repository_ctx.symlink( | ||
Label("@gz//bazel/workspace/eigen3:package.BUILD.bazel"), | ||
"BUILD.bazel", | ||
) | ||
|
||
eigen3_repository = repository_rule( | ||
local = True, | ||
configure = True, | ||
implementation = _impl, | ||
) |