From 7d7915ac95b42cdf366583b77d98d451db84c890 Mon Sep 17 00:00:00 2001 From: xcnick Date: Tue, 17 May 2022 09:03:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89cmake=E4=B8=AD=E7=BC=96?= =?UTF-8?q?=E8=AF=91openblas=20(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/External/openblas.cmake | 25 ------------------------- cmake/third_party.cmake | 18 ++++++------------ docker/dockerfile | 3 ++- docker/dockerfile_ci | 3 ++- 4 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 cmake/External/openblas.cmake diff --git a/cmake/External/openblas.cmake b/cmake/External/openblas.cmake deleted file mode 100644 index dc6ecaa..0000000 --- a/cmake/External/openblas.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# include(FetchContent) -# FetchContent_Declare( -# openblas -# GIT_REPOSITORY https://github.com/xianyi/OpenBLAS.git -# GIT_TAG v0.3.13 -# ) -# -# FetchContent_MakeAvailable(openblas) - -include(ExternalProject) - -set(OPENBLAS_INSTALL_DIR ${THIRD_PARTY_PATH}/openblas) -set(OPENBLAS_INCLUDE_DIRS ${THIRD_PARTY_PATH}/openblas/include/openblas) -set(OPENBLAS_LIBRARIES ${THIRD_PARTY_PATH}/openblas/lib/libopenblas.a pthread) - -ExternalProject_Add( - openblas - GIT_REPOSITORY https://github.com/xianyi/OpenBLAS.git - GIT_TAG v0.3.19 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${OPENBLAS_INSTALL_DIR} - GIT_SHALLOW - BUILD_BYPRODUCTS ${OPENBLAS_LIBRARIES} -) - -list(APPEND External_PROJECT_TARGETS openblas) diff --git a/cmake/third_party.cmake b/cmake/third_party.cmake index 6e17d6a..b132498 100644 --- a/cmake/third_party.cmake +++ b/cmake/third_party.cmake @@ -117,16 +117,10 @@ set(BLAS "Open" CACHE STRING "Selected BLAS library") set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL") if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open") - #find_package(OpenBLAS REQUIRED) - # ---[ OpenBlas - include(cmake/External/openblas.cmake) - list(APPEND Latte_INCLUDE_DIRS PRIVATE ${OPENBLAS_INCLUDE_DIRS}) - list(APPEND Latte_LINKER_LIBS PRIVATE ${OPENBLAS_LIBRARIES}) - # list(APPEND Latte_INCLUDE_DIRS PUBLIC ${OpenBLAS_INCLUDE_DIR}) - # list(APPEND Latte_LINKER_LIBS PUBLIC ${OpenBLAS_LIB}) + set(BLA_VENDOR OpenBLAS) elseif(BLAS STREQUAL "MKL" OR BLAS STREQUAL "mkl") - #find_package(MKL REQUIRED) - list(APPEND Latte_INCLUDE_DIRS PRIVATE ${MKL_INCLUDE_DIR}) - list(APPEND Latte_LINKER_LIBS PRIVATE ${MKL_LIBRARIES}) - list(APPEND Latte_DEFINITIONS PRIVATE -DUSE_MKL) -endif() \ No newline at end of file + set(BLA_VENDOR MKL) +endif() + +find_package(BLAS REQUIRED) +list(APPEND Latte_LINKER_LIBS PUBLIC ${BLAS_LIBRARIES}) diff --git a/docker/dockerfile b/docker/dockerfile index fa69483..ec5a778 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -4,7 +4,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && apt-get install -y --no-install-recommends \ git \ wget \ - ca-certificates && \ + ca-certificates \ + libopenblas-dev && \ rm -rf /var/lib/apt/lists/* RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz \ diff --git a/docker/dockerfile_ci b/docker/dockerfile_ci index ddb8cca..d9a0051 100644 --- a/docker/dockerfile_ci +++ b/docker/dockerfile_ci @@ -4,7 +4,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && apt-get install -y --no-install-recommends \ git \ wget \ - ca-certificates && \ + ca-certificates \ + libopenblas-dev && \ rm -rf /var/lib/apt/lists/* RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz \