electronic-structure / SIRIUS

Domain specific library for electronic structure calculations
BSD 3-Clause "New" or "Revised" License
125 stars 40 forks source link

Tests fail to build: error: no matching member function for call to 'allocate' #947

Closed yurivict closed 9 months ago

yurivict commented 9 months ago

When SIRIUS is built with SIRIUS_USE_MEMORY_POOL=OFF, tests fail to build:

In file included from /usr/ports/science/sirius/work/SIRIUS-7.5.0/apps/unit_tests/test_mempool.cpp:2:
/usr/ports/science/sirius/work/SIRIUS-7.5.0/src/core/memory.hpp:364:16: error: no matching member function for call to 'allocate'
        return allocate<T>(num_elements__, M_);
               ^~~~~~~~~~~
/usr/ports/science/sirius/work/SIRIUS-7.5.0/apps/unit_tests/test_mempool.cpp:14:26: note: in instantiation of function template specialization 'sirius::memory_pool::allocate<std::complex<double>>' requested here
    auto ptr        = mp.allocate<double_complex>(1024);
                         ^
/usr/ports/science/sirius/work/SIRIUS-7.5.0/src/core/memory.hpp:355:5: note: candidate function template not viable: requires single argument 'num_elements__', but 2 arguments were provided
    allocate(size_t num_elements__)
    ^
/usr/ports/science/sirius/work/SIRIUS-7.5.0/src/core/memory.hpp:364:16: error: no matching member function for call to 'allocate'
        return allocate<T>(num_elements__, M_);
               ^~~~~~~~~~~
/usr/ports/science/sirius/work/SIRIUS-7.5.0/apps/unit_tests/test_mempool.cpp:49:30: note: in instantiation of function template specialization 'sirius::memory_pool::allocate<double>' requested here
            double* ptr = mp.allocate<double>(sz);
                             ^
/usr/ports/science/sirius/work/SIRIUS-7.5.0/src/core/memory.hpp:355:5: note: candidate function template not viable: requires single argument 'num_elements__', but 2 arguments were provided
    allocate(size_t num_elements__)
    ^
/usr/ports/science/sirius/work/SIRIUS-7.5.0/src/core/memory.hpp:364:16: error: no matching member function for call to 'allocate'
        return allocate<T>(num_elements__, M_);
               ^~~~~~~~~~~
/usr/ports/science/sirius/work/SIRIUS-7.5.0/apps/unit_tests/test_mempool.cpp:94:20: note: in instantiation of function template specialization 'sirius::memory_pool::allocate<char>' requested here
    char* ptr = mp.allocate<char>(n);
                   ^
/usr/ports/science/sirius/work/SIRIUS-7.5.0/src/core/memory.hpp:355:5: note: candidate function template not viable: requires single argument 'num_elements__', but 2 arguments were provided
    allocate(size_t num_elements__)
    ^
3 errors generated.

Version: 7.5.0 clang-16 FreeBSD 14.0

simonpintarelli commented 9 months ago

Thank you for the report. This has been fixed it current develop branch: https://github.com/electronic-structure/SIRIUS/pull/939

toxa81 commented 9 months ago

Hi @yurivict ! I just tagged 7.5.1 which should contain the fixes for that.