devinamatthews / aquarius

Aquarius is a parallel quantum chemistry package built on the Cyclops Tensor Framework which provides high-performance structured tensor operations. Aquarius is primarily focused on iterative methods such as CC, CI, and EOMCC.
BSD 3-Clause "New" or "Revised" License
27 stars 11 forks source link

Code doesn't compile with GCC 9.2.1 or Intel 19 #23

Open susilehtola opened 4 years ago

susilehtola commented 4 years ago

I'm trying to compile Aquarius on my Fedora 30 laptop, which comes with GCC 9.2.1.

After #22 there's no problem finding ctf; instead the compile fails with errors about ambiguities. For instance

In file included from ./src/convergence/complex_linear_krylov.hpp:10,
                 from src/cc/ccsdipgf.hpp:6,
                 from src/cc/ccsdipgf.cxx:1:
./src/convergence/davidson.hpp: At global scope:
./src/convergence/davidson.hpp:398:9: error: reference to ‘enable_if_t’ is ambiguous
  398 |         enable_if_t<is_same<typename decay_t<c_container>::value_type, T>::value, vector<dtype>>
      |         ^~~~~~~~~~~
In file included from ./external/stl_ext/include/algorithm.hpp:8,
                 from ./src/util/stl_ext.hpp:37,
                 from ./src/util/global.hpp:22,
                 from src/cc/ccsdipgf.hpp:4,
                 from src/cc/ccsdipgf.cxx:1:
./external/stl_ext/include/type_traits.hpp:31:7: note: candidates are: ‘template<bool T, class U> using enable_if_t = typename std::enable_if::type’
   31 | using enable_if_t = typename enable_if<T,U>::type;
      |       ^~~~~~~~~~~
In file included from /usr/include/c++/9/bits/move.h:55,
                 from /usr/include/c++/9/bits/nested_exception.h:40,
                 from /usr/include/c++/9/exception:144,
                 from /usr/include/c++/9/ios:39,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from ./external/lawrap/fortran.h:13,
                 from ./src/util/lawrap.hpp:16,
                 from ./src/util/global.hpp:12,
                 from src/cc/ccsdipgf.hpp:4,
                 from src/cc/ccsdipgf.cxx:1:
/usr/include/c++/9/type_traits:2384:11: note:                 ‘template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type’
 2384 |     using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~
susilehtola commented 4 years ago

I'm also unable to compile the code with Intel 19.0.4.243 due to similar problems, only a small part copied here

In file included from ./src/convergence/complex_linear_krylov.hpp(10),
                 from src/cc/ccsdipgf.hpp(6),
                 from src/cc/ccsdipgf.cxx(1):
./src/convergence/davidson.hpp(398): error: "enable_if_t" is ambiguous
          enable_if_t<is_same<typename decay_t<c_container>::value_type, T>::value, vector<dtype>>
          ^

In file included from ./src/convergence/complex_linear_krylov.hpp(10),
                 from src/cc/ccsdipgf.hpp(6),
                 from src/cc/ccsdipgf.cxx(1):
./src/convergence/davidson.hpp(398): error: "decay_t" is ambiguous
          enable_if_t<is_same<typename decay_t<c_container>::value_type, T>::value, vector<dtype>>
devinamatthews commented 4 years ago

Try merging from the stl_ext_c++14 branch and see if that fixes the problem. I'll wait to merge #22 until we see if Aquarius compiles and runs fine with the updated CTF repo.

susilehtola commented 4 years ago

Compiles and runs fine with patch from stl_ext_c++14 and #22.

susilehtola commented 4 years ago

Thanks for the speedy fix!

susilehtola commented 4 years ago

OK, still running tests. The ch2-dz.ccsdt test looks a bit weird:

Wed Nov 20 15:56:19 2019: Starting task: ch2-dz.molecule

Molecular Geometry:

  C    0.000000000000000    0.084324913082064    0.000000000000000
  H    0.756982240000000   -0.502021146917936    0.000000000000000
  H   -0.756982240000000   -0.502021146917936    0.000000000000000

Rotation constants (MHz):  3041751.840826  1562530.205709  1032262.811341
The molecular point group is C1
There are [14] atomic orbitals by irrep
There are 5 alpha and 3 beta electrons

Wed Nov 20 15:56:19 2019: Finished task: ch2-dz.molecule in 0.063 s
Wed Nov 20 15:56:19 2019: Task: ch2-dz.molecule achieved 0.000 Gflops/sec
Wed Nov 20 15:56:19 2019: Starting task: ch2-dz.1eints
Wed Nov 20 15:56:20 2019: Finished task: ch2-dz.1eints in 1.420 s
Wed Nov 20 15:56:20 2019: Task: ch2-dz.1eints achieved 0.000 Gflops/sec
Wed Nov 20 15:56:20 2019: Starting task: ch2-dz.2eints
Wed Nov 20 15:56:21 2019: Finished task: ch2-dz.2eints in 0.988 s
Wed Nov 20 15:56:21 2019: Task: ch2-dz.2eints achieved 0.000 Gflops/sec
Wed Nov 20 15:56:21 2019: Starting task: ch2-dz.localaoscf
Wed Nov 20 15:56:29 2019: Iteration 1 occupation = [5], [3]
Wed Nov 20 15:56:31 2019: ch2-dz.localaoscf: Iteration 1 took 9.389 s
Wed Nov 20 15:56:31 2019: ch2-dz.localaoscf: Iteration 1 energy = 13.19303450812, convergence = 7.795e+00
Wed Nov 20 15:56:39 2019: Iteration 2 occupation = [5], [3]
Wed Nov 20 15:56:41 2019: ch2-dz.localaoscf: Iteration 2 took 9.696 s
Wed Nov 20 15:56:41 2019: ch2-dz.localaoscf: Iteration 2 energy = -36.00239264006, convergence = 6.920e+00
Wed Nov 20 15:56:49 2019: Iteration 3 occupation = [5], [3]
Wed Nov 20 15:56:51 2019: ch2-dz.localaoscf: Iteration 3 took 10.164 s
Wed Nov 20 15:56:51 2019: ch2-dz.localaoscf: Iteration 3 energy = -37.07865392845, convergence = 2.727e-01
Wed Nov 20 15:56:59 2019: Iteration 4 occupation = [5], [3]
Wed Nov 20 15:57:01 2019: ch2-dz.localaoscf: Iteration 4 took 10.329 s
Wed Nov 20 15:57:01 2019: ch2-dz.localaoscf: Iteration 4 energy = -37.08692840181, convergence = 5.691e-02
Wed Nov 20 15:57:10 2019: Iteration 5 occupation = [5], [3]
Wed Nov 20 15:57:13 2019: ch2-dz.localaoscf: Iteration 5 took 11.131 s
Wed Nov 20 15:57:13 2019: ch2-dz.localaoscf: Iteration 5 energy = -37.08756794634, convergence = 1.901e-02
Wed Nov 20 15:57:21 2019: Iteration 6 occupation = [5], [3]
Wed Nov 20 15:57:24 2019: ch2-dz.localaoscf: Iteration 6 took 11.128 s
Wed Nov 20 15:57:24 2019: ch2-dz.localaoscf: Iteration 6 energy = -37.08767367596, convergence = 6.624e-03
Wed Nov 20 15:57:33 2019: Iteration 7 occupation = [5], [3]
Wed Nov 20 15:57:35 2019: ch2-dz.localaoscf: Iteration 7 took 11.248 s
Wed Nov 20 15:57:35 2019: ch2-dz.localaoscf: Iteration 7 energy = -37.08769261889, convergence = 2.502e-03
Wed Nov 20 15:57:45 2019: Iteration 8 occupation = [5], [3]
Wed Nov 20 15:57:47 2019: ch2-dz.localaoscf: Iteration 8 took 12.320 s
Wed Nov 20 15:57:47 2019: ch2-dz.localaoscf: Iteration 8 energy = -37.08808645264, convergence = 1.649e-03
Wed Nov 20 15:57:58 2019: Iteration 9 occupation = [5], [3]
Wed Nov 20 15:58:00 2019: ch2-dz.localaoscf: Iteration 9 took 12.725 s
Wed Nov 20 15:58:00 2019: ch2-dz.localaoscf: Iteration 9 energy = -37.08769707569, convergence = 9.469e-06
Wed Nov 20 15:58:11 2019: Iteration 10 occupation = [5], [3]
Wed Nov 20 15:58:13 2019: ch2-dz.localaoscf: Iteration 10 took 13.006 s
Wed Nov 20 15:58:13 2019: ch2-dz.localaoscf: Iteration 10 energy = -37.08769722647, convergence = 1.895e-06
Wed Nov 20 15:58:23 2019: Iteration 11 occupation = [5], [3]
Wed Nov 20 15:58:25 2019: ch2-dz.localaoscf: Iteration 11 took 12.471 s
Wed Nov 20 15:58:25 2019: ch2-dz.localaoscf: Iteration 11 energy = -37.08769693630, convergence = 2.614e-07
Wed Nov 20 15:58:35 2019: Iteration 12 occupation = [5], [3]
Wed Nov 20 15:58:37 2019: ch2-dz.localaoscf: Iteration 12 took 11.999 s
Wed Nov 20 15:58:37 2019: ch2-dz.localaoscf: Iteration 12 energy = -37.08769696760, convergence = 1.354e-07
Wed Nov 20 15:58:48 2019: Iteration 13 occupation = [5], [3]
Wed Nov 20 15:58:50 2019: ch2-dz.localaoscf: Iteration 13 took 12.388 s
Wed Nov 20 15:58:50 2019: ch2-dz.localaoscf: Iteration 13 energy = -37.08769694736, convergence = 1.688e-08
Wed Nov 20 15:59:00 2019: Iteration 14 occupation = [5], [3]
Wed Nov 20 15:59:02 2019: ch2-dz.localaoscf: Iteration 14 took 12.636 s
Wed Nov 20 15:59:02 2019: ch2-dz.localaoscf: Iteration 14 energy = -37.08769694627, convergence = 2.499e-09
Wed Nov 20 15:59:12 2019: Iteration 15 occupation = [5], [3]
Wed Nov 20 15:59:14 2019: ch2-dz.localaoscf: Iteration 15 took 12.028 s
Wed Nov 20 15:59:14 2019: ch2-dz.localaoscf: Iteration 15 energy = -37.08769694625, convergence = 4.138e-10
Wed Nov 20 15:59:24 2019: Iteration 16 occupation = [5], [3]
Wed Nov 20 15:59:27 2019: ch2-dz.localaoscf: Iteration 16 took 12.102 s
Wed Nov 20 15:59:27 2019: ch2-dz.localaoscf: Iteration 16 energy = -37.08769694627, convergence = 3.491e-11
Wed Nov 20 15:59:37 2019: Iteration 17 occupation = [5], [3]
Wed Nov 20 15:59:39 2019: ch2-dz.localaoscf: Iteration 17 took 12.193 s
Wed Nov 20 15:59:39 2019: ch2-dz.localaoscf: Iteration 17 energy = -37.08769694627, convergence = 5.923e-12
Wed Nov 20 15:59:49 2019: Iteration 18 occupation = [5], [3]
Wed Nov 20 15:59:51 2019: ch2-dz.localaoscf: Iteration 18 took 12.425 s
Wed Nov 20 15:59:51 2019: ch2-dz.localaoscf: Iteration 18 energy = -37.08769694628, convergence = 7.693e-13
Wed Nov 20 15:59:51 2019: Dropping MOs: [0], [0]
Wed Nov 20 15:59:54 2019: Finished task: ch2-dz.localaoscf in 213.156 s
Wed Nov 20 15:59:54 2019: Task: ch2-dz.localaoscf achieved 0.000 Gflops/sec
Wed Nov 20 15:59:54 2019: Starting task: ch2-dz.aomoints
Wed Nov 20 16:00:12 2019: Finished task: ch2-dz.aomoints in 17.615 s
Wed Nov 20 16:00:12 2019: Task: ch2-dz.aomoints achieved 0.000 Gflops/sec
Wed Nov 20 16:00:12 2019: Starting task: ch2-dz.ccsdt
Wed Nov 20 16:00:26 2019: MP2 energy = -1.604990343306737
Wed Nov 20 16:04:44 2019: ch2-dz.ccsdt: Iteration 1 took 257.506 s
Wed Nov 20 16:04:44 2019: ch2-dz.ccsdt: Iteration 1 energy = -0.9056540728, convergence = 3.191e+00
Wed Nov 20 16:09:09 2019: ch2-dz.ccsdt: Iteration 2 took 264.727 s
Wed Nov 20 16:09:09 2019: ch2-dz.ccsdt: Iteration 2 energy = -57.63268535, convergence = 2.737e+00
Wed Nov 20 16:13:47 2019: ch2-dz.ccsdt: Iteration 3 took 278.230 s
Wed Nov 20 16:13:47 2019: ch2-dz.ccsdt: Iteration 3 energy = -62.40765069, convergence = 6.155e+00
Wed Nov 20 16:18:33 2019: ch2-dz.ccsdt: Iteration 4 took 285.871 s
Wed Nov 20 16:18:33 2019: ch2-dz.ccsdt: Iteration 4 energy = -30.28317453, convergence = 4.056e+00
Wed Nov 20 16:23:17 2019: ch2-dz.ccsdt: Iteration 5 took 283.923 s
Wed Nov 20 16:23:17 2019: ch2-dz.ccsdt: Iteration 5 energy = -10.35773274, convergence = 2.799e+00
Wed Nov 20 16:28:20 2019: ch2-dz.ccsdt: Iteration 6 took 303.668 s
Wed Nov 20 16:28:20 2019: ch2-dz.ccsdt: Iteration 6 energy = -9.931544999, convergence = 2.806e+00
Wed Nov 20 16:33:20 2019: ch2-dz.ccsdt: Iteration 7 took 299.986 s
Wed Nov 20 16:33:20 2019: ch2-dz.ccsdt: Iteration 7 energy = 55.17494871, convergence = 2.798e+01
Wed Nov 20 16:37:54 2019: ch2-dz.ccsdt: Iteration 8 took 273.412 s
Wed Nov 20 16:37:54 2019: ch2-dz.ccsdt: Iteration 8 energy = -15.57189387, convergence = 5.126e+00
Wed Nov 20 16:43:00 2019: ch2-dz.ccsdt: Iteration 9 took 305.878 s
Wed Nov 20 16:43:00 2019: ch2-dz.ccsdt: Iteration 9 energy = 43.28286370, convergence = 1.848e+01
Wed Nov 20 16:47:50 2019: ch2-dz.ccsdt: Iteration 10 took 289.944 s
Wed Nov 20 16:47:50 2019: ch2-dz.ccsdt: Iteration 10 energy = 53.77388574, convergence = 1.192e+01
Wed Nov 20 16:52:30 2019: ch2-dz.ccsdt: Iteration 11 took 280.854 s
Wed Nov 20 16:52:30 2019: ch2-dz.ccsdt: Iteration 11 energy = 31.65208969, convergence = 8.005e+00
Wed Nov 20 16:57:11 2019: ch2-dz.ccsdt: Iteration 12 took 280.896 s
Wed Nov 20 16:57:11 2019: ch2-dz.ccsdt: Iteration 12 energy = 365.1861711, convergence = 1.410e+02
Wed Nov 20 17:02:12 2019: ch2-dz.ccsdt: Iteration 13 took 300.651 s
Wed Nov 20 17:02:12 2019: ch2-dz.ccsdt: Iteration 13 energy = 497.0767750, convergence = 1.508e+02
Wed Nov 20 17:07:17 2019: ch2-dz.ccsdt: Iteration 14 took 305.437 s
Wed Nov 20 17:07:17 2019: ch2-dz.ccsdt: Iteration 14 energy = 1.489627414e+04, convergence = 1.926e+03
Wed Nov 20 17:11:52 2019: ch2-dz.ccsdt: Iteration 15 took 274.126 s
Wed Nov 20 17:11:52 2019: ch2-dz.ccsdt: Iteration 15 energy = 1.552293058e+04, convergence = 1.051e+03
Wed Nov 20 17:16:25 2019: ch2-dz.ccsdt: Iteration 16 took 273.787 s
Wed Nov 20 17:16:25 2019: ch2-dz.ccsdt: Iteration 16 energy = 780.1209886, convergence = 6.070e+02
Wed Nov 20 17:21:00 2019: ch2-dz.ccsdt: Iteration 17 took 274.711 s
Wed Nov 20 17:21:00 2019: ch2-dz.ccsdt: Iteration 17 energy = 1.136948372e+08, convergence = 6.666e+04
Wed Nov 20 17:25:35 2019: ch2-dz.ccsdt: Iteration 18 took 275.127 s
Wed Nov 20 17:25:35 2019: ch2-dz.ccsdt: Iteration 18 energy = 5.302605453e+07, convergence = 3.673e+04
Wed Nov 20 17:30:08 2019: ch2-dz.ccsdt: Iteration 19 took 272.360 s
Wed Nov 20 17:30:08 2019: ch2-dz.ccsdt: Iteration 19 energy = -5.360805411e+08, convergence = 3.561e+05
Wed Nov 20 17:34:41 2019: ch2-dz.ccsdt: Iteration 20 took 273.452 s
Wed Nov 20 17:34:41 2019: ch2-dz.ccsdt: Iteration 20 energy = -1.861094764e+09, convergence = 5.862e+05
Wed Nov 20 17:39:13 2019: ch2-dz.ccsdt: Iteration 21 took 271.687 s
Wed Nov 20 17:39:13 2019: ch2-dz.ccsdt: Iteration 21 energy = 1.878452934e+09, convergence = 1.347e+06
Wed Nov 20 17:44:02 2019: ch2-dz.ccsdt: Iteration 22 took 289.305 s
Wed Nov 20 17:44:02 2019: ch2-dz.ccsdt: Iteration 22 energy = 1.383676137e+23, convergence = 1.797e+12

but this might be caused by some other issue.

susilehtola commented 4 years ago

Any ideas on what is causing the CCSDT problem for ch2-dz?

susilehtola commented 2 years ago

Just tried the stl_ext_c++14 branch again with the upstream CTF repository with patch from https://github.com/cyclops-community/ctf/pull/141

I don't see the CCSDT problem any more.

vvp-nsk commented 1 year ago

Hi!

I could not compile Aquarius by using Intel compiler 2019.5 and GCC 9.3.0:

CXX src/cc/eomeeccsd.o src/cc/eomeeccsd.cxx(102): error: no instance of function template "aquarius::cc::EOMEECCSD::get [with U=double]" matches the argument list argument types are: (std::tuple<double, int, int, int>) if (get<1>(root) == 0) ^ ./src/task/task.hpp(307): note: this candidate was rejected because there is a type mismatch after argument substitution template T& get(const string& name) ^ detected during instantiation of "bool aquarius::cc::EOMEECCSD::run(aquarius::task::TaskDAG &, const aquarius::Arena &) [with U=double]" at line 420

src/cc/eomeeccsd.cxx(107): error: no instance of function template "aquarius::cc::EOMEECCSD::get [with U=double]" matches the argument list argument types are: (std::tuple<double, int, int, int>) get<1>(root) = -1;

Just in case: git log --oneline b0db65b Merge branch 'stl_ext_c++14' of https://github.com/devinamatthews/aquarius into stable 9b75a7a Merge pull request #24 from jeffhammond/update-configure 927631e autoreconf 2.70+ required for ifx e5c5056 Merge pull request #22 from susilehtola/ctfrepo ...

With best regards, Victor