|
| 1 | +# Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# This source code is licensed under the BSD-style license found in the |
| 5 | +# LICENSE file in the root directory of this source tree. |
| 6 | + |
| 7 | +if(__EIGEN_BLAS_INCLUDED) |
| 8 | + return() |
| 9 | +endif() |
| 10 | +set(__EIGEN_BLAS_INCLUDED TRUE) |
| 11 | + |
| 12 | +############################################################################## |
| 13 | +# Eigen BLAS is built together with Libtorch mobile. |
| 14 | +# By default, it builds code from third-party/eigen/blas submodule. |
| 15 | +############################################################################## |
| 16 | + |
| 17 | +set(EIGEN_BLAS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/eigen/blas" CACHE STRING "Eigen BLAS source directory") |
| 18 | + |
| 19 | +set(EigenBlas_SRCS |
| 20 | + ${EIGEN_BLAS_SRC_DIR}/single.cpp |
| 21 | + ${EIGEN_BLAS_SRC_DIR}/double.cpp |
| 22 | + ${EIGEN_BLAS_SRC_DIR}/complex_single.cpp |
| 23 | + ${EIGEN_BLAS_SRC_DIR}/complex_double.cpp |
| 24 | + ${EIGEN_BLAS_SRC_DIR}/xerbla.cpp |
| 25 | + ${EIGEN_BLAS_SRC_DIR}/f2c/srotm.c |
| 26 | + ${EIGEN_BLAS_SRC_DIR}/f2c/srotmg.c |
| 27 | + ${EIGEN_BLAS_SRC_DIR}/f2c/drotm.c |
| 28 | + ${EIGEN_BLAS_SRC_DIR}/f2c/drotmg.c |
| 29 | + ${EIGEN_BLAS_SRC_DIR}/f2c/lsame.c |
| 30 | + ${EIGEN_BLAS_SRC_DIR}/f2c/dspmv.c |
| 31 | + ${EIGEN_BLAS_SRC_DIR}/f2c/ssbmv.c |
| 32 | + ${EIGEN_BLAS_SRC_DIR}/f2c/chbmv.c |
| 33 | + ${EIGEN_BLAS_SRC_DIR}/f2c/sspmv.c |
| 34 | + ${EIGEN_BLAS_SRC_DIR}/f2c/zhbmv.c |
| 35 | + ${EIGEN_BLAS_SRC_DIR}/f2c/chpmv.c |
| 36 | + ${EIGEN_BLAS_SRC_DIR}/f2c/dsbmv.c |
| 37 | + ${EIGEN_BLAS_SRC_DIR}/f2c/zhpmv.c |
| 38 | + ${EIGEN_BLAS_SRC_DIR}/f2c/dtbmv.c |
| 39 | + ${EIGEN_BLAS_SRC_DIR}/f2c/stbmv.c |
| 40 | + ${EIGEN_BLAS_SRC_DIR}/f2c/ctbmv.c |
| 41 | + ${EIGEN_BLAS_SRC_DIR}/f2c/ztbmv.c |
| 42 | + ${EIGEN_BLAS_SRC_DIR}/f2c/complexdots.c |
| 43 | +) |
| 44 | + |
| 45 | +add_library(eigen_blas STATIC ${EigenBlas_SRCS}) |
| 46 | + |
| 47 | +#Dont know what to do with this |
| 48 | +# We build static versions of eigen blas but link into a shared library, so they need PIC. |
| 49 | +set_property(TARGET eigen_blas PROPERTY POSITION_INDEPENDENT_CODE ON) |
| 50 | + |
| 51 | +install(TARGETS eigen_blas |
| 52 | + LIBRARY DESTINATION lib |
| 53 | + ARCHIVE DESTINATION lib) |
0 commit comments