GithubHelp home page GithubHelp logo

tlapack / tlapack Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 22.0 4.74 MB

C++ Template Linear Algebra PACKage

License: BSD 3-Clause "New" or "Revised" License

CMake 2.24% C++ 74.73% Fortran 0.10% C 21.04% Python 1.90%
blas lapack linear-algebra

tlapack's Introduction

<T>LAPACK

C++ Template Linear Algebra PACKage

License Continuous Testing Doxygen ClangFormat CodeQL OpenSSF Scorecard OpenSSF Best Practices

About

First things to know about <T>LAPACK:

  1. We write   <T>LAPACK   whenever it is possible. This includes all software documentation, discussions, and presentation.
  2. We say it   T-L-A-PACK   .
  3. We use   tlapack   for files, folders, and links, to make it more portable and easier to use.

<T>LAPACK provides:

  • Precision-neutral function template implementation

Supported in part by NSF ACI 2004850.

Current functionality

<T>LAPACK is a work in progress (WIP) project. This is a list of the current functionality:

  • BLAS
    • Level 1, except SDSDOT.
    • Level 2, except the routines for banded and packed formats (xGBMV, xHBMV, xHPMV, xSBMV, xSPMV, xTBMV, xTPMV, xTBSV, xTPSV, xHPR, xHPR2, xSPR, xSPR2).
    • Level 3.
  • Linear solvers
    • Safe scaling triangular solve
    • Safe scaling solver for Sylvester equations
  • Matrix factorizations
    • Cholesky
      • Recursive
      • Blocked
    • Fully pivoted QR
    • Fully pivoted RQ
    • Fully pivoted LQ
    • Fully pivoted QL
    • Hessenberg reduction
      • Level-2
      • Blocked
    • Householder QR
      • Level-2
      • Blocked
    • Householder RQ
      • Level-2
      • Blocked
    • Householder LQ
      • Level-2
      • Blocked
    • Householder QL
      • Level-2
      • Blocked
    • Householder bidiagonalization
      • Level-2
      • Blocked
    • LU with partial pivoting
      • Level-0
      • Recursive
  • Matrix inversion
    • General matrix
      • Method C from §14.3.3 in [1]
      • Method D from §14.3.4 in [1]
    • Hermitian positive definite
    • Triangular matrix
      • Recursive
  • Norms of general, hermitian, symmetric and triangular matrices
    • 1-norm
    • Infinity-norm
    • Frobenius-norm
    • Max-norm
  • Nonsymmetric Eigenvalue Problem
    • Schur decomposition
      • Double-shift implicit QR
      • Multishift implicit QR with Aggressive Early Deflation (AED)
    • Eigenvector computation
    • Swap eigenvalues in Schur form
    • Generalized Schur problem
    • Generalized eigenvalue problem
  • Symmetric Eigenvalue Problem
    • Tridiagonal reduction
    • Eigenvector computation
  • Singular Value Decomposition (SVD)
    • Standard singular value problem
    • Generalized singular value problem
  • Linear least squares
    • Using QR factorization
    • Using SVD
  • Additional kernels
    • Order 1 and 2 Sylvester equation solver
    • In-place upper times lower triangular matrix multiplication for general and hermitian matrices
    • In-place lower times upper triangular matrix multiplication
    • In-place transpose of a matrix

The complete documentation and implementation for the routines that are available are listed in the API documentation.

Installation

<T>LAPACK is built and installed with CMake.

Getting CMake

You can either download binaries for the latest stable or previous release of CMake, or build the current development distribution from source. CMake is also available in the APT repository on Ubuntu 16.04 or higher.

Building and Installing <T>LAPACK

<T>LAPACK can be build following the standard CMake recipe

cmake -B build .      # configuration step
cmake --build build   # build step

To install <T>LAPACK in your system, use

cmake -B build -D CMAKE_INSTALL_PREFIX=/path/to/install . # configuration step
cmake --build build --target install                      # install step

CMake options

Standard environment variables affect CMake. Some examples are

CXX                 C++ compiler
CXXFLAGS            C++ compiler flags
LDFLAGS             linker flags

The Fortran and C wrappers to <T>LAPACK also use, among others,

CC                  C compiler
CFLAGS              C compiler flags
FC                  Fortran compiler
FFLAGS              Fortran compiler flags
  • This page lists the environment variables that have special meaning to CMake.

It is also possible to pass variables to CMake during the configuration step using the -D flag. The following example builds <T>LAPACK in debug mode inside the directory build

mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=Debug .
cmake --build build
  • This page documents variables that are provided by CMake or have meaning to CMake when set by project code.

<T>LAPACK options

Here are the <T>LAPACK specific options and their default values

# Option                            # Default

BUILD_BLASPP_TESTS                  OFF

    Use BLAS++ tests to test <T>LAPACK templates.
    REQUIRES: BUILD_TESTING=ON

BUILD_EXAMPLES                      ON

    Build examples

BUILD_LAPACKPP_TESTS                OFF

    Use LAPACK++ tests to test <T>LAPACK templates.
    REQUIRES: BUILD_TESTING=ON

BUILD_STANDALONE_TESTS              OFF

    Build tests as standalone executables in addition to tests for CTest.
    The executables are installed in the test directory.
    The executables do not use Catch2.
    REQUIRES: BUILD_TESTING=ON

BUILD_testBLAS_TESTS                ON

    Build testBLAS tests.
    REQUIRES: BUILD_TESTING=ON

BUILD_TESTING                       ON

    Build the testing tree

BUILD_C_WRAPPERS                          OFF

    Build and install C wrappers (Work In Progress)

BUILD_CBLAS_WRAPPERS                      OFF

    Build and install CBLAS wrappers (Work In Progress)

BUILD_Fortran_WRAPPERS                    OFF

    Build and install Fortran wrappers (Work In Progress)

TLAPACK_CHECK_INPUT                 ON

    Enable checks on input arguments.
    REQUIRES: TLAPACK_NDEBUG=OFF

TLAPACK_DEFAULT_INFCHECK            ON

    Default behavior of checks for Infs. Checks can be activated/deactivated at runtime.
    REQUIRES: TLAPACK_NDEBUG=OFF
              TLAPACK_ENABLE_INFCHECK=ON

TLAPACK_DEFAULT_NANCHECK            ON

    Default behavior of checks for NaNs. Checks can be activated/deactivated at runtime.
    REQUIRES: TLAPACK_NDEBUG=OFF
              TLAPACK_ENABLE_NANCHECK=ON

TLAPACK_ENABLE_INFCHECK             OFF

    Enable check for Infs as specified in the documentation of each routine.
    REQUIRES: TLAPACK_NDEBUG=OFF

TLAPACK_ENABLE_NANCHECK             OFF

    Enable check for NaNs as specified in the documentation of each routine.
    REQUIRES: TLAPACK_NDEBUG=OFF

TLAPACK_INT_T                       int64_t

    Type of all non size-related integers in libtlapack_c, libtlapack_cblas, libtlapack_fortran, and in the routines of the legacy API. It is the type
    used for the array increments, e.g., incx and incy.
    Supported types:
        int, short, long, long long, int8_t, int16_t,
        int32_t, int64_t, int_least8_t, int_least16_t,
        int_least32_t, int_least64_t, int_fast8_t,
        int_fast16_t, int_fast32_t, int_fast64_t,
        intmax_t, intptr_t, ptrdiff_t
    NOTE: TLAPACK_INT_T=int64_t if TLAPACK_USE_LAPACKPP=ON

TLAPACK_NDEBUG                      OFF

    Disable all error checks.

TLAPACK_SIZE_T                      size_t

    Type of all size-related integers in libtlapack_c, libtlapack_cblas, libtlapack_fortran, and in the routines of the legacy API.
    Supported types:
        int, short, long, long long, int8_t, int16_t,
        int32_t, int64_t, int_least8_t, int_least16_t,
        int_least32_t, int_least64_t, int_fast8_t,
        int_fast16_t, int_fast32_t, int_fast64_t,
        intmax_t, intptr_t, ptrdiff_t,
        size_t, uint8_t, uint16_t, uint32_t, uint64_t
    NOTE: TLAPACK_SIZE_T=int64_t if TLAPACK_USE_LAPACKPP=ON

TLAPACK_USE_LAPACKPP               OFF

    Use LAPACK++ wrappers to link with optimized BLAS and LAPACK libraries.
    Mind that LAPACK++ needs BLAS++.
    Branches compatible with <T>LAPACK:
        https://bitbucket.org/weslleyspereira/blaspp/branch/tlapack
        https://bitbucket.org/weslleyspereira/lapackpp/branch/tlapack

Dependencies on other projects

<T>LAPACK currently depends on the following projects:

Project Version When
CMake >= v3.14 Always
ClangFormat 10 Always
Catch2 >= 3.0.1 BUILD_TESTING=ON
Git - BUILD_BLASPP_TESTS=ON OR BUILD_LAPACKPP_TESTS=ON
github.com/icl-utk-edu/testsweeper >= 2021.04.00 BUILD_BLASPP_TESTS=ON OR BUILD_LAPACKPP_TESTS=ON
LAPACK >= 3.9.0 BUILD_BLASPP_TESTS=ON OR BUILD_LAPACKPP_TESTS=ON
ICL BLAS++ test suite 2023.06.00 BUILD_BLASPP_TESTS=ON
ICL LAPACK++ test suite 2022.07.00 BUILD_LAPACKPP_TESTS=ON
LAPACKE >= 3.9.0 BUILD_LAPACKPP_TESTS=ON
github.com/tlapack/testBLAS Latest BUILD_testBLAS_TESTS=ON

Note that:

  • The CMake build system is prepared to download Catch2 and testsweeper whenever they are not available in the system.
  • ICL BLAS++ and LAPACK++ test suites and testBLAS are Git submodules of <T>LAPACK. The are downloaded and built when the corresponding options are set to ON.

<T>LAPACK may also use the following projects when available:

Project Version tested When
ICL BLAS++ 2023.11.05 TLAPACK_USE_LAPACKPP=ON
ICL LAPACK++ 2023.11.05 TLAPACK_USE_LAPACKPP=ON
kokkos mdspan 0.4.0 TLAPACK_TEST_MDSPAN=ON or in some examples
Eigen commit: 2873916f TLAPACK_TEST_EIGEN=ON or in some examples
GNU MPFR C++ Latest in APT TLAPACK_TEST_MPFR=ON or in some examples
GNU libquad Latest in APT TLAPACK_TEST_QUAD=ON
StarPU 1.4.1 Running StarPU examples

We also continuously test <T>LAPACK with optimized BLAS and LAPACK implementations: OpenBLAS, Intel MKL, Flame BLIS, LAPACK, Netlib BLAS.

Note

<T>LAPACK supports Eigen v3.4.0 after applying the patch 9210e71f. This commit fixes an ADL conflict between Eigen::internal::size() and std::size().

Documentation

The documentation of <T>LAPACK is generated using Doxygen. The documentation is available online at https://tlapack.github.io/tlapack. Alternatively, you can generate the documentation in your local machine. To do so, follow the steps below:

  • Install Doxygen in your local machine. See the Doxygen installation page for more details.

  • In the top directory of <T>LAPACK, run doxygen docs/Doxyfile to generate the <T>LAPACK documentation via Doxygen in your local machine.

Additional information about the software can be found in the Wiki pages of the project.

Contributing

Please read CONTRIBUTING.md for details on how to contribute to <T>LAPACK.

Testing

<T>LAPACK is continuously tested on Ubuntu, MacOS and Windows using GNU compilers. See the latest test results in the Github Actions webpage for <T>LAPACK. The tests split into three categories:

  • Test routines in test/src using

    1. various precision types: float, double, std::complex<float>, std::complex<double> and Eigen::half.

    2. various matrix and vector data structures: tlapack::LegacyMatrix, Eigen::Matrix and std::experimental::mdspan (the latter from https://github.com/kokkos/mdspan).

  • Tests from testBLAS for good conformance with BLAS standards.

  • BLAS++ testers and LAPACK++ testers for measuring performance and accuracy compared to LAPACKE.

To test <T>LAPACK, build with BUILD_TESTING=ON. Then, run ctest inside the build directory.

License

BSD 3-Clause License

Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.

Copyright (c) 2017-2021, University of Tennessee. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

References

[1] Higham, N. J. (2002). Accuracy and stability of numerical algorithms. Society for industrial and applied mathematics.

tlapack's People

Contributors

alilotfi90 avatar dependabot[bot] avatar hmk46 avatar katherinechua avatar langou avatar lindsay-slager avatar meieraheidi avatar rileyjmurray avatar step-security-bot avatar thijssteel avatar weslleyspereira avatar yuxincai11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tlapack's Issues

random number generator

I think we need to write our own random number generator, separate from c++.

That way, our tests are always the same, regardless of what machine they are running on. If someone (or the ci) reports a failure, we can easily recover what matrix it was and debug it on our own machine.

rotg calls fortran rotg

When I asked about rotg, @weslleyspereira said it should now be as accurate as lartg. I have not verified this, but it seems to call blas::rotg if the blaspp wrappers are enabled. That version is definitely not as accurate as lartg.

Fix documentation

The documentation for the abstract interfaces is wrong, mainly because the arguments of the routines changed:

  • (A,m,n,lda) -> abstract A
  • (x,n,incx) -> abstract x

This should be fixed.

Use of assertions

I think it's a good idea to use assertions in the vector and matrix access functions, for example:

        inline constexpr T&
        operator[]( idx_t i ) const noexcept {
            assert( i >= 0);
            assert( i < n);
            return (direction == Direction::Forward)
                ? *(ptr + (i*inc))
                : *(ptr + ((n-1)-i)*inc);
        }

I would add this to functions like [] and (), but also to subvector, submatrix, ....

This would massively help us to find bugs, and assertions are disabled during a production build so it won't actually cost us any performance.

which swap should we use tlapack/blas/swap.hpp or std::swap ?

which swap should we use tlapack/blas/swap.hpp or std::swap ?
getrf_recursive seems to include tlapack/blas/swap.hpp and use std::swap

See:

#include "tlapack/blas/swap.hpp"

if (Piv[0] != 0) std::swap(A(Piv[0], 0), A(0, 0));

tlapack::swap(vect1, vect2);

Do we use std::swap to swap two scalars and tlapack/blas/swap.hpp to swap vectors?

I would be happy to propose a PR if someone lets me know what to do

We allow different matrix types, but always test with the same

for example, gemm can accept three different types for its three matrices, but the way we are testing now, we only test with the same matrix type (i think).

a similar issue is that we only test for arithmetic types of the same type of the matrix.

However, testing everything would quickly lead to a combinatorial explosion. Not sure what we should do.

Tests fail to build: error: no member named 'lartg' in namespace 'lapack'

In file included from /disk-samsung/freebsd-ports/math/tlapack/work/.build/_deps/testblas-src/src/test_infNaN.cpp:14:
In file included from /disk-samsung/freebsd-ports/math/tlapack/work/tlapack-77352a9/include/legacy_api/blas.hpp:13:
/disk-samsung/freebsd-ports/math/tlapack/work/tlapack-77352a9/include/optimized/wrappers.hpp:192:15: error: no member named 'lartg' in namespace 'lapack'
    ::lapack::lartg( a, b, &c, &s, &r );
    ~~~~~~~~~~^
/disk-samsung/freebsd-ports/math/tlapack/work/tlapack-77352a9/include/optimized/wrappers.hpp:212:15: error: no member named 'lartg' in namespace 'lapack'
    ::lapack::lartg( a, b, &c, &s, &r );
    ~~~~~~~~~~^
2 errors generated.

Rev,77352a9
lapackpp-2022.05.00
clang-13.1
FreeBSD 13.1

Add a way to construct matrices given a pointer and dimensions

We should have a function like:

    template< class matrix_t >
    inline constexpr matrix_t construct_matrix( type_t<matrix_t> * ptr, size_type<matrix_t> m, size_type<matrix_t> n );

so that we can call

    auto work = construct_matrix<matrix_t>( &work[0], m, n ); 

or maybe even

    matrix_t work = construct_matrix( &work[0], m, n ); 

for vectors, maybe we can just generically do:

     template< typename matrix_t >
     inline auto construct_vector(  type_t<matrix_t> * ptr, size_type<matrix_t> n){
         auto temp = construct_matrix( ptr,  n, 1);
         return col(temp, 0);
     }

to avoid having to define a different function for each matrix type

@weslleyspereira I tried implementing it, but since you wrote all those plugins, maybe you'll be better at it.

Suggested interface change for gelqf

Right now the routine gelqf has the signature:

gelqf( A, TT, opts)

TT stores the upper triangular factors and also serves as workspace. Allowing them to be reused later.

I don't like this for two reasons:

  • It makes the interface gelqf incompatible with gelq2 and makes the legacy interface more difficult
  • TT depends on nb, which is an optional argument. Essentially, to make good code, this means that nb is no longer optional.

Proposed change:

  • Make TT an optional argument and replace the mandatory interface with tau

ladiv does not have the good implementation from LAPACK

The code in <T>LAPACK came from https://github.com/langou/latl/blob/master/include/ladiv.h. This is simpler than the one in LAPACK: https://netlib.org/lapack/explore-html/df/d90/dladiv_8f_source.html, but the first does not concerns all cases where an Overflow may appear. For instance:

    double a, b, c, d, p, q;
    
    a = b = c = d = pow( 2.0, DBL_MAX_EXP-1 );
    tlapack::ladiv( a, b, c, d, p, q ); // Returns p = NaN and q = 0.0

How to solve: Implement the algorithm in LAPACK.

  • Include tests that evidence the issue

Conflict with std

@alilofti90 is implementing LU with partial pivoting. This routine needs to swap rows of the matrix. One of his issues was that the call swap( row1, row2 ) actually calls std::swap and not tlapack::swap, even when we are inside the namespace tlapack. This is the same problem of using tlapack::abs.

  • We should avoid name conflicts with std. I suggest we rename swap to deep_swap, swap_arrays or similar.

  • It is known std::complex<T>::abs may not propagate NaNs. This is the only reason <T>LAPACK has another implementation. This is an issue to be fixed upstream, i.e., in the std library. So (1) if we use std::complex as the complex type, we live with the NaN propagation issue; (2) we may specialize std::complex for our routines, so that we can redefine std::abs. I would need to test that (2) is a valid option.

Discussed in #133

Originally posted by alilotfi90 September 6, 2022
Hi,
There is a conflict between std swap and tlapack swap.

Improve the error checks in the tests

The tolerances we established for our tests can be improved. Currently,

  • many tests use tolerances that may be too loose.
  • there is no matrix conditioning in the estimates.
  • sometimes, one tolerance level is used to test different errors, e.g., in test_gelq2.cpp.

workspace compilation issues

gelqf contains an example of when we can use a submatrix as workspace.

workspace_opts_t<void> workopts(
            slice(TT, range(j, m), range(0, ib)));
larfb(Side::Right, Op::NoTrans, Direction::Forward, StoreV::Rowwise,
      A11, TT1, A12, workopts);

If i try to pass that same workspace to gelq2, compilation fails.

The following does work (removing <void>) but i don't fully understand why.

workspace_opts_t workopts(
            slice(TT, range(j, m), range(0, ib)));
gelq2(A11, tauw1, gelq2Opts);

move debug utils to .cpp

Since they define functions, not templated headers, the debug utils should be in a cpp, or at least the specific function instantiations should be.

CI runs twice

The CI is currently set to run on pull requests and on pushing any branch.

So if you push to a branch that has an open PR, the CI runs twice. I proprose we only run it for pull requests.

__ reserved

This is a bit pedantic, but any identifier containing __ (double underscore) or beginning with _ (underscore) is reserved in C++. So all the headers guards should be fixed, easiest just by removing the __:

__TLAPACK_LAPACKPP_WRAPPERS_HH__
change to
TLAPACK_LAPACKPP_WRAPPERS_HH

and internal variables should have trailing instead of leading underscores:

auto _x = legacy_vector(x);
change to
auto x_ = legacy_vector(x);

See https://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier

Replace if( "some-constexpr" ) by IF_CONSTEXPR( "some-constexpr" )

It seems a good idea to replace if( "some-constexpr" ) by IF_CONSTEXPR( "some-constexpr" ), where

#if __cplusplus >= 201703L
    #define IF_CONSTEXPR( expr ) if constexpr( expr ) // C++17 or higher
#else
    #define IF_CONSTEXPR( expr ) if( expr ) // C++14
#endif

This will enable the nice feature of C++17 when available. if constexpr is not for optimization, it is for improving code semantics. By using if constexpr, we assure the compiler only instantiates the correct code block. See the discussion here: https://stackoverflow.com/questions/54545565/if-constexpr-vs-if-in-light-of-compiler-optimization-and-code-performance

Should we create `namespace tlapack`?

I think so. Having a single global namespace avoids repeating definitions. Moreover, it would make more sense in terms of usage.

Currently, LAPACK has two namespaces: blas and lapack. This was inherited from the SLATE project. We could still maintain those namespaces behind namespace tlapack.

Fix LARF so that we do not have to edit A(i,i) to be one

I was reviewing @thijssteel PR#34 file gehd2.hpp, and I want to make a comment about larf.hpp. I have the same comment for geqr2.hpp. See:

A(i,i) = one;

We should edit larf.hpp so that larf.hpp does not access A(i,i).

A(i,i) in geqr2.hpp is v[0] in larf.hpp.

v[0] should be one and we should not access it. We should assume that v[0] is one and go with it.

The writing of v[0] = one in the routine that calls is an issue makes other parent routines not thread friendly. This happens more in larfb.hpp, ormqr.hpp, etc.

Let us fix this in larf.hpp to start with and then edit gehd2.hpp and geqr2.hpp accordingly. That would be a good start.

I understand that it is better to call ( one gemv.hpp and one ger.hpp ) instead of ( one gemv.hpp and one ger.hpp and one axpy.hpp, I think ), but the improved functionality is worth it in my opinion.

The code would be cleaner and this is important for thread friendliness.

One example of a related issue is: https://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=867

Dealing with complex and real values

I think a good way to deal with complex values in the same file is a few overloads for real valued numbers:

  • real(x) just returns x
  • imag(x) returns 0
  • 'conj(x)returnsx`.

I think that at that point, we can just always write our code as we are writing it for complex numbers, and i'll work for real numbers as well.
The compiler is very likely going to optimize those values away for real values so there should be no performance hit.

Implement reciprocal scaling

Reciprocal scaling is x := x/alpha, where x is an array. This operation is, in most cases, preferable to more x := (1/alpha)*x. For instance, the former has less accumulation error.

The technical report on the BLAS Standard, https://netlib.org/blas/blast-forum/blas-report.pdf, proposes the reciprocal scaling to be part of the BLAS. The current LAPACK code has its implementation of RSCL, but it relies on applying the BLAS SCAL to (1/alpha). MKL, for instance, has its own implementation of RSCL.

I think we should have a tlapack::rscl. I can propose the PR. Also, I can propose the PR in LAPACK++ so we can access code from MKL and other optimized libraries.

Non-namespaced macro pollutes the global namespace in a public header

#define A(i_, j_) A[ (i_) + (j_)*lda ]

The lapack/geqr2.hpp header unconditionally defines a macro A(i_, j_). Even though the macro is undefined on line 66 in the same header, this is a very short name that application could would be likely to define. If an application defines that macro and includes this header, a compiler error would result.

Given that this is a C++ project, not a C project, would you consider either using mdspan to
represent multidimensional arrays, or writing your own matrix view class for internal use?

Out of bounds in geqr2

I think i found a potential issue in geqr2. In the last iteration, i will be k-1 and the start index of x is out of bounds. This isn't technically an issue because x is also of size 0 and the value is never used, but with bounds checks enabled, this can be a problem.

auto x = subvector( col( A, i ), pair{i+1,m} );

Unm2r should be transposed

In the fortran code, the condition for positive increment is left and not notran, i.e. left and tran.

In tlapack, it is currently left and notran

Issue with CMakeLists.txt during configuration step

Hi there, @weslleyspereira and @langou! I just installed tlapack and got the example "geqr2" to work, but I had some hiccups in the installation process and I had to edit CMakeLists.txt to get things to work. Can one of you take a look below and let me know if you think those edits were avoidable?

Here's the full context of the configuration step:

(base) riley@borneophant:~/Documents/Research/tlapack/tlapack$ cmake -B build -D CMAKE_INSTALL_PREFIX=~/Documents/Reserch/tlapack/tlapack .
-- <T>LAPACK version 0.1.1
-- testBLAS not found. Trying to fetch from https://github.com/tlapack/testBLAS.git. It may take a while.
-- testBLAS version 0.1.2
-- Catch2 not found. Trying to fetch from https://github.com/catchorg/Catch2.git. It may take a while.
-- Using Catch2 from https://github.com/catchorg/Catch2.git.
-- Using testBLAS from https://github.com/tlapack/testBLAS.git.
CMake Error at CMakeLists.txt:197 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "ARCHIVE_OUTPUT_DIRECTORY" is not allowed.


CMake Error at CMakeLists.txt:197 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "LIBRARY_OUTPUT_DIRECTORY" is not allowed.


-- Configuring incomplete, errors occurred!
See also "/home/riley/Documents/Research/tlapack/tlapack/build/CMakeFiles/CMakeOutput.log".

I really don't know what to make of that message. Grasping at straws, I just commented out these lines in CMakeLists.txt:

tlapack/CMakeLists.txt

Lines 197 to 200 in ee39c93

set_target_properties( ${installable_libs}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )

It turns out, that worked! I was able to finish the configuration step and execute the other commands

cmake --build build
cmake --build build --target install

without problems.

Installation can be (shall be) improved

Currently, if I ask to install <T>LAPACK on /usr/local (the default installation directory), the headers will be installed in the following way:

/usr/local/include
├── base
│   ├── arrayTraits.hpp
│   ├── constants.hpp
│   ...
├── blas
│   ├── asum.hpp
│   ├── axpy.hpp
│   ...
├── lapack
│   ├── gehd2.hpp
│   ├── gehrd.hpp
│   ...
├── legacy_api
│   ├── base
│   │   ├── legacyArray.hpp
│   │   ├── mdspan.hpp
│   │   ...
│   ├── blas
│   │   ├── asum.hpp
│   │   ├── axpy.hpp
│   │   ...
│   ├── blas.hpp
│   ├── lapack
│   │   ├── geqr2.hpp
│   │   ├── lacpy.hpp
│   │   ...
│   ├── lapack.hpp
│   └── legacyArray.hpp
├── plugins
│   ├── tlapack_abstractArray.hpp
│   ├── tlapack_debugutils.hpp
│   ...
├── tblas.hpp
└── tlapack.hpp

This pollutes the installation directory with three new directories: base, blas, lapack, legacy_api and plugins. The names of those directories have no mention to tlapack. They can conflict with other installed packages. Other C++ template-based packages, like Eigen and slate, install under include/<package_name>/. I suggest we do the same.

I can propose a PR with:

  1. Move files from include/ to include/tlapack. I would just keep the file tlapack.hpp in include/.

  2. Change the #include "<foo.hpp>" to #include "tlapack/<foo.hpp>" on all files.

  3. Make the necessary changes on the CMakeLists.txt.

Test with MKL needs to be improved

A recent test log (https://github.com/tlapack/tlapack/runs/7199123151?check_suite_focus=true) shows:

2022-07-05T15:26:00.7384898Z The following tests FAILED:
2022-07-05T15:26:00.7386392Z 	181 - NANs work as expected - float (Failed)
2022-07-05T15:26:00.7386874Z 	182 - NANs work as expected - double (Failed)
2022-07-05T15:26:00.7387310Z 	183 - NANs work as expected - long double (Failed)
2022-07-05T15:26:00.7387897Z 	184 - NANs work as expected - std::complex<float> (Failed)
2022-07-05T15:26:00.7388428Z 	185 - NANs work as expected - std::complex<double> (Failed)
2022-07-05T15:26:00.7389171Z 	186 - NANs work as expected - std::complex<long double> (Failed)
2022-07-05T15:26:00.7389617Z 	187 - Infs work as expected - float (Failed)
2022-07-05T15:26:00.7390018Z 	188 - Infs work as expected - double (Failed)
2022-07-05T15:26:00.7391043Z Errors while running CTest
2022-07-05T15:26:00.7391384Z 	189 - Infs work as expected - long double (Failed)
2022-07-05T15:26:00.7391968Z 	190 - Infs work as expected - std::complex<float> (Failed)
2022-07-05T15:26:00.7392473Z 	191 - Infs work as expected - std::complex<double> (Failed)
2022-07-05T15:26:00.7392996Z 	192 - Infs work as expected - std::complex<long double> (Failed)
2022-07-05T15:26:00.7393495Z 	193 - tlapack::abs works as expected - float (Failed)
2022-07-05T15:26:00.7393971Z 	194 - tlapack::abs works as expected - double (Failed)
2022-07-05T15:26:00.7394467Z 	195 - tlapack::abs works as expected - long double (Failed)
2022-07-05T15:26:00.7394977Z 	196 - tlapack::abs works as expected - std::complex<float> (Failed)
2022-07-05T15:26:00.7395515Z 	197 - tlapack::abs works as expected - std::complex<double> (Failed)
2022-07-05T15:26:00.7396112Z 	198 - tlapack::abs works as expected - std::complex<long double> (Failed)
2022-07-05T15:26:00.7396805Z 	199 - std::abs works as expected - float (Failed)
2022-07-05T15:26:00.7397272Z 	200 - std::abs works as expected - double (Failed)
2022-07-05T15:26:00.7397750Z 	201 - std::abs works as expected - long double (Failed)
2022-07-05T15:26:00.7398413Z 	202 - std::abs works as expected - std::complex<float> (Failed)
2022-07-05T15:26:00.7398957Z 	203 - std::abs works as expected - std::complex<double> (Failed)
2022-07-05T15:26:00.7399614Z 	204 - std::abs works as expected - std::complex<long double> (Failed)
2022-07-05T15:26:00.7400114Z 	205 - Complex division works as expected - float (Failed)
2022-07-05T15:26:00.7400586Z 	206 - Complex division works as expected - double (Failed)
2022-07-05T15:26:00.7401072Z 	207 - Complex division works as expected - long double (Failed)
2022-07-05T15:26:00.7401623Z 	208 - Complex division works as expected - std::complex<float> (Failed)
2022-07-05T15:26:00.7402167Z 	209 - Complex division works as expected - std::complex<double> (Failed)
2022-07-05T15:26:00.7402878Z 	210 - Complex division works as expected - std::complex<long double> (Failed)
2022-07-05T15:26:00.7403441Z 	211 - iamax returns the first NaN for real arrays with at least 1 NaN - float (Failed)
2022-07-05T15:26:00.7403999Z 	212 - iamax returns the first NaN for real arrays with at least 1 NaN - double (Failed)
2022-07-05T15:26:00.7404759Z 	213 - iamax returns the first NaN for real arrays with at least 1 NaN - long double (Failed)
2022-07-05T15:26:00.7405422Z 	214 - iamax returns the first NaN for real arrays with at least 1 NaN - std::complex<float> (Failed)
2022-07-05T15:26:00.7406230Z 	215 - iamax returns the first NaN for real arrays with at least 1 NaN - std::complex<double> (Failed)
2022-07-05T15:26:00.7407049Z 	216 - iamax returns the first NaN for real arrays with at least 1 NaN - std::complex<long double> (Failed)
2022-07-05T15:26:00.7407745Z 	220 - iamax returns the first Inf for real arrays with at least 1 Inf and no NaNs - std::complex<float> (Failed)
2022-07-05T15:26:00.7408438Z 	222 - iamax returns the first Inf for real arrays with at least 1 Inf and no NaNs - std::complex<long double> (Failed)
2022-07-05T15:26:00.7409148Z 	223 - iamax works for complex data A when abs(real(A(k)))+abs(imag(A(k))) can overflow - std::complex<float> (Failed)
2022-07-05T15:26:00.7409849Z 	224 - iamax works for complex data A when abs(real(A(k)))+abs(imag(A(k))) can overflow - std::complex<double> (Failed)
2022-07-05T15:26:00.7410562Z 	225 - iamax works for complex data A when abs(real(A(k)))+abs(imag(A(k))) can overflow - std::complex<long double> (Failed)
2022-07-05T15:26:00.7411125Z 	226 - nrm2 returns NaN for real arrays with at least 1 NaN - float (Failed)
2022-07-05T15:26:00.7411798Z 	227 - nrm2 returns NaN for real arrays with at least 1 NaN - double (Failed)
2022-07-05T15:26:00.7412346Z 	228 - nrm2 returns NaN for real arrays with at least 1 NaN - long double (Failed)
2022-07-05T15:26:00.7412962Z 	229 - nrm2 returns NaN for real arrays with at least 1 NaN - std::complex<float> (Failed)
2022-07-05T15:26:00.7413567Z 	230 - nrm2 returns NaN for real arrays with at least 1 NaN - std::complex<double> (Failed)
2022-07-05T15:26:00.7414190Z 	231 - nrm2 returns NaN for real arrays with at least 1 NaN - std::complex<long double> (Failed)
2022-07-05T15:26:00.7414732Z 	232 - nrm2 returns Inf for real arrays with at least 1 Inf and no NaNs - float (Failed)
2022-07-05T15:26:00.7415289Z 	233 - nrm2 returns Inf for real arrays with at least 1 Inf and no NaNs - double (Failed)
2022-07-05T15:26:00.7415851Z 	234 - nrm2 returns Inf for real arrays with at least 1 Inf and no NaNs - long double (Failed)
2022-07-05T15:26:00.7416489Z 	235 - nrm2 returns Inf for real arrays with at least 1 Inf and no NaNs - std::complex<float> (Failed)
2022-07-05T15:26:00.7417310Z 	236 - nrm2 returns Inf for real arrays with at least 1 Inf and no NaNs - std::complex<double> (Failed)
2022-07-05T15:26:00.7417960Z 	237 - nrm2 returns Inf for real arrays with at least 1 Inf and no NaNs - std::complex<long double> (Failed)
2022-07-05T15:26:00.7418524Z 	238 - nrm2 with finite input which expects an exact output - float (Failed)
2022-07-05T15:26:00.7419035Z 	239 - nrm2 with finite input which expects an exact output - double (Failed)
2022-07-05T15:26:00.7419570Z 	240 - nrm2 with finite input which expects an exact output - long double (Failed)
2022-07-05T15:26:00.7420170Z 	241 - nrm2 with finite input which expects an exact output - std::complex<float> (Failed)
2022-07-05T15:26:00.7420785Z 	242 - nrm2 with finite input which expects an exact output - std::complex<double> (Failed)
2022-07-05T15:26:00.7421413Z 	243 - nrm2 with finite input which expects an exact output - std::complex<long double> (Failed)
2022-07-05T15:26:00.7422005Z 	244 - trsv propagates Infs and NaNs from the triangular matrix to the solution - float (Failed)
2022-07-05T15:26:00.7422599Z 	245 - trsv propagates Infs and NaNs from the triangular matrix to the solution - double (Failed)
2022-07-05T15:26:00.7423214Z 	246 - trsv propagates Infs and NaNs from the triangular matrix to the solution - long double (Failed)
2022-07-05T15:26:00.7423891Z 	247 - trsv propagates Infs and NaNs from the triangular matrix to the solution - std::complex<float> (Failed)
2022-07-05T15:26:00.7424661Z 	248 - trsv propagates Infs and NaNs from the triangular matrix to the solution - std::complex<double> (Failed)
2022-07-05T15:26:00.7425367Z 	249 - trsv propagates Infs and NaNs from the triangular matrix to the solution - std::complex<long double> (Failed)
2022-07-05T15:26:00.7426102Z 	250 - trsm propagates Infs and NaNs from the triangular matrix to the solution - float (Failed)
2022-07-05T15:26:00.7426697Z 	251 - trsm propagates Infs and NaNs from the triangular matrix to the solution - double (Failed)
2022-07-05T15:26:00.7430443Z 	252 - trsm propagates Infs and NaNs from the triangular matrix to the solution - long double (Failed)
2022-07-05T15:26:00.7431097Z 	253 - trsm propagates Infs and NaNs from the triangular matrix to the solution - std::complex<float> (Failed)
2022-07-05T15:26:00.7431708Z 	254 - trsm propagates Infs and NaNs from the triangular matrix to the solution - std::complex<double> (Failed)
2022-07-05T15:26:00.7432317Z 	255 - trsm propagates Infs and NaNs from the triangular matrix to the solution - std::complex<long double> (Failed)
2022-07-05T15:26:00.7432713Z 	257 - lapackpp_test (Failed)
2022-07-05T15:26:00.7433104Z 	304 - Hessenberg reduction is backward stable - types_to_test - 2 (Failed)
2022-07-05T15:26:00.7433548Z 	305 - Hessenberg reduction is backward stable - types_to_test - 3 (Failed)
2022-07-05T15:26:00.7433967Z 	308 - Hessenberg reduction is backward stable - types_to_test - 6 (Failed)
2022-07-05T15:26:00.7434411Z 	309 - Hessenberg reduction is backward stable - types_to_test - 7 (Failed)
2022-07-05T15:26:00.7434774Z 	336 - lahqr - types_to_test - 0 (Failed)
2022-07-05T15:26:00.7435073Z 	337 - lahqr - types_to_test - 1 (Failed)
2022-07-05T15:26:00.7435380Z 	340 - lahqr - types_to_test - 4 (Failed)
2022-07-05T15:26:00.7435683Z 	341 - lahqr - types_to_test - 5 (Failed)
2022-07-05T15:26:00.7451119Z ##[error]Process completed with exit code 8.

In particular, I found a couple of

Intel MKL ERROR: Parameter 7 was incorrect on entry to SSYRK .
Intel MKL ERROR: Parameter 8 was incorrect on entry to SGEMM .
Intel MKL ERROR: Parameter 7 was incorrect on entry to DSYRK .
Intel MKL ERROR: Parameter 8 was incorrect on entry to DGEMM .

We should verify the compatibility of the tests with the MKL.

List of finished routines in readme

I think it would be good to have a list of all the lapack methods (not their routine name, but their actual name, like banded LU) in the readme. Then we can add an icon whether or not it is actually available in LAPACK.

That would be good for us to track progress. And also good for any potential early adopters. I certainly appreciate it when i want to use a WIP library when they list what has and has not been implemented.

Missing extensive use of `tlapack_expr_with_vector`, `tlapack_expr_with_2vectors`, `tlapack_expr_with_vector_positiveInc`

While writing the performance example, I noticed the natural optimization associated incx=1 was not being used. The helpers: tlapack_expr_with_vector, tlapack_expr_with_2vectors, tlapack_expr_with_vector_positiveInc can help with that.

With these wrappers (maybe a couple more), it is easier to write the C++ wrappers in legacy_api in what concerns creating a vector directly from the raw pointer. Moreover, these helpers treat the case 'unitary increment' as a special case when creating the legacy vector from the raw pointer.

Here is how one of these wrappers is written:

    #define tlapack_expr_with_vector( x, TX, n, X, incx, expr ) do { \
        using internal::vector; \
        using internal::backward_vector; \
        if( incx == 1 ) { \
            auto x = vector( (TX*) X, n ); \
            expr; \
        } \
        else if( incx == -1 ) { \
            auto x = backward_vector( (TX*) X, n ); \
            expr; \
        } \
        else if( incx > 1 ) { \
            auto x = vector( (TX*) X, n, incx ); \
            expr; \
        } \
        else { \
            auto x = backward_vector( (TX*) X, n, -incx ); \
            expr; \
        } \
    } while(false)

A few routines (asum, her, axpy, gemv) use these helpers. All legacy_api wrappers using vectors can use these wrappers.

<T>LAPACK doesn't find catch2/catch.hpp

If Catch2 is installed (via CMake), then TLAPACK's CMake seems to find Catch2 (it doesn't download it), but it can't find catch2/catch.hpp during make. Notably, during Catch2 install, no catch.hpp is mentioned; see below.

If Catch2 is not installed, TLAPACK downloads it and everything works fine.

Catch2> git idx
3bd0c588 (HEAD -> devel, origin/devel, origin/HEAD) Fix Wunused-variable warning for MinGW

Catch2> git remote -v
origin	https://github.com/catchorg/Catch2.git (fetch)
origin	https://github.com/catchorg/Catch2.git (push)

Catch2> mkdir build && cd build

Catch2/build> cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install ..
-- The CXX compiler identification is GNU 10.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nfs/apps/spacks/2022-02-10/opt/spack/linux-centos7-x86_64/gcc-7.3.0/gcc-10.2.0-qjqscfshevigd64zj3wojtrp3v6j6o5a/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mgates/repos/Catch2/build

Catch2/build> make install
[  1%] Building CXX object src/CMakeFiles/Catch2.dir/catch2/reporters/catch_reporter_automake.cpp.o
...
[ 98%] Linking CXX static library libCatch2.a
[ 98%] Built target Catch2
[ 99%] Building CXX object src/CMakeFiles/Catch2WithMain.dir/catch2/internal/catch_main.cpp.o
[100%] Linking CXX static library libCatch2Main.a
[100%] Built target Catch2WithMain
Install the project...
-- Install configuration: ""
-- Installing: /home/mgates/install/lib64/cmake/Catch2/Catch2Config.cmake
-- Installing: /home/mgates/install/lib64/cmake/Catch2/Catch2ConfigVersion.cmake
-- Installing: /home/mgates/install/share/doc/Catch2
-- Installing: /home/mgates/install/share/doc/Catch2/own-main.md
-- Installing: /home/mgates/install/share/doc/Catch2/event-listeners.md
-- Installing: /home/mgates/install/share/doc/Catch2/reporter-events.md
-- Installing: /home/mgates/install/share/doc/Catch2/reporters.md
-- Installing: /home/mgates/install/share/doc/Catch2/command-line.md
-- Installing: /home/mgates/install/share/doc/Catch2/limitations.md
-- Installing: /home/mgates/install/share/doc/Catch2/migrate-v2-to-v3.md
-- Installing: /home/mgates/install/share/doc/Catch2/faq.md
-- Installing: /home/mgates/install/share/doc/Catch2/generators.md
-- Installing: /home/mgates/install/share/doc/Catch2/other-macros.md
-- Installing: /home/mgates/install/share/doc/Catch2/tutorial.md
-- Installing: /home/mgates/install/share/doc/Catch2/ci-and-misc.md
-- Installing: /home/mgates/install/share/doc/Catch2/release-process.md
-- Installing: /home/mgates/install/share/doc/Catch2/benchmarks.md
-- Installing: /home/mgates/install/share/doc/Catch2/tostring.md
-- Installing: /home/mgates/install/share/doc/Catch2/Readme.md
-- Installing: /home/mgates/install/share/doc/Catch2/matchers.md
-- Installing: /home/mgates/install/share/doc/Catch2/why-catch.md
-- Installing: /home/mgates/install/share/doc/Catch2/logging.md
-- Installing: /home/mgates/install/share/doc/Catch2/deprecations.md
-- Installing: /home/mgates/install/share/doc/Catch2/configuration.md
-- Installing: /home/mgates/install/share/doc/Catch2/release-notes.md
-- Installing: /home/mgates/install/share/doc/Catch2/assertions.md
-- Installing: /home/mgates/install/share/doc/Catch2/list-of-examples.md
-- Installing: /home/mgates/install/share/doc/Catch2/usage-tips.md
-- Installing: /home/mgates/install/share/doc/Catch2/contributing.md
-- Installing: /home/mgates/install/share/doc/Catch2/test-cases-and-sections.md
-- Installing: /home/mgates/install/share/doc/Catch2/cmake-integration.md
-- Installing: /home/mgates/install/share/doc/Catch2/opensource-users.md
-- Installing: /home/mgates/install/share/doc/Catch2/test-fixtures.md
-- Installing: /home/mgates/install/share/doc/Catch2/commercial-users.md
-- Installing: /home/mgates/install/lib64/cmake/Catch2/ParseAndAddCatchTests.cmake
-- Installing: /home/mgates/install/lib64/cmake/Catch2/Catch.cmake
-- Installing: /home/mgates/install/lib64/cmake/Catch2/CatchAddTests.cmake
-- Installing: /home/mgates/install/share/Catch2/gdbinit
-- Installing: /home/mgates/install/share/Catch2/lldbinit
-- Installing: /home/mgates/install/share/pkgconfig/catch2.pc
-- Installing: /home/mgates/install/share/pkgconfig/catch2-with-main.pc
-- Installing: /home/mgates/install/lib64/libCatch2.a
-- Installing: /home/mgates/install/lib64/libCatch2Main.a
-- Installing: /home/mgates/install/lib64/cmake/Catch2/Catch2Targets.cmake
-- Installing: /home/mgates/install/lib64/cmake/Catch2/Catch2Targets-noconfig.cmake
-- Installing: /home/mgates/install/include/catch2
-- Installing: /home/mgates/install/include/catch2/catch_timer.hpp
-- Installing: /home/mgates/install/include/catch2/catch_tag_alias.hpp
-- Installing: /home/mgates/install/include/catch2/catch_config.hpp
-- Installing: /home/mgates/install/include/catch2/internal
-- Installing: /home/mgates/install/include/catch2/internal/catch_textflow.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_istream.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_unique_name.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_move_and_forward.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_config_android_logwrite.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_debugger.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_context.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_console_width.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_xmlwriter.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_preprocessor.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_enum_values_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_case_sensitive.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_enforce.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_failure_exception.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_config_uncaught_exceptions.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_unique_ptr.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_stream_end_stop.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_debug_console.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_reporter_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_lazy_expr.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_case_registry_impl.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_preprocessor_remove_parens.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_clara.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_reusable_string_stream.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_uncaught_exceptions.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_case_tracker.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_stringref.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_void_type.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_random_number_generator.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_noncopyable.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_result_type.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_reporter_spec_parser.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_container_nonmembers.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_config_wchar.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_startup_exception_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_floating_point_helpers.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_section.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_to_string.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_template_test_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_tag_alias_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_console_colour.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_config_counter.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_polyfills.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_wildcard_pattern.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_source_line_info.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_windows_h_proxy.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_random_seed_generation.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_meta.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_singletons.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_list.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_exception_translator_registry.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_run_context.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_errno_guard.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_assertion_handler.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_string_manip.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_decomposer.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_sharding.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_spec_parser.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_platform.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_case_insensitive_comparisons.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_fatal_condition_handler.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_macro_impl.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_optional.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_message_info.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_output_redirect.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_test_case_info_hasher.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_stdstreams.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_commandline.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_compiler_capabilities.hpp
-- Installing: /home/mgates/install/include/catch2/internal/catch_leak_detector.hpp
-- Installing: /home/mgates/install/include/catch2/catch_version_macros.hpp
-- Installing: /home/mgates/install/include/catch2/generators
-- Installing: /home/mgates/install/include/catch2/generators/catch_generators_adapters.hpp
-- Installing: /home/mgates/install/include/catch2/generators/catch_generators_all.hpp
-- Installing: /home/mgates/install/include/catch2/generators/catch_generators_random.hpp
-- Installing: /home/mgates/install/include/catch2/generators/catch_generators_range.hpp
-- Installing: /home/mgates/install/include/catch2/generators/catch_generators.hpp
-- Installing: /home/mgates/install/include/catch2/generators/catch_generator_exception.hpp
-- Installing: /home/mgates/install/include/catch2/catch_session.hpp
-- Installing: /home/mgates/install/include/catch2/catch_translate_exception.hpp
-- Installing: /home/mgates/install/include/catch2/catch_approx.hpp
-- Installing: /home/mgates/install/include/catch2/catch_tag_alias_autoregistrar.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_estimate.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_outlier_classification.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_chronometer.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_run_for_at_least.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_measure.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_benchmark_function.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_complete_invoke.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_stats.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_analyse.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_estimate_clock.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_timing.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/detail/catch_repeat.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_benchmark.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_optimizer.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_execution_plan.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_clock.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_sample_analysis.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_benchmark_all.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_environment.hpp
-- Installing: /home/mgates/install/include/catch2/benchmark/catch_constructor.hpp
-- Installing: /home/mgates/install/include/catch2/catch_section_info.hpp
-- Installing: /home/mgates/install/include/catch2/reporters
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_automake.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_helpers.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_registrars.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_console.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_compact.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_multi.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporters_all.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_sonarqube.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_xml.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_teamcity.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_cumulative_base.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_event_listener.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_junit.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_tap.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_common_base.hpp
-- Installing: /home/mgates/install/include/catch2/reporters/catch_reporter_streaming_base.hpp
-- Installing: /home/mgates/install/include/catch2/catch_assertion_info.hpp
-- Installing: /home/mgates/install/include/catch2/catch_all.hpp
-- Installing: /home/mgates/install/include/catch2/catch_message.hpp
-- Installing: /home/mgates/install/include/catch2/catch_tostring.hpp
-- Installing: /home/mgates/install/include/catch2/catch_test_macros.hpp
-- Installing: /home/mgates/install/include/catch2/catch_totals.hpp
-- Installing: /home/mgates/install/include/catch2/catch_assertion_result.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_reporter_factory.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_all.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_generatortracker.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_testcase.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_capture.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_enum_values_registry.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_config.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_exception.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_reporter.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_reporter_registry.hpp
-- Installing: /home/mgates/install/include/catch2/interfaces/catch_interfaces_registry_hub.hpp
-- Installing: /home/mgates/install/include/catch2/catch_template_test_macros.hpp
-- Installing: /home/mgates/install/include/catch2/catch_test_spec.hpp
-- Installing: /home/mgates/install/include/catch2/catch_test_case_info.hpp
-- Installing: /home/mgates/install/include/catch2/matchers
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_predicate.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/internal
-- Installing: /home/mgates/install/include/catch2/matchers/internal/catch_matchers_impl.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_floating_point.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_quantifiers.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_container_properties.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_string.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_exception.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_contains.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_all.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_vector.hpp
-- Installing: /home/mgates/install/include/catch2/matchers/catch_matchers_templated.hpp
-- Installing: /home/mgates/install/include/catch2/catch_version.hpp
-- Up-to-date: /home/mgates/install/include/catch2
-- Installing: /home/mgates/install/include/catch2/catch_user_config.hpp


> cd ~/tlapack

tlapack> git idx
77352a9 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #86 from weslleyspereira/fix-issue-83

tlapack> mkdir build && cd build

tlapack/build> cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install -DUSE_LAPACKPP_WRAPPERS=on ..
-- The CXX compiler identification is GNU 10.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nfs/apps/spacks/2022-02-10/opt/spack/linux-centos7-x86_64/gcc-7.3.0/gcc-10.2.0-qjqscfshevigd64zj3wojtrp3v6j6o5a/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- <T>LAPACK version 0.1.1
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Could NOT find MPFR (missing: MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK) (Required is at least version "2.3.1")
-- Could NOT find GMP (missing: GMP_INCLUDES GMP_LIBRARIES) (Required is at least version "4.2.1")
-- testBLAS not found. Trying to fetch from https://github.com/tlapack/testBLAS.git. It may take a while.
-- testBLAS version 0.1.2
-- Using testBLAS from https://github.com/tlapack/testBLAS.git.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mgates/repos/tlapack/build-catch2

tlapack/build> make
[  2%] Building CXX object examples/geqr2/CMakeFiles/example_geqr2.dir/example_geqr2.cpp.o
[  7%] Building CXX object config/CMakeFiles/version.dir/version.cpp.o
[ 10%] Building CXX object examples/eigenvalues/CMakeFiles/example_eigenvalues.dir/example_eigenvalues.cpp.o
[ 17%] Building CXX object examples/cpp_visualizer/CMakeFiles/cpp_visualizer_example.dir/cpp_visualizer_example.cpp.o
[ 30%] Building CXX object examples/access_types/CMakeFiles/example_accessTypes.dir/example_accessTypes.cpp.o
[ 35%] Building CXX object test/src/CMakeFiles/test_blocked_francis.dir/test_blocked_francis.cpp.o
[ 46%] Building CXX object test/src/CMakeFiles/test_lasy2.dir/test_lasy2.cpp.o
[ 25%] Building CXX object examples/gemm/CMakeFiles/example_gemm.dir/example_gemm.cpp.o
[ 51%] Building CXX object test/CMakeFiles/tester.dir/tests_main.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_schur_move.dir/test_schur_move.cpp.o
[ 51%] Building CXX object test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN_iamax.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_transpose.dir/test_transpose.cpp.o
[ 51%] Building CXX object test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_corner_cases.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_gehrd.dir/test_gehrd.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_optBLAS.dir/test_optBLAS.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_unmhr.dir/test_unmhr.cpp.o
[ 51%] Building CXX object test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_schur_swap.dir/test_schur_swap.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_utils.dir/test_utils.cpp.o
[ 51%] Building CXX object test/src/CMakeFiles/test_unblocked_francis.dir/test_unblocked_francis.cpp.o
/home/mgates/repos/tlapack/test/src/test_blocked_francis.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/home/mgates/repos/tlapack/test/src/test_lasy2.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/src/CMakeFiles/test_blocked_francis.dir/test_blocked_francis.cpp.o] Error 1
make[2]: *** [test/src/CMakeFiles/test_lasy2.dir/test_lasy2.cpp.o] Error 1
make[1]: *** [test/src/CMakeFiles/test_blocked_francis.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [test/src/CMakeFiles/test_lasy2.dir/all] Error 2
/home/mgates/repos/tlapack/test/src/test_transpose.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/home/mgates/repos/tlapack/test/src/test_schur_swap.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/home/mgates/repos/tlapack/test/src/test_unmhr.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/home/mgates/repos/tlapack/test/src/test_optBLAS.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/home/mgates/repos/tlapack/test/src/test_unblocked_francis.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
/home/mgates/repos/tlapack/test/src/test_utils.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
/home/mgates/repos/tlapack/test/src/test_gehrd.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
compilation terminated.
/home/mgates/repos/tlapack/build-catch2/_deps/testblas-src/src/test_infNaN_iamax.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/src/CMakeFiles/test_transpose.dir/test_transpose.cpp.o] Error 1
make[1]: *** [test/src/CMakeFiles/test_transpose.dir/all] Error 2
make[2]: *** [test/src/CMakeFiles/test_schur_swap.dir/test_schur_swap.cpp.o] Error 1
make[2]: *** [test/src/CMakeFiles/test_optBLAS.dir/test_optBLAS.cpp.o] Error 1
make[1]: *** [test/src/CMakeFiles/test_schur_swap.dir/all] Error 2
make[2]: *** [test/src/CMakeFiles/test_unmhr.dir/test_unmhr.cpp.o] Error 1
make[1]: *** [test/src/CMakeFiles/test_optBLAS.dir/all] Error 2
make[1]: *** [test/src/CMakeFiles/test_unmhr.dir/all] Error 2
make[2]: *** [test/src/CMakeFiles/test_unblocked_francis.dir/test_unblocked_francis.cpp.o] Error 1
make[2]: *** [test/src/CMakeFiles/test_gehrd.dir/test_gehrd.cpp.o] Error 1
make[2]: *** [test/src/CMakeFiles/test_utils.dir/test_utils.cpp.o] Error 1
make[1]: *** [test/src/CMakeFiles/test_unblocked_francis.dir/all] Error 2
make[2]: make[1]: *** [test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN_iamax.cpp.o] Error 1
*** [test/src/CMakeFiles/test_gehrd.dir/all] Error 2
make[1]: *** [test/src/CMakeFiles/test_utils.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
/home/mgates/repos/tlapack/test/tests_main.cpp:8:10: fatal error: catch2/catch.hpp: No such file or directory
    8 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/home/mgates/repos/tlapack/test/src/test_schur_move.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/CMakeFiles/tester.dir/tests_main.cpp.o] Error 1
make[2]: *** [test/src/CMakeFiles/test_schur_move.dir/test_schur_move.cpp.o] Error 1
make[1]: *** [test/src/CMakeFiles/test_schur_move.dir/all] Error 2
/home/mgates/repos/tlapack/build-catch2/_deps/testblas-src/src/test_corner_cases.cpp:14:10: fatal error: catch2/catch.hpp: No such file or directory
   14 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_corner_cases.cpp.o] Error 1
[ 56%] Building CXX object test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN_nrm2.cpp.o
[ 56%] Building CXX object test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN_trsv_trsm.cpp.o
/home/mgates/repos/tlapack/build-catch2/_deps/testblas-src/src/test_infNaN.cpp:10:10: fatal error: catch2/catch.hpp: No such file or directory
   10 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN.cpp.o] Error 1
/home/mgates/repos/tlapack/build-catch2/_deps/testblas-src/src/test_infNaN_trsv_trsm.cpp:13:10: fatal error: catch2/catch.hpp: No such file or directory
   13 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN_trsv_trsm.cpp.o] Error 1
/home/mgates/repos/tlapack/build-catch2/_deps/testblas-src/src/test_infNaN_nrm2.cpp:17:10: fatal error: catch2/catch.hpp: No such file or directory
   17 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/CMakeFiles/tester.dir/__/_deps/testblas-src/src/test_infNaN_nrm2.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/tester.dir/all] Error 2
[ 58%] Linking CXX executable version
[ 58%] Built target version
[ 61%] Linking CXX executable example_accessTypes
[ 64%] Linking CXX executable example_gemm
[ 66%] Linking CXX executable cpp_visualizer_example
[ 66%] Built target example_accessTypes
[ 66%] Built target example_gemm
[ 66%] Built target cpp_visualizer_example
[ 69%] Linking CXX executable example_geqr2
[ 69%] Built target example_geqr2
[ 71%] Linking CXX executable example_eigenvalues
[ 71%] Built target example_eigenvalues
make: *** [all] Error 2

Avoid including the whole tlapack.hpp on example and tests

Compilation times are still bothering me. We shouldn't include the whole tlapack.hpp on tests and examples. Also, by including parts of the code, we test that each header file works separately. They should be able to work independently.

Error when building geqr2 example via make

The geqr2 example's README says it can be built with cmake or make. I populated make.inc with my installation information, but when I tried to run make I got the following output

(base) riley@borneophant:~/Documents/Research/protorandlapack/cpp/extern/tlapack/examples/geqr2$ make
g++ -I"/opt/tlapack/include" -Wall -pedantic -c -o example_geqr2.o example_geqr2.cpp
g++ -I"/opt/tlapack/include" -Wall -pedantic -o example_geqr2 example_geqr2.o -L"/opt/tlapack/lib" -ltblas
/usr/bin/ld: cannot find -ltblas
collect2: error: ld returned 1 exit status

I was able to get cmake to work. Is building this example with make still supported? If so, what's "tblas"?

compilation times

A typical problem of c++ libraries is compilation time.

We're already running into this with the compilation time of the tester. Some solutions:

  • Explicit template instantiation to get some precompilation
  • Cool it a little with the templates, since more templates = extra compilation times (yes, i'm still against the side and op types ;) )
  • Instead of including <tlapack.h> only include the necessary headers in the tests and examples.

remove `k` from the interface from ung2r, get `k` from size of tau

template <class matrix_t, class vector_t>
inline constexpr void ung2r_worksize(size_type<matrix_t> k,
const matrix_t& A,
const vector_t& tau,
workinfo_t& workinfo,
const workspace_opts_t<>& opts = {})

Let us remove the parameter k from the interface from ung2r, we can get the parameter k from the size of tau.

This is akin to what @yuxincai11 did for ungl2. See

template <class matrix_t, class vector_t>
inline constexpr void ungl2_worksize(const matrix_t& Q,
const vector_t& tauw,
workinfo_t& workinfo,
const workspace_opts_t<>& opts = {})

Note: also we need to write a tester for geqr2+ung2r

@maameasamoah17

Bug in some examples

There are two known problems with the current examples I am aware of. Both are evidenced in the step "Run all examples" on the Github Workflow:

  1. The example with C wrappers fail to run on Windows.
 - example_cwrapper_gemm --------
gmake.exe[3]: *** [examples/CMakeFiles/run-all-examples.dir/build.make:72: examples/CMakeFiles/run-all-examples] Error 127
  1. example_geqr2 runs but the computations are incorrect:
run< float  >( 7, 5 )
time = +5.90000e-03 ms,   GFlop/sec = +9.03955e-02
||QR - A||_F/||A||_F  = +8.16279e-01,        ||Q'Q - I||_F  = +7.15297e+00
-----------------------
run< double >( 7, 5 )
time = +6.00000e-04 ms,   GFlop/sec = +8.88889e-01
||QR - A||_F/||A||_F  = +8.27540e-01,        ||Q'Q - I||_F  = +9.29923e+00
-----------------------
run< long double >( 7, 5 )
time = +6.00000e-04 ms,   GFlop/sec = +8.88889e-01
||QR - A||_F/||A||_F  = +1.03541e+00,        ||Q'Q - I||_F  = +7.62777e+00
-----------------------

In my machine, example_geqr2 shows an expected output:

run< float  >( 7, 5 )
time = +2.46360e-02 ms,   GFlop/sec = +2.16485e-02
||QR - A||_F/||A||_F  = +1.53518e-07,        ||Q'Q - I||_F  = +6.22242e-07
-----------------------
run< double >( 7, 5 )
time = +2.38810e-02 ms,   GFlop/sec = +2.23330e-02
||QR - A||_F/||A||_F  = +2.52670e-16,        ||Q'Q - I||_F  = +9.09353e-16
-----------------------
run< long double >( 7, 5 )
time = +6.64540e-02 ms,   GFlop/sec = +8.02560e-03
||QR - A||_F/||A||_F  = +1.03292e-19,        ||Q'Q - I||_F  = +2.92372e-19
-----------------------

I am using gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) with no compiler flags other than the specified for the Github Workflow.

Remove dependency on std::complex

std::complex is one way to define complex numbers. It has some undesired behaviors such as:

  • std::abs(std::complex<T>) may not propagate NaNs. See #134 (comment).
  • Operations with std::complex<T>, for T=float,double,long double are wrappers to operations in C. Other types have their implementation in C++. Because of that, the logic of complex multiplication, division and other operations may change from type to type. See advanpix/mpreal#11.

We can avoid this dependency by using tlapack::real_type, tlapack::complex_type and tlapack::scalar_type. Those structures should then be specialized to each new complex type that we want to support.

workspace query, switch to function return instead of [in, out]

I'm not a big fan of the current workspace queries

workspace queries now look something like this:

    workinfo_t workinfo;
    foo_worksize( ..., workinfo );
    bar_worksize( ..., workinfo );

This does lead to compact code, but it does not read that well (at least to me). I would suggest that instead of an [in,out] reference, we have the function return the workinfo, so that we get something like this:

    auto workinfo = foo_worksize(...);
    workinfo += bar_worksize(...);

This makes it more clear at a glance what the function is actually doing, it also makes it very clear whether we are adding the workspace together or taking the max.

If i recall correctly, this is how they were originally implemented so i'm not not sure why this was changed.

Out of bounds access in larfb

Larfb has an out of bounds access if m == k (i.e. there is only the triangular part of V and V2 is of size zero)

larfb also misses a lot of input checks

larf currently considers v[0]=1

The current interface of larf is

void larf_worksize(
    side_t side, storage_t storeMode,
    vector_t const& v, const tau_t& tau, matrix_t& C,
    workinfo_t& workinfo, const workspace_opts_t<>& opts = {} );

It assumes v[0]=1. The LAPACK version uses the whole vector v. The change was done so that v[0] doesn't need to be changed to 1 whenever one wants to apply the reflector. There is one problem that was not predicted: in the QL and RQ decompositions, the 1 is at the very end of the vector v.

I propose a solution that is the one used in larfb: add a parameter "direction". If direction is forward then v = [ 1 x ], if direction is backward then v = [ x 1 ].

I will propose the PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.