CMake - Как скачать LAPACK с помощью FetchContent? - PullRequest
0 голосов
/ 21 февраля 2019

Я бы хотел загрузить LAPACK с функцией FetchContent .

Мой код выглядит так:

set(LAPACK_LOCAL_PATH ${ROOT_DIR}/external_dependencies/lapack-release)

include(FetchContent)

FetchContent_Declare(
    Lapack
    SOURCE_DIR ${LAPACK_LOCAL_PATH}
    GIT_REPOSITORY https://github.com/Reference-LAPACK/lapack-release.git
    GIT_TAG lapack-3.8.0
)

set(FETCHCONTENT_QUIET FALSE)

if(NOT Lapack_POPULATED)
    FetchContent_Populate(Lapack)
    add_subdirectory(${LAPACK_LOCAL_PATH} ${LAPACK_LOCAL_PATH}/build)
endif()

Проблема в том, что при запускекод, я получаю следующую ошибку:

######################################################
# lapack should not be configured & built in the lapack source directory
# You must run cmake in a build directory.
# For example:
# mkdir lapack-Sandbox ; cd lapack-sandbox
# git clone https://github.com/Reference-LAPACK/lapack.git # or download & unpack the source tarball
# mkdir lapack-build
# this will create the following directory structure
#
# lapack-Sandbox
#  +--lapack
#  +--lapack-build
#
# Then you can proceed to configure and build
# by using the following commands
#
# cd lapack-build
# cmake ../lapack # or ccmake, or cmake-gui 
# make
#
# NOTE: Given that you already tried to make an in-source build
#       CMake have already created several files & directories
#       in your source tree. run 'git status' to find them and
#       remove them by doing:
#
#       cd lapack-Sandbox/lapack
#       git clean -n -d
#       git clean -f -d
#       git checkout --
#
######################################################
CMake Error at external_dependencies/lapack-release/CMAKE/PreventInSourceBuilds.cmake:41 (message):
  Quitting configuration
Call Stack (most recent call first):
  external_dependencies/lapack-release/CMAKE/PreventInSourceBuilds.cmake:45 (AssureOutOfSourceBuilds)
  external_dependencies/lapack-release/CMakeLists.txt:57 (include)

Когда я пытаюсь собрать LAPACK вручную, нет проблем.Подскажите, пожалуйста, что я делаю не так?

...