head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.20 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.18 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.16 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.14 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.12 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.10 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.8 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.6 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.4 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.2 pkgsrc-2023Q4-base:1.1; locks; strict; comment @# @; 1.1 date 2023.12.19.12.28.50; author thor; state Exp; branches; next ; commitid tq0LVbCzJq5pA4RE; desc @@ 1.1 log @math/armadillo: C++ linear algebra library longer form: Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use Provides high-level syntax and functionality deliberately similar to Matlab Useful for algorithm development directly in C++, or quick conversion of research code into production environments Provides efficient classes for vectors, matrices and cubes; dense and sparse matrices are supported Integer, floating point and complex numbers are supported A sophisticated expression evaluator (based on template meta-programming) automatically combines several operations to increase speed and efficiency Dynamic evaluation automatically chooses optimal code paths based on detected matrix structures Various matrix decompositions (eigen, SVD, QR, etc) are provided through integration with LAPACK, or one of its high performance drop-in replacements (eg. MKL or OpenBLAS) Can automatically use OpenMP multi-threading (parallelisation) to speed up computationally expensive operations Distributed under the permissive Apache 2.0 license, useful for both open-source and proprietary (closed-source) software Can be used for machine learning, pattern recognition, computer vision, signal processing, bioinformatics, statistics, finance, etc @ text @$NetBSD$ Make the build just use the modern FindBLAS and FindLAPACK builtins of a recent-ish cmake. That avoids so much trouble forcing choices. --- CMakeLists.txt.orig 2016-06-16 16:27:07.000000000 +0000 +++ CMakeLists.txt @@@@ -28,7 +28,7 @@@@ ## NOTE: More details: https://arma.sourceforge.net/faq.html -cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.6 FATAL_ERROR) if(NOT (${CMAKE_MAJOR_VERSION} LESS 3)) if(POLICY CMP0025) @@@@ -249,194 +249,21 @@@@ message(STATUS "*** Looking for external ## Find LAPACK and BLAS libraries, or their optimised versions ## -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/") - -if(APPLE) - message(STATUS "Detected macOS") - - set(ARMA_USE_LAPACK true) - set(ARMA_USE_BLAS true) - set(ARMA_USE_ACCELERATE true) - - if(ALLOW_OPENBLAS_MACOS) - include(ARMA_FindOpenBLAS) - message(STATUS "OpenBLAS_FOUND = ${OpenBLAS_FOUND}") - message(STATUS "") - message(STATUS "*** If use of OpenBLAS is causing problems,") - message(STATUS "*** rerun cmake with detection of OpenBLAS disabled:") - message(STATUS "*** cmake -D ALLOW_OPENBLAS_MACOS=false .") - message(STATUS "") - - if(OpenBLAS_FOUND) - set(ARMA_LIBS ${ARMA_LIBS} ${OpenBLAS_LIBRARIES}) - set(ARMA_USE_ACCELERATE false) - endif() - endif() - - if(ALLOW_BLAS_LAPACK_MACOS) - include(ARMA_FindBLAS) - include(ARMA_FindLAPACK) - message(STATUS " BLAS_FOUND = ${BLAS_FOUND}" ) - message(STATUS "LAPACK_FOUND = ${LAPACK_FOUND}") - message(STATUS "") - message(STATUS "*** If use of BLAS and LAPACK is causing problems,") - message(STATUS "*** rerun cmake with detection of BLAS and LAPACK disabled:") - message(STATUS "*** cmake -D ALLOW_BLAS_LAPACK_MACOS=false .") - message(STATUS "") - - if(BLAS_FOUND AND LAPACK_FOUND) - set(ARMA_LIBS ${ARMA_LIBS} ${BLAS_LIBRARIES}) - set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) - set(ARMA_USE_ACCELERATE false) - endif() - endif() - - if(ARMA_USE_ACCELERATE) - set(ARMA_LIBS ${ARMA_LIBS} "-framework Accelerate") # or "-framework accelerate" ? - message(STATUS "Added '-framework Accelerate' to compiler flags") - endif() - - if(DEFINED CMAKE_CXX_COMPILER_ID) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - message(STATUS "Detected Clang compiler on macOS. Added '-stdlib=libc++' to compiler flags") - endif() - - if(NOT (${CMAKE_MAJOR_VERSION} LESS 3)) - if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - message(STATUS "Detected AppleClang compiler on macOS. Added '-stdlib=libc++' to compiler flags") - endif() - endif() - endif() - - set(CMAKE_MACOSX_RPATH 1) - -else() - - if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) - include(ARMA_FindFlexiBLAS) - else() - set(FlexiBLAS_FOUND false) - endif() - - include(ARMA_FindMKL) - include(ARMA_FindOpenBLAS) - include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version - include(ARMA_FindBLAS) - include(ARMA_FindLAPACK) - - message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) - message(STATUS " MKL_FOUND = ${MKL_FOUND}" ) - message(STATUS " OpenBLAS_FOUND = ${OpenBLAS_FOUND}" ) - message(STATUS " ATLAS_FOUND = ${ATLAS_FOUND}" ) - message(STATUS " BLAS_FOUND = ${BLAS_FOUND}" ) - message(STATUS " LAPACK_FOUND = ${LAPACK_FOUND}" ) - - if(FlexiBLAS_FOUND) - - set(ARMA_USE_LAPACK true) - set(ARMA_USE_BLAS true) - - set(ARMA_LIBS ${ARMA_LIBS} ${FlexiBLAS_LIBRARIES}) - - message(STATUS "") - message(STATUS "*** Using FlexiBLAS to access BLAS and LAPACK functions.") - message(STATUS "*** https://www.mpi-magdeburg.mpg.de/projects/flexiblas") - message(STATUS "*** WARNING: SuperLU and ARPACK must also link with FlexiBLAS.") - message(STATUS "") - message(STATUS "*** If using FlexiBLAS causes problems, ") - message(STATUS "*** rerun cmake with FlexiBLAS detection disabled:") - message(STATUS "*** cmake -D ALLOW_FLEXIBLAS_LINUX=false .") - message(STATUS "") - - elseif(MKL_FOUND) - - set(ARMA_USE_LAPACK true) - set(ARMA_USE_BLAS true) - set(ARMA_LIBS ${ARMA_LIBS} ${MKL_LIBRARIES}) - - message(STATUS "") - message(STATUS "*** If the MKL libraries are installed in non-standard locations such as") - message(STATUS "*** /opt/intel/mkl, /opt/intel/composerxe/, /usr/local/intel/mkl") - message(STATUS "*** make sure the run-time linker can find them.") - message(STATUS "*** On Linux systems this can be done by editing /etc/ld.so.conf") - message(STATUS "*** or modifying the LD_LIBRARY_PATH environment variable.") - message(STATUS "") - message(STATUS "*** On systems with SELinux enabled (eg. Fedora, RHEL),") - message(STATUS "*** you may need to change the SELinux type of all MKL libraries") - message(STATUS "*** to fix permission problems that may occur during run-time.") - message(STATUS "") - - else() - - if(OpenBLAS_FOUND AND ATLAS_FOUND) - message(STATUS "") - message(STATUS "*** NOTE: found both OpenBLAS and ATLAS; ATLAS will not be used") - endif() - - if(OpenBLAS_FOUND AND BLAS_FOUND) - message(STATUS "") - message(STATUS "*** NOTE: found both OpenBLAS and BLAS; BLAS will not be used") - endif() - - if(OpenBLAS_FOUND) - - set(ARMA_USE_BLAS true) - set(ARMA_LIBS ${ARMA_LIBS} ${OpenBLAS_LIBRARIES}) - - if(OPENBLAS_PROVIDES_LAPACK) - set(ARMA_USE_LAPACK true) - else() - message(STATUS "") - message(STATUS "*** NOTE: if OpenBLAS is known to provide LAPACK functions, recommend to") - message(STATUS "*** NOTE: rerun cmake with the OPENBLAS_PROVIDES_LAPACK option enabled:") - message(STATUS "*** NOTE: cmake -D OPENBLAS_PROVIDES_LAPACK=true .") - endif() - - message(STATUS "") - message(STATUS "*** If the OpenBLAS library is installed in") - message(STATUS "*** /usr/local/lib or /usr/local/lib64") - message(STATUS "*** make sure the run-time linker can find it.") - message(STATUS "*** On Linux systems this can be done by editing /etc/ld.so.conf") - message(STATUS "*** or modifying the LD_LIBRARY_PATH environment variable.") - message(STATUS "") - - else() - - if(ATLAS_FOUND) - set(ARMA_USE_ATLAS true) - set(ARMA_LIBS ${ARMA_LIBS} ${ATLAS_LIBRARIES}) - - message(STATUS "") - message(STATUS "*** NOTE: support for ATLAS is deprecated and will be removed;") - message(STATUS "*** NOTE: recommend to use OpenBLAS or FlexiBLAS instead.") - message(STATUS "") - endif() - - if(BLAS_FOUND) - set(ARMA_USE_BLAS true) - set(ARMA_LIBS ${ARMA_LIBS} ${BLAS_LIBRARIES}) - endif() - - endif() - - if(LAPACK_FOUND) - if(OpenBLAS_FOUND AND OPENBLAS_PROVIDES_LAPACK) - message(STATUS "*** NOTE: found both OpenBLAS and LAPACK;") - message(STATUS "*** NOTE: option OPENBLAS_PROVIDES_LAPACK is enabled,") - message(STATUS "*** NOTE: so will not link with plain LAPACK.") - message(STATUS "") - else() - set(ARMA_USE_LAPACK true) - set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) - endif() - endif() - - endif() - +# In a nice world, this encompasses any implementation, including +# Acclerate. +find_package(BLAS) +find_package(LAPACK) +message(STATUS " BLAS_FOUND = ${BLAS_FOUND} (${BLAS_LIBRARIES})" ) +message(STATUS " LAPACK_FOUND = ${LAPACK_FOUND} (${LAPACK_LIBRARIES})" ) +if(BLAS_FOUND AND LAPACK_FOUND) + set(ARMA_LIBS ${ARMA_LIBS} ${BLAS_LIBRARIES}) + set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) + set(ARMA_USE_LAPACK true) + set(ARMA_USE_BLAS true) + set(ARMA_USE_ACCELERATE false) endif() +set (CMAKE_MODULE_PATH "/data/projekte/pkgsrc/work/math/armadillo/work/.buildlink/cmake-Modules" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/") include(ARMA_FindARPACK) message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}") @@@@ -462,16 +289,6 @@@@ if(NOT ARMA_USE_LAPACK) message(STATUS "") message(STATUS "*** WARNING: Use of LAPACK is not enabled, as no LAPACK compatible library has been found.") message(STATUS "*** WARNING: This will materially degrade the available functionality in Armadillo.") - - if(OpenBLAS_FOUND) - message(STATUS "") - message(STATUS "*** NOTE: OpenBLAS found but LAPACK not found.") - message(STATUS "*** NOTE: OpenBLAS may have been built without LAPACK functions,") - message(STATUS "*** NOTE: so cannot assume that LAPACK functions are available.") - message(STATUS "*** NOTE: To forcefully assume that OpenBLAS provides LAPACK functions,") - message(STATUS "*** NOTE: rerun cmake with the OPENBLAS_PROVIDES_LAPACK option enabled:") - message(STATUS "*** NOTE: cmake -D OPENBLAS_PROVIDES_LAPACK=true .") - endif() endif() @