1# Description: 2# Eigen is a C++ template library for linear algebra: vectors, 3# matrices, and related algorithms. 4 5licenses([ 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 12exports_files(["LICENSE"]) 13 14load("//third_party/mkl:build_defs.bzl", "if_mkl") 15 16EIGEN3_THIRD_PARTY_HEADERS = [ 17 "Eigen/Core", 18 "Eigen/LU", 19 "Eigen/Cholesky", 20 "Eigen/Eigenvalues", 21 "Eigen/OrderingMethods", 22 "Eigen/QR", 23 "Eigen/SparseCholesky", 24 "Eigen/SparseCore", 25 "Eigen/SVD", 26 "unsupported/Eigen/MatrixFunctions", 27 "unsupported/Eigen/SpecialFunctions", 28 "unsupported/Eigen/CXX11/ThreadPool", 29 "unsupported/Eigen/CXX11/Tensor", 30 "unsupported/Eigen/CXX11/FixedPoint", 31] + glob(["unsupported/Eigen/CXX11/src/FixedPoint/*.h"]) 32 33cc_library( 34 name = "eigen3", 35 hdrs = EIGEN3_THIRD_PARTY_HEADERS, 36 includes = if_mkl(["./mkl_include"]), 37 visibility = ["//visibility:public"], 38 deps = [ 39 "@eigen_archive//:eigen", 40 "@local_config_sycl//sycl", 41 ], 42) 43 44filegroup( 45 name = "all_files", 46 srcs = glob( 47 ["**/*"], 48 exclude = ["**/OWNERS"], 49 ), 50 visibility = ["//tensorflow:__subpackages__"], 51) 52 53filegroup( 54 name = "eigen_third_party_header_files", 55 srcs = EIGEN3_THIRD_PARTY_HEADERS, 56 visibility = ["//visibility:public"], 57) 58 59genrule( 60 name = "install_eigen_headers", 61 srcs = [ 62 "@eigen_archive//:eigen_header_files", 63 ":eigen_third_party_header_files", 64 ], 65 outs = ["include"], 66 cmd = """ 67 mkdir $@ 68 for f in $(SRCS); do 69 d="$${f%/*}" 70 d="$${d#*external/eigen_archive/}" 71 72 mkdir -p "$@/$${d}" 73 cp "$${f}" "$@/$${d}/" 74 done 75 """, 76 tags = ["manual"], 77) 78