rokzitko / nrgljubljana

NRG Ljubljana is a numerical renormalization group implementation for solving quantum impurity problems in theoretical physics
GNU General Public License v3.0
30 stars 8 forks source link

Problem met when compiling: no viable constructor or deduction guide for deduction of template arguments of 'subrange' #17

Open ZhouGD2000 opened 8 months ago

ZhouGD2000 commented 8 months ago

I downloaded the latest code ( version : 2023.11 Git hash: c972dd2b60229016c4516d83169a433e929e4db9) and compiled it following the instruction in README.md in MacOS Ventura 13.5.1, with clang 14.0.0 (which supports c++17):

mkdir build
147    cd build
148    cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/nrgljubljana/ 
149    make
150    make install

I run cmake successfully after I install the required package but when I run 'make' several error occurred. I quote part of the output here and the whole output is in the attached file. make.log

[  1%] Building CXX object c++/CMakeFiles/nrgljubljana_c.dir/nrg-lib.cc.o
clang: warning: argument unused during compilation: '-Xclang -fopenmp' [-Wunused-command-line-argument]
In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/nrg-lib.cc:1:
In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/nrg-general.hpp:91:
In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/core.hpp:13:
/Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/eigen.hpp:250:64: error: no viable constructor or deduction guide for deduction of template arguments of 'subrange'
  [[nodiscard]] auto value_corr_kept() const noexcept { return ranges::subrange(values.all_corr().begin(), values.all_corr().begin() + getnrkept()); }

I do not know where are the problems. Could you give me some instruction? Thanks a lot.

rokzitko commented 8 months ago

You will probably need a more recent compiler. The README should be updated, since the more recent versions of the code actually require C++17 if not C++20 (I usually compile in C++20 mode).

On 29 Nov 2023, at 12:49, Nightwatcher @.***> wrote:

I downloaded the latest code ( version : 2023.11 Git hash: c972dd2 https://github.com/rokzitko/nrgljubljana/commit/c972dd2b60229016c4516d83169a433e929e4db9) and compiled it following the instruct in README.md in MacOS Ventura 13.5.1, with clang 14.0.0 (which supports c++14):

mkdir build 147 cd build 148 cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/nrgljubljana/ 149 make 150 make install I run cmake successfully after I install the required package but when I run 'make' several error occurred. I quote part of the output here and the whole output is in the attached file. make.log https://github.com/rokzitko/nrgljubljana/files/13499929/make.log [ 1%] Building CXX object c++/CMakeFiles/nrgljubljana_c.dir/nrg-lib.cc.o clang: warning: argument unused during compilation: '-Xclang -fopenmp' [-Wunused-command-line-argument] In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/nrg-lib.cc:1: In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/nrg-general.hpp:91: In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/core.hpp:13: /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/eigen.hpp:250:64: error: no viable constructor or deduction guide for deduction of template arguments of 'subrange' [[nodiscard]] auto value_corr_kept() const noexcept { return ranges::subrange(values.all_corr().begin(), values.all_corr().begin() + getnrkept()); } I do not know where are the problems. Could you give me some instruction? Thanks a lot.

— Reply to this email directly, view it on GitHub https://github.com/rokzitko/nrgljubljana/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG57NBGLF2J645OORJONLATYG4OK7AVCNFSM6AAAAAA77KNFMWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTMNBRGI3TSNQ. You are receiving this because you are subscribed to this thread.

ZhouGD2000 commented 8 months ago

Thanks a lot. After changing to compilers supporting C++20, I sucessfully compiled nrgljubljana. I still have some problems when running it, but I guess this is because I haven't recompiled all the libraries with the new compiler. I will resolve the problems myself.

You will probably need a more recent compiler. The README should be updated, since the more recent versions of the code actually require C++17 if not C++20 (I usually compile in C++20 mode). On 29 Nov 2023, at 12:49, Nightwatcher @.***> wrote: I downloaded the latest code ( version : 2023.11 Git hash: c972dd2 <c972dd2>) and compiled it following the instruct in README.md in MacOS Ventura 13.5.1, with clang 14.0.0 (which supports c++14): mkdir build 147 cd build 148 cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/nrgljubljana/ 149 make 150 make install I run cmake successfully after I install the required package but when I run 'make' several error occurred. I quote part of the output here and the whole output is in the attached file. make.log https://github.com/rokzitko/nrgljubljana/files/13499929/make.log [ 1%] Building CXX object c++/CMakeFiles/nrgljubljana_c.dir/nrg-lib.cc.o clang: warning: argument unused during compilation: '-Xclang -fopenmp' [-Wunused-command-line-argument] In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/nrg-lib.cc:1: In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/nrg-general.hpp:91: In file included from /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/core.hpp:13: /Users/zgd/Nutstore Files/zgd/phy/research/Numerical/nrgljubljana/c++/eigen.hpp:250:64: error: no viable constructor or deduction guide for deduction of template arguments of 'subrange' [[nodiscard]] auto value_corr_kept() const noexcept { return ranges::subrange(values.all_corr().begin(), values.all_corr().begin() + getnrkept()); } I do not know where are the problems. Could you give me some instruction? Thanks a lot. — Reply to this email directly, view it on GitHub <#17>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG57NBGLF2J645OORJONLATYG4OK7AVCNFSM6AAAAAA77KNFMWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTMNBRGI3TSNQ. You are receiving this because you are subscribed to this thread.