RMGDFT / rmgdft

RMG is an Open Source code for electronic structure calculations and modeling of materials and molecules. It is based on density functional theory and uses a real space basis and pseudopotentials.
GNU General Public License v2.0
47 stars 11 forks source link

error: no matching constructor for initialization of 'std::shared_ptr<double []>' #69

Closed yurivict closed 1 year ago

yurivict commented 2 years ago
In file included from /disk-samsung/freebsd-ports/science/rmgdft/work/rmgdft-4.2.2-85-ge124f6b3/Input/LoadUpfPseudo.cpp:3:
In file included from /usr/include/c++/v1/iostream:37:
In file included from /usr/include/c++/v1/ios:215:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:511:
In file included from /usr/include/c++/v1/string_view:179:
In file included from /usr/include/c++/v1/__string:57:
In file included from /usr/include/c++/v1/algorithm:653:
/usr/include/c++/v1/memory:911:28: error: no matching constructor for initialization of 'std::shared_ptr<double []>'
        ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
                           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__memory/allocator_traits.h:288:13: note: in instantiation of function template specialization 'std::allocator<std::shared_ptr<double []>>::construct<std::shared_ptr<double []>, double *>' requested here
        __a.construct(__p, _VSTD::forward<_Args>(__args)...);
            ^
/usr/include/c++/v1/vector:926:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<std::shared_ptr<double []>>>::construct<std::shared_ptr<double []>, double *, void>' requested here
    __alloc_traits::construct(this->__alloc(), _VSTD::__to_address(__tx.__pos_),
                    ^
/usr/include/c++/v1/vector:1684:9: note: in instantiation of function template specialization 'std::vector<std::shared_ptr<double []>>::__construct_one_at_end<double *>' requested here
        __construct_one_at_end(_VSTD::forward<_Args>(__args)...);
        ^
/disk-samsung/freebsd-ports/science/rmgdft/work/rmgdft-4.2.2-85-ge124f6b3/Input/LoadUpfPseudo.cpp:408:22: note: in instantiation of function template specialization 'std::vector<std::shared_ptr<double []>>::emplace_back<double *>' requested here
            sp->beta.emplace_back(UPF_read_mesh_array(PP_BETA, r_total, ibegin));
                     ^
/usr/include/c++/v1/memory:2737:23: note: candidate constructor not viable: no known conversion from 'double *' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument
    _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;

revision e124f6b3 clang-12 OS: FreeBSD 13

yurivict commented 2 years ago

@elbriggs Any chance to fix this? I tried to create the FreeBSD port for rmgdft and this is a show stopper.

elbriggs commented 2 years ago

I don't have access to a FreeBSD machine right now but with recent updates to master rmgdft builds successfully with several clang versions.

elbriggs commented 1 year ago

Closing this since recent RMG versions build with clang.