From a759382e5853696154dc48acc98c10dfab9d87fb Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Mon, 24 May 2021 17:55:08 +0200 Subject: [PATCH 1/8] Check for blas and Lapack before downloading armadillo Signed-off-by: Omar Shrit --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index daf416f5e2..e2bd365156 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -280,6 +280,11 @@ if (DISABLE_DOWNLOADS) else() find_package(Armadillo "${ARMADILLO_VERSION}") if (NOT ARMADILLO_FOUND) + find_package(BLAS QUIET) + find_package(LAPACK QUIET) + if (NOT BLAS_FOUND AND NOT LAPACK_FOUND) + message(FATAL_ERROR "Can not find BLAS or LAPACK, please install one of them before installing mlpack") + endif() get_deps(http://files.mlpack.org/armadillo-10.3.0.tar.gz armadillo armadillo-10.3.0.tar.gz) set(ARMADILLO_INCLUDE_DIR ${GENERIC_INCLUDE_DIR}) find_package(Armadillo REQUIRED) From de040a0e70837e13ab628e920dce26ed43f27ce2 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Mon, 24 May 2021 18:20:29 +0200 Subject: [PATCH 2/8] Add missing period --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2bd365156..6445bf7847 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,7 @@ else() find_package(BLAS QUIET) find_package(LAPACK QUIET) if (NOT BLAS_FOUND AND NOT LAPACK_FOUND) - message(FATAL_ERROR "Can not find BLAS or LAPACK, please install one of them before installing mlpack") + message(FATAL_ERROR "Can not find BLAS or LAPACK, please install one of them before installing mlpack.") endif() get_deps(http://files.mlpack.org/armadillo-10.3.0.tar.gz armadillo armadillo-10.3.0.tar.gz) set(ARMADILLO_INCLUDE_DIR ${GENERIC_INCLUDE_DIR}) From acc845683048f5ea762b618c2ceb12a11cbad4f2 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Tue, 25 May 2021 14:53:20 +0200 Subject: [PATCH 3/8] Update CMakeLists.txt Co-authored-by: Ryan Curtin --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6445bf7847..1b6729d10b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,7 @@ else() find_package(BLAS QUIET) find_package(LAPACK QUIET) if (NOT BLAS_FOUND AND NOT LAPACK_FOUND) - message(FATAL_ERROR "Can not find BLAS or LAPACK, please install one of them before installing mlpack.") + message(FATAL_ERROR "Can not find BLAS or LAPACK! These are required for Armadillo. Please install one of them---or install Armadillo---before installing mlpack.") endif() get_deps(http://files.mlpack.org/armadillo-10.3.0.tar.gz armadillo armadillo-10.3.0.tar.gz) set(ARMADILLO_INCLUDE_DIR ${GENERIC_INCLUDE_DIR}) From ae0f0124c8928e8336082f194cca010692ba4d88 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Wed, 16 Jun 2021 16:17:57 +0200 Subject: [PATCH 4/8] Increase the minimum required cmake version to compile mlpack Signed-off-by: Omar Shrit --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2bd365156..10b0e26225 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3.2) +cmake_minimum_required(VERSION 3.6) project(mlpack C CXX) include(CMake/cotire.cmake) From ec986cb4fe744923880e1d802ad98fcf98032f87 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 19 Jun 2021 22:51:53 +0200 Subject: [PATCH 5/8] Increase the cmake version in README Signed-off-by: Omar Shrit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10f82a2c12..8e9ad6a05e 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ mlpack has the following dependencies: Armadillo >= 8.400.0 Boost (math_c99, spirit) >= 1.58.0 - CMake >= 3.2.2 + CMake >= 3.6 ensmallen >= 2.10.0 cereal >= 1.1.2 From fe2f32eb642b70680e12fb01c1508009b31f12f1 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 20 Jun 2021 09:04:56 +0200 Subject: [PATCH 6/8] Remove trailing space Signed-off-by: Omar Shrit --- CMake/ConfigureCrossCompile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/ConfigureCrossCompile.cmake b/CMake/ConfigureCrossCompile.cmake index 75e28bc453..ba78707ec3 100644 --- a/CMake/ConfigureCrossCompile.cmake +++ b/CMake/ConfigureCrossCompile.cmake @@ -33,7 +33,7 @@ macro(search_openblas version) endif() file(GLOB OPENBLAS_LIBRARIES "${CMAKE_BINARY_DIR}/deps/OpenBLAS-${version}/libopenblas.a") set(BLAS_openblas_LIBRARY ${OPENBLAS_LIBRARIES}) - set(LAPACK_openblas_LIBRARY ${OPENBLAS_LIBRARIES}) + set(LAPACK_openblas_LIBRARY ${OPENBLAS_LIBRARIES}) set(BLA_VENDOR OpenBLAS) set(BLAS_FOUND ON) endif() From e3276d9437002c13cb24705221b4cacadd18352c Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 20 Jun 2021 09:08:36 +0200 Subject: [PATCH 7/8] Do not check for BLAS and LAPACK if we are cross compiling and we have already found it. Signed-off-by: Omar Shrit --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19021de485..abddba2c1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,7 +279,7 @@ if (DISABLE_DOWNLOADS) find_package(Armadillo "${ARMADILLO_VERSION}" REQUIRED) else() find_package(Armadillo "${ARMADILLO_VERSION}") - if (NOT ARMADILLO_FOUND) + if (NOT ARMADILLO_FOUND AND NOT CMAKE_CROSSCOMPILING) find_package(BLAS QUIET) find_package(LAPACK QUIET) if (NOT BLAS_FOUND AND NOT LAPACK_FOUND) From 99e4b6b2aef26f416df1227ec88f60430c81034c Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 20 Jun 2021 10:35:05 +0200 Subject: [PATCH 8/8] Separate both of the check Signed-off-by: Omar Shrit --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abddba2c1f..cc5e4a5dc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,11 +279,13 @@ if (DISABLE_DOWNLOADS) find_package(Armadillo "${ARMADILLO_VERSION}" REQUIRED) else() find_package(Armadillo "${ARMADILLO_VERSION}") - if (NOT ARMADILLO_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(BLAS QUIET) - find_package(LAPACK QUIET) - if (NOT BLAS_FOUND AND NOT LAPACK_FOUND) - message(FATAL_ERROR "Can not find BLAS or LAPACK! These are required for Armadillo. Please install one of them---or install Armadillo---before installing mlpack.") + if (NOT ARMADILLO_FOUND) + if (NOT CMAKE_CROSSCOMPILING) + find_package(BLAS QUIET) + find_package(LAPACK QUIET) + if (NOT BLAS_FOUND AND NOT LAPACK_FOUND) + message(FATAL_ERROR "Can not find BLAS or LAPACK! These are required for Armadillo. Please install one of them---or install Armadillo---before installing mlpack.") + endif() endif() get_deps(http://files.mlpack.org/armadillo-10.3.0.tar.gz armadillo armadillo-10.3.0.tar.gz) set(ARMADILLO_INCLUDE_DIR ${GENERIC_INCLUDE_DIR})